We will be defining model logic and processes on each agent type diagram in the next phases of model development. We will start with Main configuration which sets trucks and helicopters position in the space.
Complex simulation modeling cannot go without algorithms that usually perform some data processing or calculations. AnyLogic supports actioncharts - structured block charts allowing defining algorithms graphically in the style of structured programming. We use widely known extension of an approach suggested by Dijkstra that splits algorithms into sub-sections with a single point of entry. It states that three ways of combining programs—sequencing, selection, and iteration—are sufficient to express any computable algorithm. The style reduces understanding an algorithm to understanding each structure on its own.
Action charts are very helpful since using them you can define algorithms even if you are not familiar with syntax of Java operators.In fact, action chart visually defines a function and you can use ordinary AnyLogic functions as before. However, using actioncharts gives you one more evident benefit: it visualizes the implemented algorithm, making it more intuitive to other users.
We have created the actionchart, called setTransportBase, that represents the function which places the transport at the maintenance center. This is where we need the transport types to be located initially at the model start.
Select Main in the model tree (or click anywhere in its graphical editor) and go to its properties. Expand the properties section Agent actions and tell it to run our function On startup of the model:
Now you can run the model again. You will see that the trucks and helicopters are "sitting" now in the maintenance center. We will define their movement and all other agents behavior in the following phases of model development.
Reference model: Maintenance - Phase 2
Phase 1. Creating different types of agents
Phase 3. Defining Transport agent behavior