anylogic

How to access ResourcePool of higher level agent?


How do I create a shared resource_pool for all 7 Production_Lines?

I've tried creating a resource pool in the main agent, but its not accessible from service or seize blocks withing the Production_Line agent.

I've also tried creating a variable inside the Production_Line of object type "ResourcePool" and referencing the main.Workers resource pool, but I can't do anything with it, in terms of using that reference to a resource pool in the seize or service blocks.

I've also tried making the service block visible to the upper agent, but I can't really "access" the resource pool from within the main-agent, so I could use the properties window to assign the resource pool.


Solution

  • I assume by 'non accessible' you mean 'not in the dropdown list'. If you click the equal sign beside the Resource sets: box, it will turn into a standard code box and you can write there anything (even call functions that return the resource set).

    In my experience the syntax can be a bit tricky at first, so I suggest creating a dummy ResourcePool in Production_Line, use it for the desired settings, then click the equal sign and replace the name of your dummy pool with main.resource_pool (you can delete the dummy pool afterwards).

    enter image description here