Search code examples
anylogic

Is there a way to use attractors only as a position within a node, not as a destination?


If I have seized resources being sent to a node (the exam room that was seized prior to seizing the resource unit) in which a patient is waiting, they end up standing in the exact same spot, even if I have 2 attractors in the node, the system only considers 1 of them. It would be much clearer if I can designate 2 spots for agent and resource unit to stand on while they are interacting.

Currently, I send seized resource to the destination of other seized resource unit (the exam room). But if I send seized resource to the attractor, I have to specify an attractor. It seems like this will only send the seized resource to the attractor I specify, but not the one that is in the same node as the exam room that the resource unit is meant to go to. How can I send seized resource units to an attractor in the same node in which the agent is waiting for it?


Solution

  • You can make agents move to a specific attractor inside the area by calling

    node.getAttractors().get(0)

    Where node is the node you want them to move to and 0 is the attractor number.

    If you only have 1 then make the first go to the first and then set a variable to true to flag that the next one must be used.

    For a more advanced setup please check

    https://stackoverflow.com/a/68280994/4019094