Sihem
Sihem

Reputation: 1

Is it possible to show all statecharts from different agent at the same time during execution?

I have several agents.In each agent, I've made a state chart. Some states overlap with other states from other agents. With my simulation I want to show in which state an agent is currently in. Is it possible to show all statecharts at the same time (during execution)? For example via viewArea?I only find examples in the AnylogicHelp if the statecharts are already in the main, but not if they are in the agents. I am happy about every answer and thank you very much.

NEW Thank you for your quick response. I have formulated my question unclearly. I know your suggested solution from "AnyLogic in three days" or "The big book of simulation modeling". My point is that I want to display the statecharts of all agents side by side in the Main. I can't just drag these statecharts into the main, because some codes don't work anymore. So I have several different agents with certain properties (parameters etc.). In each agent I have created a statechart. One of my subgoals is to show the processes of all agents at the same time by statecharts (in the Main). I want to see where an agent is in which state during the simulation execution. During the execution you can display a statechart by selecting an agent, see inserted figure. I want to display all statecharts at the same time in the main, but in a way that they remain in the respective agent. Excuse me...my English is not that good. Thank you very much. :)

Upvotes: 0

Views: 163

Answers (1)

Benjamin
Benjamin

Reputation: 12803

Typically, you animate some part of each of your agents to reflect their state. Use a rectangle for example. Then, in each state "OnEnter" code box, change its color using ' rectangle.setFillColor(red)'.

Now, each agent will be visible on Main (if you embedded them properly) and you get a visual indication of their state.

Lots of example models do this as well, check them out:)

Upvotes: 0

Related Questions