AnyLogic
Expand
Font size

Statechart entry point

Statechart entry point is used to indicate the initial state of the statechart. There should be exactly one statechart entry point defined for each statechart.

You may define several independent statecharts for the same agent, each one describing some particular process. In this case AnyLogic will distinguish how many distinct statecharts are there by analyzing the number of statechart entry points.

Demo model: Statecharts for Car Engine and Gearbox Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

To draw a statechart entry point

  1. Statechart entry point should point to some state of a statechart that you want to make the global initial state for this statechart.
  2. In case this state is already drawn, drag the Statechart Entry Point element from the Statechart palette onto the diagram of agent so that the end point of this element gets connected to the state that you want to make the initial one.

  3. Otherwise, if you start drawing your statechart with an entry point, just drag the Statechart Entry Point element onto your diagram and continue constructing your statechart by drawing a state connected to this entry point and so on.
Do not confuse statechart entry point with initial state pointer. The latter one is used to define an initial state inside some composite one.

Properties

General

Name – The name of the statechart entry point. The name is used to identify and access the entry point from code.

Show name – If selected, the name of the statechart entry point is displayed on a presentation diagram.

Ignore – If selected, the statechart entry point is excluded from the model.

Visible – If selected, the statechart entry point is visible on a presentation at runtime.

Action – Here you can specify Java statements to be executed when the statechart entry point forwards the control to an initial state.

Log to database – If selected, information on all transition trigger moments will be saved into the model execution log statechart_transitions_log (if logging is turned on in the model's Database properties).
How can we improve this article?