Download Mathematical and Simulation Models in the AnyLogic program

Transcript
Mathematical and Simulation Models in the AnyLogic Program
11
The model is now almost finished, but we still have to do something to start the
work.Recall that on the diagrams for the agents each agent will be placed on creating
the uninfected state because the state shows the initial indicator. Since there is no
infected person, nothing will happen. Thus there is a need for one agent to manually
enter a code that will start the epidemic. It is necessary to open the Code field in the
Main Class section of the Startup Code and then enter:
ljudi.item(0).statechart.fireEvent("kontakt");
which ordered to the zeroth agent to send the signal event contact. Animation can be
kept simple for the time being. Next, we shall draw a rectangle animation to be used
for graphical representation of the infected, uninfected and recovered. Graphical
display is enabled by using the Business Graphics Library, where it is necessary to
insert the object ChartTime into the class structure diagram Main. The properties of
chartTime are set on the next picture:
Now, running the simulations, we obtain the following graph: