Wiki

Clone wiki

Simflowny / UserGuide_ABMModel

Creating ABM models

In order to create a ABM model template, from the document manager click on the Add button and select "Agent Based Model", you have options for either graph-based or spatial-domain-based ABM.

Head

Head information is commonly used in several documents in Simflowny. See more detail in Head.

Basic data

The basic data covers all that can be considered variables in a document. ABM problem and model have a common basic data, see more detail in Basic data.

Rules

The ABM rules for your model are provided in the Rules section, which has two subsections: Gather Rules and Update Rules. You can have as many gather and update rules as you wish. They are executed, for each time step, in the order specified in the Rule Execution Order section. Gather rules are operations in which the value for a property in each agent (vertex or particle) is modified according to the values of properties in neighbouring agents, (vertices or edges in case of graphs). The update rules only allow local calculations: properties are modified only by taking into account the values of properties stored in the same agent.

This architecture allows for a clear separation of operations which involve neighbour and operations which do not. This is important, notably, for parallelization planning algorithms. A sharp separation of local-based and neighbour-based operations will help in optimizing the parallel performance of your code.

The specification of gather and update rules is done through Simml language, used across Simflowny (Simml stands for Simulation Markup Language). For further information about the language, visit SimML: language reference.

The following picture shows an example of the Simml language in use for the Cash and Goods model rules:


images/UserGuide/cashandgoods.png

Simflowny will internally join update and gather rules for simplification when possible. For instance, two update rules executing a loop over neighbours wil be joined in order to loop only once over al the neighbours executing both update instructions instead of twice. That internal process will increase run performance. An expert user could set the rules properly to take advantage of this internal behaviour.

Topology change (Optional)

ABM on graph have a specific Topology Change section, which is used to specify the algorithm to change the topology of the graph, including adding or removing edges or vertices:


images/UserGuide/topologychange.png

Rule execution order

The last element to set is the order in which the rules must be executed. In this section, the user set the correct order to execute the gather and update rules.


images/ABMtutorial/executionorder.png

Next steps

At this point, the reader is able to develop ABM models in Simflowny. The following step in Simflowny flow is creating an ABM problem.

Creating Balance Law models

Review the documentation to create Balance Law PDE models.

Creating Generic PDE models

Review the documentation to create Generic PDE models.

Updated