Chapter 4
Getting Started with FLAME
4.1
Setting Up FLAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
62
4.1.1
MinGW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63
Configuring MinGW for Windows users: . . . . . . . . . . . . . . . . . . . . . . . .
63
4.1.2
GDB GNU Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63
4.1.3
Dotty as an Extra Installation . . . . . . . . . . . . . . . . . . . . . . . . . .
64
4.2
Messaging Library: Libmboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64
4.3
How to Run a Model? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
4.4
Implementation Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
4.5
Using Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
68
4.6
Integrating with More Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
69
4.7
Writing a Model - Fox and Rabbit Predator Model . . . . . . . . . . . . .
71
4.7.1
Adding Complexity to Models . . . . . . . . . . . . . . . . . . . . . . . . . .
72
4.7.2
XML Model Description File . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
4.7.3
C Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76
4.7.4
Additional Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
81
4.7.5
0.xml File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83
4.8
Enhancing the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
4.8.1
Constant Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
4.8.2
Time Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
FLAME stands out from other agent-based modeling frameworks, allowing
the parallel deployment of the simulations on large parallel computers using
Message Passing Interface (MPI). MPI is used to send messages between
agents, located on different nodes or processors on various platforms. This
capability allows FLAME to run large simulations (up to 500,000 agents) in a
matter of minutes, enhancing research in time and complexity in the written
models [107]. FLAME reads the model files and automatically generates a
large simulation program in C which can be run in parallel by using the ‘-p’
flag or in serial by default.
The input files defined by the modeler are
• Model.xml - Multiple xml files containing the whole description of the
model such as agent definitions, memory variables, functions and messages between them.
• Functions.c - Multiple ‘.c’ files contain implementations of agent functions, names of which are specified in the xml files.
61
Getting Started with FLAME
4.1
Setting Up FLAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
62
4.1.1
MinGW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63
Configuring MinGW for Windows users: . . . . . . . . . . . . . . . . . . . . . . . .
63
4.1.2
GDB GNU Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63
4.1.3
Dotty as an Extra Installation . . . . . . . . . . . . . . . . . . . . . . . . . .
64
4.2
Messaging Library: Libmboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64
4.3
How to Run a Model? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
4.4
Implementation Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
4.5
Using Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
68
4.6
Integrating with More Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
69
4.7
Writing a Model - Fox and Rabbit Predator Model . . . . . . . . . . . . .
71
4.7.1
Adding Complexity to Models . . . . . . . . . . . . . . . . . . . . . . . . . .
72
4.7.2
XML Model Description File . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
4.7.3
C Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76
4.7.4
Additional Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
81
4.7.5
0.xml File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83
4.8
Enhancing the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
4.8.1
Constant Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
4.8.2
Time Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
FLAME stands out from other agent-based modeling frameworks, allowing
the parallel deployment of the simulations on large parallel computers using
Message Passing Interface (MPI). MPI is used to send messages between
agents, located on different nodes or processors on various platforms. This
capability allows FLAME to run large simulations (up to 500,000 agents) in a
matter of minutes, enhancing research in time and complexity in the written
models [107]. FLAME reads the model files and automatically generates a
large simulation program in C which can be run in parallel by using the ‘-p’
flag or in serial by default.
The input files defined by the modeler are
• Model.xml - Multiple xml files containing the whole description of the
model such as agent definitions, memory variables, functions and messages between them.
• Functions.c - Multiple ‘.c’ files contain implementations of agent functions, names of which are specified in the xml files.
61
