The agent-based model syntax: 11 element types, one element chosen from eachagent-based model (ABM)SYNTAX · Version 0.30.0

The agent-based model (ABM) syntax

It breaks up an agent-based model (ABM): many agents, each following simple rules of its own, in a shared space, step after step, so that something no single agent was told to make (clusters, a spread, an agreement) can be watched as it appears. It has 11 element types and 39 elements, and an agent-based model described in it is one choice of elements from each type.

Instances

  • taali: a builder: make an agent-based model by dragging one block into each slot, set its numbers with sliders and watch it run, with no code typed; save it as JSON or YAML, or as a web page and plain JavaScript to keep. Its name is from taali ek haath se nahi bajti, a clap does not ring from one hand
  • AgentJS: the JavaScript library a model of this kind runs on, in taali and in the code taali writes (source)

Element types and elements

space holds one essential

Where the agents are.

a grid of cells
each agent sits in one cell
an open plane
agents stand anywhere and move by any amount
connections only
no positions; agents are linked to some others and only those matter

edges holds one optional

The border of the space. Optional: says what happens to an agent that reaches the border

wrap round
off one side, on at the other
bounce back
an agent at the border turns back
fall out
an agent at the border leaves the model

kinds of agent holds one or more essential

The groups of agents, each with a name, a count and starting numbers set with sliders.

one kind
every agent the same, told apart only by its own numbers
two kinds
two groups, shown in two colours
several kinds
up to five groups

noticing holds one essential

Who counts as a neighbour.

the eight cells around
on a grid, the cells touching at sides and corners
the four cells around
on a grid, the cells touching at sides
anyone within a distance
on a plane, every agent nearer than a set distance
those it is connected to
the agents it is linked to

moving holds one for each kind optional

How an agent changes place. Optional: whether and how an agent changes place

stays put
never moves
wanders
a small push in a random direction each step
moves to an empty cell when unhappy
moves when its rule says it is unhappy
goes towards a place
heads for a point it is given
keeps away from others
moves away from the agents nearest it

connections holds one optional

How agents are linked. Optional: who is linked to whom, when the space has connections

a ring
each linked to the next few round a circle
at random
each pair linked with a set chance
to the nearest
each linked to the few nearest it

rule holds one or more essential

What an agent does with what it notices.

too few like me, so I move
the share of neighbours of its own kind is below a threshold, so it moves
copy the majority
takes the state most of its neighbours have
meet halfway
moves its opinion towards neighbours whose opinion is within a tolerance
pass it on
a neighbour in a state passes it on with a set chance
rest when tired
a simple tree of conditions and actions
a small model chooses
an NSMnum picks the action from a list written in advance, or none, and code runs it; trained only on the student's own keys

turns holds one essential

The order in which agents act within a step.

one by one, in a new random order each step
one by one, in a new random order each step
one by one, in the same order each step
one by one, in the same order each step
all at once
every agent decides from the same picture of the step before

watching holds one or more essential

What the student looks at while it runs.

the picture
the space drawn each step
a count of each kind over time
a line for each kind
how mixed the neighbourhoods are
the share of like neighbours, on average
how far opinions are spread
the gap between the highest and lowest opinion

ending holds one optional

When a run stops. Optional: when a run stops by itself

runs until stopped
runs until stopped
stops after a number of steps
stops after a number of steps
stops when nothing changes
stops when nothing changes

chance holds one optional

Whether two runs come out the same. Optional: whether two runs come out the same

the same each run
a seed the student can change
different each run
different each run

Left out

Models made of equations about whole groups, with no single agent acting (rates of flow between stocks); one agent alone; agents that talk or write in sentences, and any model under an agent that writes text; fitting a model to real data. A model that needs code a block cannot say is outside the builder, though AgentJS itself still runs it.

Described in it

Nothing is described in it yet.

The syntax as data: agent-based-model.json. It is read from AgentJS each time this site is built, so the two never differ.