Search code examples
javaanylogic

How to find the destination (targetline) of agents/pedestrians in anylogic?


Now I use pedsource to generate pedestrians in Main, and set 4 targetlines. Pedestrians will walk between these targetlines. I want to get the data about the destination of these pedestrians (which targetline that each pedestrian moves towards). Is there any code to get this data?

Thanks!


Solution

  • There are various calls for pedestrians to get their target location: enter image description here

    If you need to get the TargetLine that is set when they enter a "Ped move to" block, you can use a manual approach to store that in the ped agent type when it enters the "Ped move to" block:

    1. add a variable of type TargetLine to your ped agent type
    2. when peds decide which target line to use, also store it into the new variable as well