0

i have a simple anylogic model for pedestrian movement from start line towards target line

i want to change the speed of the moving agents at some condition.

enter image description here

i test the condition using events

if the number of agents in a specific area exceeds 20, i change the speed of the agents in the previous area using agent.setspeed()

enter image description here

when i run the simulation and the event is triggered i get this exception:

enter image description here

1 Answers1

0

This is an interesting problem... and this is the solution...

1) Your population people is NOT of pedestrian type... so you cannot use the pedestrian API even though you are using the pedestrian library... you have to use a pedestrian type: pedestrian type

2) Once you created the pedestrian type, your population "people" has to be created based on that type... only after this you will have a population that allows you to use the pedestrian API

3) In the pedestrian API, setSpeed() function doesn't exist, instead you should replace it with pers.setComfortableSpeed(0.5,MPS); Of course you can only do this once you completed at least my point 1.

Felipe
  • 8,311
  • 2
  • 15
  • 31