0
votes

In Anylogic, how to make an agent run an action (like search in a certain radius for an agent) while moving towards another agent? I'm using PML to move to another agent but how can I include an intermediate task in the flow? Maybe combining with state charts? Any idea?

1

1 Answers

0
votes

Difficult to say with these details but I feel like you may want something of this sort:

This event should be inside the agent that is moving (in which case the "yourAgent." should be removed:

Conditional Event

Another option is to have a statechart inside the agent that is moving, something like this: You trigger the message transition when your agent starts moving and you create a conditional transition with the condition distanceTo(otherAgent)statechart

There are more ways of doing this... but these 2 came to mind first