Gregory talks about a possible 'architecture' for the communication and movement but, to answer at the more general level of agent movement and embedding:
If your Agent types are AgentA
, AgentB
and AgentC
with embedding as you say (population of AgentB
s in their 'home' AgentC
) then every AgentB
instance will automatically have a link (a Link to upper level agent) to the embedding AgentC
called agentC
.
So, when an AgentA
receives a message from an AgentB
, you can just do something like
moveTo(sender.agentC)
or
jumpTo(sender.agentC.getX(), sender.agentC.getY())
(The sender
is a special keyword referring to the sending agent in "On message received" code blocks. jumpTo
moves instantly to somewhere rather than moving with whatever speed the agent has. Unfortunately moveTo
lets you specify another agent as the target but jumpTo
has to use coordinates or nodes.)
See the following help sections:
- AnyLogic Help > Agent Based Modeling > Agent interaction >
Communication between agents
- AnyLogic Help > Release Notes > What's new in previous releases >
What's new in AnyLogic 7 > Link to upper level agent [section]
- AnyLogic Help > Agent Based Modeling > Agent movement >
Movement in Continuous Space