Building Hierarchical Models

AnyLogic models are hierarchically organized, since agents may encapsulate other agents to any desired depth. This enables you to decompose a model into as many levels of detail as required, since each agent typically represents a logical section of the model. Each AnyLogic model has a top level agent which contains agents of other types which, in turn, may contain other agents, and so on. This way, the hierarchical tree of agents is constructed. Encapsulation also enables you to hide some complexities of a modeled object.

Top-level agent

AnyLogic model is a tree of agents encapsulating each other. The root of that tree is called the top-level agent. The top level agent represents the highest abstraction level of your model. When you specify the agent type to be the top level agent of your model, you tell AnyLogic where to start the model creation.

Unlike some other simulation tools with well-defined model structures, in AnyLogic you can change the model structure in a very simple manner. You can simply create several experiments with different top level agents in the same model and adjust your model structure by running one or another experiment. 

 To set top level agent for an experiment

  1. Click the experiment in the Projects view.
  2. In the General section of the experiment properties, select agent type from the Top level agent drop-down list.