Alike other SD tools, AnyLogic supports laying out complex SD models using sectors.
However, AnyLogic also naturally offers all benefits of object-oriented approach to system dynamics modelers. You can define complex models in a hierarchical manner where logically separate parts of the stock and flow diagram are encapsulated into different agent types and expose only their interface variables (as inputs or outputs).
System dynamics components can be packaged into AnyLogic agent types, parameterized, organized in various structures, and reused.
Sample model: Population
Take a look into the given sample model to understand how you can lay out your SD model in an hierarchical way.
This model has two logical parts, each focusing on a particular aspect, housing sector and population sector. The stock-and-flow diagram for each part is drawn apart from others, in the separate agent type: HousingSector and PopulationSector.
In AnyLogic you can partition the model into components in object-oriented way by using agents exposing the "input" and "output" dynamic variables as a part of their interface.
The "interface" between the sectors includes two variables:
For each such variable there is one "original" instance in one of the sectors and "shadow" copies in the other sectors.
Let us explain how the interface variables were created.
Creation of the "output" interface variable for Houses
Creation of the shadow variable for another interface variable, HouseholdsToHousesRatio
Create the housing sector's interface
Do similar things in the PopulationSector diagram.Then drag both HousingSector and PopulationSector agents from the Projects tree on the Main diagram and connect their interface variables together with connectors as shown below.
This figure gives you the idea how values are passed from one sector to another via the interface variables we've created.