Ps-i 2.2 - fields
A field is a collection of agents. Ps-i was designed to allow multiple fields. However due to
time constraints the interface allowing interaction of agents from different fields was not implemented. Thus though one might have multiple field sections in the input file it is recommended only to have one. Also (again due to time constraints) only rectangular fields
with square lattice were implemented. The design, though, allows for straightforward addition
of other fields types - for example hexagonal lattice.
dimensions 50 50
paint 'basic' rect(1,1,48,48) 100
paint 'basic' "rectangle(1,1,field_width-2,field_width-2)"
with 'cache' "make_b_repertoire"
paint 'entrepreneur' "rectangle(1,1,field_width-2,field_width-2) and (rand < e_ratio)"
with 'cache' "make_e_repertoire"
paint 'border' "rectangle(0,0,field_width-1,0)"
paint 'border' "rectangle(0,field_width-1,field_width-1,field_width)"
paint 'border' "rectangle(0,0,0,field_width-1)"
paint 'border' "rectangle(field_width-1,0,field_width-1,field_width-1)"
There are four kind of directives:
Note that coordinate system in the field are set up in such a way that the top left
agent has coordinates (0,0) and bottom right has coordinates (field_width-1,field_height-1).
- paint directive - specifies the operation to perform when seeding fields.
It takes two arguments: name of the agentclass to seed with, and boolean function, which is evaluated for each agent and,
when false or zero precludes seeding of the agent.
- with directive - must always follow paint directive or another
with directive. It has two arguments: name of the attribute and function
which value is assigned to the attribute when agent is seeded. This permits custom
assignment of attributes when fields are reseeded.
- dimentions directive - specifies the size of the field. It takes two arguments - width and height
- agent directive - this one is used only in snapshots. It is never
evaluated when loading as a model. Its syntax is implementation specific.
See also About Ps-i 2.2, agentclass sections.