The Magrathea Manual: Building Coordinated Agent Models

From irefindex
Revision as of 23:37, 7 March 2009 by Ian.donaldson (talk | contribs) (New page: Making models The model.txt file Magrathea opens a file called “model.txt” at the beginning of a simulation. Information is read from the file to populate the simulation with molecul...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Making models

The model.txt file

Magrathea opens a file called “model.txt” at the beginning of a simulation. Information is read from the file to populate the simulation with molecules and coordinators. The properties of different types of molecules and coordinators are specified in the model.txt file along with the number and positions of all of the starting molecules and coordinators. The sections below describe the format of the model.txt file.


A simple example

An example model.txt file is shown below in Figure 1.

The model.txt file is a text file and must be called “model.txt”. Lines beginning with # are comments and are ignored. Blank lines are ignored. Any text in the file after the line

EOF

will be ignored.

There are two types of sections in a model file. A section used to describe a type of molecule and create instances of that molecule type at the beginning of the simulation begins with the line:

[moleculeType]

and ends with the line

[/moleculeType]

A section that is used to describe a coordinator type and create instances of that coordinator at the beginning of the simulation begins with the line:

[coordinatorType]

and ends with the line

[/coordinatorType]

An example model.txt file for Magrathea

###########
#ab complex
###########

[moleculeType]
id 1
label a
color .81 .60 .21
shape Sphere 1
neighborhood-size 5
coordinator 1 3
instantiate 10 random spherical volume 10 30 10 10
[/moleculeType]

[moleculeType]
id 2        
label b
color 0.67 0.08 0.37
shape Sphere 1
neighborhood-size 5
coordinator 1 3
instantiate 4 random spherical volume 10 15 10 10
[/moleculeType]

[coordinatorType]
id 3
label a-b-complex
shape Cube 1 1 1
molecule 1 1
molecule 2 1
[/coordinatorType]

EOF