Phase 3. Defining Transport agent behavior
We will create the initial
agent type configuration.
is the most advanced construct to describe event- and time-driven behavior. For some objects, this event- and time-ordering of operations is so pervasive that you can best characterize the behavior of such objects in terms of a state transition
diagram – a statechart.
Statechart has states and transitions. Transitions may be triggered by user-defined conditions (timeouts or rates, messages received by the statechart, and Boolean conditions). Transition execution may lead to a state change where a new set of
transitions becomes active. States in the statechart may be hierarchical, i.e. contain other states and transitions.
Statechart is used to show the state space of a given algorithm, the events that cause a transition from one state to another, and the actions that result from state change.
Add the transport variables
- Go to the
view and double-click
to open it.
- Add a
- Name the variable
and set its type to
- In the same manner add another variable, name it
and set its type to
Draw transport statechart
- We will use the
palette elements to define the transport agent type behavior. Drag the
Statechart Entry Point
element into the graphical editor of
Transport. It defines the beginning of the whole diagram. Add a
by dragging it from the
palette and dropping the state under the statechart entry point. To add a transition, double-click
in the palette. Its icon will turn into
, it means the tool is in
the drawing mode. Now you can draw transitions by clicking in the graphical editor. Since the transitions must be connected to the states, you can click in the state when drawing to ensure proper connection.
When the elements are successfully connected, AnyLogic diaplays a cyan-colored point in the place of connection.
- At this phase we will only create an "empty"
that consists of four states, six transitions of different types and one branch.
- The states are called
MovingToMC. These are basically all actions and routes of trucks and helicopters in the model. Make sure you follow the structure that is shown in the figure below. In the properties of the transition leading from the branch to the
- The "internals" of some of these states and transitions refer to the model elements we have not yet defined. On the other hand, we need this statechart now because some of those model elements that we are going to define in further phases refer
to this statechart and states in it. That is why we will finish configuring
in the very end of model development process.
Let us next define the transport type choice according to request type and the availability of trucks and helicopters at the maintenance center.
Phase 2. Setting up the transport base
Phase 4. Defining Maintenance Center behavior