I found the moveTo() functions in the documentation for agents. Since Pedestrian extends Agent, I assumed it would work on them too, but I’ve been getting this unsupported operation exception:
Unsupported Operation Exception
This is how I’m using it in an event inside my agent type:
this.moveToNearestAgent(targets);
‘targets’ is an ArrayList of another type of agent.
I have already read this Anylogic help page but it didn’t seem to answer my question:
https://anylogic.help/anylogic/agentbased/movement-continuous.html
Am I doing something wrong, or is moveTo just not supported for Pedestrians? If so, is there an alternative for Pedestrians with similar functionality?
user26618530 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.