Search code examples
anylogic

Seize block, controlling agent location depending resource used


I am aware that in the following example there is a more elegant way to go about it (e.g. using Service block. However, I want to understand the Seize/Delay/Release blocks a bit better.

Objective of example shown below:

  • When seize block takes from resource pool normalRooms, agent is to be relocated from nodeWaitingArea to node nodeNormalRooms.
  • When seize block takes from resource pool largeRooms, agent is to be relocated from node nodeWaitingArea to node nodeLargeRooms.

Seize/Delay/Release

I have no problem finding correct target location - but I don't know how to control the relocation from the "Waiting area" to the correct location (nodeNormalRooms or nodeLargeRooms).

I assume it is by "Agent Location" in the delay block - but this only accepts static values. What is the best way to solve this?


Solution

  • I think it's better to just add a moveTo block before the delay... in which case you can control the new location.

    Also on the on enter action of the delay block you can use agent.jumpTo(newNode);