Search code examples
simulationanylogic

Getting attractor position of a collection (arraylist) as point destination in pedGoTo block


i'm new to Anylogic, and i'm creating a evacuation simulation for a 3 level building, i got each layout in a specific level. For my simulation, i create pedestrian on each level, on a specific targetline, i want the agents to go to an anttractor in that level, which i added to a collection of attractors.

My agent, Empleados, has got a parameter lugarTrabajo: prntScreen of parameter

in the simulation, i use ped.lugarTrabajo.getX() and ped.lugarTrabajo.getY() to get an point where to go, but it seems to not respect the attractors in a specific level.

pedGoTo block is configured as: pedGoTo block config

Any help on how i can get the agent to only target an attractor of a specific collection and on the right level in the simulation?

I tried to get X,Y coordinates with the getXY method, but it generates coordinates outside of the node where i have my collection of attractors.


Solution

  • Well, you are sending your peds to XY coordinates, it does not care about some attractor. It just moves to the XY position in its level.

    If you want to send it to the actual attractor, you can't. Attractors are just little helpers to make animations look neater.

    Instead, you should use PointNode nodes and send them there. Do not use the "Target = XY" option but the "node" option and it should respect levels.