Consider two agents, with statecharts. Now I have read that the two are able to communicate or make use of each others statecharts, via messages.
Now, the question is, how does this method of communication work ? As in does a message initiate the entire statechart present or does it initiate a particular part of the statechart and how does it do so?
I have not been able to find the answer in the anylogic guide(help) provided.
Asked
Active
Viewed 432 times
1

mahesh Rao
- 375
- 1
- 4
- 16
1 Answers
1
the statechart is not initiated with a message. It is initiated when the agent is created, after that the statechart proceeds according to the criteria you've set up in it.
the communication between agents can be used for triggers, ie. you set a condition for transitions, so that it need a specific message to proceed to the next state.
reference:
Communication between agents
and
Message Triggered Transition

Nikolaj Klitlund Børty
- 707
- 3
- 20
-
So how are the agents prioritised ? i.e. with 2 agents in a model, how does it know which agent to start the simulation with ? – mahesh Rao Nov 25 '16 at 15:40
-
first of, the simulation starts at the beginning. when the agents sends the messages the simulation is already running. if two agents sends the same message, to the same statechart. the first one is first served and the statechart proceeds. If you don't have another message-triggered-transitions (in the next stage) which looks for a second message. The message is ignored. – Nikolaj Klitlund Børty Nov 28 '16 at 06:41