IODA NetLogo Dictionary
Direct links to other parts of the IODA NetLogo Manual: General Documentation Tutorial FAQ
The documentation of the commands and reporters of the IODA NetLogo extension follows. Most of the commands and reporters directly related to new data types (interaction, assignation, matrix) are defined in the Java extension, while most of the commands and reporters related to the simulation engine are defined in the IODA NetLogo include file.
Please remember that the IODA NetLogo extension is aimed at providing a simple frame for the design of simulations. Thus, you need but a few primitives to master even the subtleties of the IODA methodology. This complete dictionary is provided to allow advanced users to build their own simulation engine or whatever application based on interactions. So, before starting your search, please have a look at the Tutorial and at the Frequently Asked Questions.
Categories
Frequently Used Primitives
ioda:add-neighbors-in-cone ioda:add-neighbors-in-radius ioda:add-neighbors-on-patches ioda:add-neighbors-on-links ioda:clear-all ioda:clear-matrices ioda:die ioda:distance ioda:filter-neighbors-custom ioda:filter-neighbors-in-cone ioda:filter-neighbors-in-radius ioda:filter-neighbors-on-patches ioda:filter-neighbors-on-links ioda:go ioda:init-agent ioda:load-interactions ioda:load-matrices ioda:my-target ioda:primitives-to-write ioda:remove-neighbors-in-cone ioda:remove-neighbors-in-radius ioda:remove-neighbors-on-patches ioda:remove-neighbors-on-links ioda:retain-only-neighbors-in-cone ioda:retain-only-neighbors-in-radius ioda:retain-only-neighbors-on-patches ioda:retain-only-neighbors-on-links ioda:set-metric ioda:set-ordering-policy-for-interaction-selection ioda:set-ordering-policy-for-update ioda:setup ioda:version
General
Simulation Engine-related
ioda:add-neighbors-in-cone ioda:add-neighbors-in-radius ioda:add-neighbors-on-patches ioda:add-neighbors-on-links ioda:concrete-primitive ioda:my-decision ioda:die ioda:distance ioda:filter-neighbors-in-cone ioda:filter-neighbors-in-radius ioda:filter-neighbors-on-patches ioda:filter-neighbors-on-links ioda:go ioda:init-agent ioda:is-alive? ioda:is-operative? ioda:my-neighbors ioda:my-target ioda:remove-neighbors-in-cone ioda:remove-neighbors-in-radius ioda:remove-neighbors-on-patches ioda:remove-neighbors-on-links ioda:retain-only-neighbors-in-cone ioda:retain-only-neighbors-in-radius ioda:retain-only-neighbors-on-patches ioda:retain-only-neighbors-on-links ioda:set-alive ioda:set-my-neighbors ioda:set-operative ioda:set-ordering-policy-for-interaction-selection ioda:set-ordering-policy-for-update ioda:setup
Many other procedures from the simulation engine are NOT documented here, since they are defined for internal use.
Interaction-related
ioda:eval-condition ioda:eval-trigger ioda:get-interaction ioda:get-interactions ioda:interaction-from-list ioda:interaction-make ioda:interaction-name ioda:is-exclusive? ioda:load-interactions ioda:perform-actions ioda:print-interactions ioda:read-interactions-from-string ioda:save-interactions ioda:set-exclusive ioda:set-exclusive-interactions
Assignation-related
Matrix-related
ioda:active-agents ioda:active-agents-with-targets ioda:add-assignation ioda:clear-matrices ioda:get-breed-targets ioda:get-interaction-matrix ioda:get-matrix-line ioda:get-update-matrix ioda:is-active? ioda:is-labile? ioda:is-passive? ioda:labile-agents ioda:load-matrices ioda:matrix-make ioda:matrix-to-list ioda:matrix-view ioda:passive-agents ioda:print-interaction-matrix ioda:print-update-matrix ioda:remove-assignation ioda:replace-assignation ioda:save-matrices ioda:set-interaction-matrix ioda:set-udpate-matrix
Variables
Global variables: ioda:metric ioda:ordering-policy-for-selection ioda:ordering-policy-for-update ioda:performed-interactions ioda:performed-updates
Turtle variables: ioda:alive? ioda:decision ioda:neighbors ioda:operative? ioda:target
Patch variables: ioda:patch-alive? ioda:patch-decision ioda:patch-neighbors ioda:patch-operative? ioda:patch-target
Several variables are defined in the simulation engine for internal use only, thus they are not described here.
Frequently Used Primitives
ioda:clear-all
ioda:clear-all
Clears all interactions and matrices. This is done automatically if
you use the clear-all
NetLogo command, but you might also
need to re-load different interactions (or matrices) without resetting
the whole model.
See also ioda:clear-matrices.
ioda:clear-matrices
ioda:clear-matrices
Clears interaction and update matrices. This is done automatically if
you use the clear-all
NetLogo command, but you might also
need to re-load different matrices without resetting the whole model.
NB: Interactions are kept unchanged. If you need to clear also
interactions, use ioda:clear-all instead.
ioda:die
ioda:die
Kills the agent with regards to the IODA simulation process: the agent
is not immediately removed from the NetLogo simulation, but it is no
more taken into account in the IODA engine. You MUST use this
command instead of the die
NetLogo command to destroy IODA agents in
a proper way. If the agent is a turtle, it is actually removed from
the NetLogo simulation at the end of the ioda:go
procedure.
ioda:distance
ioda:distance agent
<p>Reports the distance between the current agent (a turtle or a
patch) and the specified agent (a turtle or a patch). Please remember
that in NetLogo the distance to or from a patch is computed from the
center of the patch. Thus, a turtle can interact with the patch-here
at distance 0 only if it is exactly at the center of the patch.
N.B.: By default, the distance is computed using the Euclidean
metric (i.e. the NetLogo distance
reporter), but you can use the
Moore or the Von Neumann metric instead.
See also ioda:set-metric
ioda:filter-neighbors-in-radius
ioda:filter-neighbors-in-radius number
ioda:add-neighbors-in-radius number
ioda:remove-neighbors-in-radius number
ioda:retain-only-neighbors-in-radius number
Filters, adds, removes or retains only neighbors situated within the
specified distance (using ioda:distance
). This commands are very
useful for writing concrete primitives for the filter-neighbors
abstract primitive.
See the Tutorial for detailed explanations about this process.
See also ioda:distance, ioda:filter-neighbors-in-cone, ioda:filter-neighbors-custom,
ioda:filter-neighbors-on-patches, ioda:filter-neighbors-on-links.
ioda:filter-neighbors-custom
ioda:filter-neighbors-custom string list
ioda:add-neighbors-custom string list
ioda:remove-neighbors-custom string list
ioda:retain-only-neighbors-custom string list
Filters, adds, removes or retains only neighbors of the relevant kind
(i.e. the breeds or patches which are likely to undergo interactions
from the caller), according to the specified reporter name and its
parameters. This commands may be used for writing concrete primitives
for the filter-neighbors
abstract primitive. The string is the name
of a reporter which is supposed to take 3 arguments: the source
agent, the target agent, and a list of parameters. It must return a
boolean which indicates whether or not the target can be perceived by
the source, w.r.t the parameters.
For instance, suppose that you want to divide your worlds into logical "levels" (e.g. several floors, without using true 3D): then you endow all agents with a variable "level" and you expect that each agent cannot interact but with agents of the same level. This can be done as follows:
turtles-own [ level ] ... to-report same-level? [ source target params ] ; here we do not use params report [level] of source = [level] of target end to myspecies::filter-neighbors ioda:filter-neighbors-custom "same-level?" [] end
Another example: suppose that you model aerials which can only interact with agents endowed with a specific frequency range defined by a slider. You can do this as follows:
to-report within-range? [source target range] let f [frequency] of target report (f >= first range) and (f <= last range) end to aerials::filter-neighbors ioda:filter-neighbors-custom "within-range?" (list min-freq max-freq) end
See the Tutorial for detailed explanations about this process.
See also ioda:distance, ioda:filter-neighbors-in-cone,
ioda:filter-neighbors-in-radius, ioda:filter-neighbors-on-patches,
ioda:filter-neighbors-on-links.
ioda:filter-neighbors-in-cone
ioda:filter-neighbors-in-cone distance angle
ioda:add-neighbors-in-cone distance angle
ioda:remove-neighbors-in-cone distance angle
ioda:retain-only-neighbors-in-cone distance angle
Filters, adds, removes or retains only neighbors situated within the
specified distance and angle. This commands are very useful for
writing concrete primitives for the filter-neighbors
abstract
primitive.
See the Tutorial for detailed explanations about this process.
See also ioda:distance, ioda:filter-neighbors-in-radius, ioda:filter-neighbors-custom,
ioda:filter-neighbors-on-patches, ioda:filter-neighbors-on-links.
ioda:filter-neighbors-on-patches
ioda:filter-neighbors-on-patches patch-set
ioda:add-neighbors-on-patches patch-set
ioda:remove-neighbors-on-patches patch-set
ioda:retain-only-neighbors-on-patches patch-set
Filters, adds, removes or retains only neighbors situated on the
specified patches. This commands are very useful for writing concrete
primitives for the filter-neighbors
abstract primitive.
See the Tutorial for detailed explanations about this process.
See also ioda:filter-neighbors-in-radius,
ioda:filter-neighbors-in-cone, ioda:filter-neighbors-custom,
ioda:filter-neighbors-on-links.
ioda:filter-neighbors-on-links
ioda:filter-neighbors-on-links linkset
ioda:add-neighbors-on-links linkset
ioda:remove-neighbors-on-links linkset
ioda:retain-only-neighbors-on-links linkset
Filters, adds, removes or retains only neighbors which are linked with
the current agent through the specified linkset (which can contain
symmetrical links or outgoing links at the same time). This commands
are very useful for writing concrete primitives for the
filter-neighbors
abstract primitive, especially if you work with
social networks.
See the Tutorial for detailed explanations about this process.
See also ioda:filter-neighbors-on-patches,
ioda:filter-neighbors-in-cone, ioda:filter-neighbors-custom,
ioda:filter-neighbors-in-radius.
ioda:go
ioda:go
Performs one simulation step according to the IODA simulation process. During a IODA simulation step, the following operations occur:
- All labile agents perform their update interactions
- All active and operative agents try to perform an
interaction on either themselves, or one or more target agents chosen among their passive neighbors.
See the Tutorial for detailed explanations about this process.
See also ioda:setup.
ioda:init-agent
ioda:init-agent
Initializes a new agent. Especially, notifies the IODA scheduler about the new agent. Thus, you are strongly recommended to run this command as soon as you create a new agent during the simulation, especially in the action primitives of an interaction.
ioda:load-interactions
ioda:load-interactions string
Reads the specified text file and builds the corresponding interactions. An interaction file must follow the following syntax:
[EXCLUSIVE|PARALLEL] INTERACTION <name> [TRIGGER <tr_1> ... <tr_n>] [TRIGGER <tr'_1> ... <tr'_n>] ... [CONDITION <cond_1> ... <cond_n>] [CONDITION <cond'_1> ... <cond'_n>] ... [ACTIONS <act_1> ... <act_n>] END
See the Tutorial for detailed examples.
See also ioda:load-matrices, ioda:read-interactions-from-string.
ioda:save-interactions
ioda:save-interactions string boolean
Save the interactions of the current model into the specified text
file. If the boolean is true
, then a confirmation is asked before
overwriting an existing file.
See also ioda:save-matrices, ioda:load-interactions.
ioda:read-interactions-from-string
ioda:read-interactions-from-string string
Reads the specified multi-linge string and builds the corresponding interactions. An interaction string must follow the following syntax:
[EXCLUSIVE|PARALLEL] INTERACTION <name> [TRIGGER <tr_1> ... <tr_n>] [TRIGGER <tr'_1> ... <tr'_n>] ... [CONDITION <cond_1> ... <cond_n>] [CONDITION <cond'_1> ... <cond'_n>] ... [ACTIONS <act_1> ... <act_n>] END
See also ioda:load-interactions.
ioda:load-matrices
ioda:load-matrices string1 string2
Reads the text file specified by string1 and builds the corresponding interaction and update matrices. Since matrix files are CSV files, string2 provides the characters used as field separators: in most example, spaces (' ') and tabs ('\t'), thus string2 is " \t". A matrix file must follow the following fields:
<source> <interaction> <priority> OR: <source> <interaction> <priority> UPDATE OR: <source> <interaction> <priority> <target> <distance> [<target-selection-policy>]
See the Tutorial for detailed examples.
See also ioda:load-interactions.
ioda:save-matrices
ioda:save-matrices string boolean
Save the interaction and update matrices of the current model into the
specified text file. If the boolean is true
, then a confirmation is
asked before overwriting an existing file.
See also ioda:save-interactions, ioda:load-matrices.
ioda:my-target
ioda:my-target
This reporter is frequently used in perception or action primitives, during interaction selection and interaction execution. It reports either the potential (in perception primitives) or actual (in action primitives) target(s) of an interaction (when run by the potential or actual source agent), or the potential or actual source of an interaction (when run in the target agent). This is used very frequently for the evaluation of triggers and conditions, and for performing the actions of an interaction.
Three kind of values may be reported:
nobody
means that the interaction is a reflexive one (the target agent is also the source): thus trigger, condition and actions only depend on the source agent.- one agent: this agent is a candidate partner for an
interaction. If
ioda:my-target
is run by a potential target agents, it reports the source of the potential interaction. - a list of agents is reported when special interaction target
policies are used (namely:
ALL
,FILTER:
,ALL-BEST:
andNUMBER:
)
See the Tutorial for detailed examples.
ioda:primitives-to-write
ioda:primitives-to-write
Reports a string representing the declaration of all IODA primitives needed by your current model (i.e. for your current interaction matrix and update matrix). IODA primitives are:
- reporters of the form "A-BREED::A-REPORTER", where "A-REPORTER" appears in the trigger or condition of an interaction, and "A-BREED" is the agentset name (including patches) of the agent that will have to evaluate the reporter
- commands of the form "A-BREED::A-COMMAND", where "A-COMMAND" appears in the actions of an interaction, and "A-BREED" is the agentset name (including patches) of the agent that will have to run the command
The resulting string is the squeletton for writing the appropriate code without forgetting any IODA primitive. You just have copy-paste the commands and reporters in your Procedures tab, and fill them with your own code.
See also ioda:check-consistency.
ioda:setup
ioda:setup
Initializes all variables and data structures needed to run a IODA NetLogo simulation. This command has to be run at the end of the setup procedure, just before starting the simulation.
See also ioda:go.
ioda:set-metric
ioda:set-metric string
Specifies a metric for computing distances in the IODA NetLogo simulation engine. At the end of the ioda:setup procedure, the ioda:metric variable is set to "Euclidean". You can change it either to "Moore" or to "Von Neumann".
ioda:set-metric "Euclidean" print [ioda:distance patch 2 1] of patch 0 0 => 2.23606797749979 ioda:set-metric "Moore" print [ioda:distance patch 2 1] of patch 0 0 => 2 ioda:set-metric "Von Neumann" print [ioda:distance patch 2 1] of patch 0 0 => 3
See also ioda:distance.
General
ioda:check-consistency
ioda:check-consistency
Reports true if all IODA primitives of your current model (i.e. for your current interaction matrix and update matrix) have been written in your program; throws an exception otherwise. IODA primitives are:
- reporters of the form "A-BREED::A-REPORTER", where "A-REPORTER" appears in the trigger or condition of an interaction, and "A-BREED" is the agentset name (including patches) of the agent that will have to evaluate the reporter
- commands of the form "A-BREED::A-COMMAND", where "A-COMMAND" appears in the actions of an interaction, and "A-BREED" is the agentset name (including patches) of the agent that will have to run the command
See also ioda:primitives-to-write.
ioda:get-breed-named
ioda:get-breed-named string
Reports the agentset which corresponds to the specified string. For turtles and patches the string can use the singular or plural form, but for other breeds only the plural form gives the appropriate agentset. Otherwise, reports nobody.
breed [ants ant] print ioda:get-breed-named "ants" => ants print ioda:get-breed-named "ant" => nobody print ioda:get-breed-named "turtles" => turtles print ioda:get-breed-named "patch" => patches
Simulation engine-related
ioda:concrete-primitive
ioda:concrete-primitive breed string
Reports the name of the concrete primitive that this breed must implement so as to be able to run the abstract primitive given in the string.
print ioda:concrete-primitive one-of wolves "wiggle" => wolves::wiggle
ioda:is-alive?
ioda:is-alive?
Reports true if this agent can take part in the IODA simulation, false otherwise (i.e. if it is ignored by the IODA simulation engine).
See also ioda:alive? ioda:set-alive
ioda:set-alive
ioda:set-alive boolean
Defines whether or not this agent can take part in the IODA simulation, or if must be ignored by the IODA simulation engine.
See also ioda:alive? ioda:is-alive?
ioda:is-operative?
ioda:is-operative?
Reports false if the agent has already performed an interaction or if it has been the target of an exclusive interaction within the current time step.
See also ioda:operative? ioda:set-operative
ioda:set-operative
ioda:set-operative boolean
Defines whether or not this agent can act as a source, or undergo an exclusive interaction, during the current time step.
See also ioda:operative? ioda:is-operative?
ioda:my-decision
ioda:my-decision
Reports the interaction and target chosen and performed by this agent during the current time step.
See also ioda:decision
ioda:my-neighbors
ioda:my-neighbors
Reports the agents (turtles or patches) that have been perceived by this agent during the current time step.
See also ioda:neighbors ioda:set-my-neighbors
ioda:set-my-neighbors
ioda:set-my-neighbors list
Defines the list of the agents (turtles or patches) that are perceived
by this agent during the current time step. This can be used to
customize the filter-neighbors
perception primitive.
See also ioda:neighbors ioda:my-neighbors
ioda:set-ordering-policy-for-interaction-selection
ioda:set-ordering-policy-for-interaction-selection reporter-task
ioda:set-ordering-policy-for-interaction-selection "random"
Defines a special ordering for scheduling active agents during the
interaction selection step. By default, the list of active agents is
shuffled at each tick: by using this primitive, the list is sorted
according to the reporter task that is specified. This should be used
carefully so as to avoid simulation biases. In order to work properly,
this primitive has to be executed after the ioda:setup
primitive. Using this primitive with parameter "random" restores the
default scheduling.
Below is an example that schedules active agents according to their ID (who
).
ioda:set-ordering-policy-for-interaction-selection task [ [who] of ?1 < [who] of ?2]
See also: the example provided in tutorial files (4b-leap years
), ioda:set-ordering-policy-for-update
ioda:set-ordering-policy-for-update
ioda:set-ordering-policy-for-update reporter-task
ioda:set-ordering-policy-for-update "random"
Defines a special ordering for scheduling labile agents during the
update step. By default, the list of labile agents is shuffled at each
tick: by using this primitive, the list is sorted according to the
reporter task that is specified. This should be used carefully so as
to avoid simulation biases. In order to work properly, this primitive
has to be executed after the ioda:setup
primitive. Using this
primitive with parameter "random" restores the default
scheduling.
Below is an example that schedules labile agents according to their ID
(who
).
ioda:set-ordering-policy-for-update task [ [who] of ?1 < [who] of ?2]
See also: the example provided in tutorial files (4b-leap years
), ioda:set-ordering-policy-for-interaction-selection
Interaction-related
ioda:get-interactions
ioda:get-interactions
Reports the list of all interactions defined in the model.
ioda:print-interactions
ioda:print-interactions
Prints the list of all interactions defined in the model as they can be found in the text files.
ioda:is-exclusive?
ioda:is-exclusive? interaction
Reports true if the interaction is EXCLUSIVE, false if it is PARALLEL. The Tutorial provides explanations about exclusive and parallel interactions.
See also ioda:set-exclusive, ioda:set-exclusive-interactions.
ioda:set-exclusive
ioda:set-exclusive interaction boolean
Specifies wether or not the interaction must be used as EXCLUSIVE or PARALLEL. The Tutorial provides explanations about exclusive and parallel interactions.
See also ioda:is-exclusive?, ioda:set-exclusive-interactions.
ioda:set-exclusive-interactions
ioda:set-exclusive-interactions boolean
Specifies wether or not the interaction to be declared must be defined
as EXCLUSIVE (true
) or PARALLEL (false
) by default. Interactions
that have already been declared are kept unchanged. By default,
interactions are considered PARALLEL. The Tutorial provides
explanations about exclusive and parallel interactions.
See also ioda:is-exclusive?, ioda:set-exclusive.
ioda:get-interaction
ioda:get-interaction string
Reports the interaction of the specified name.
print ioda:get-interaction "Hunt" => {{ioda:interaction ["hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"]]}}
See also ioda:interaction-from-list.
ioda:interaction-make
ioda:interaction-make string list list list
Reports an interaction with the specified name, trigger, condition and actions.
print ioda:interaction-make "Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"] => {{ioda:interaction ["Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"]]}}
ioda:interaction-name
ioda:interaction-name interaction
Reports the name of the interaction.
print ioda:interaction-name ioda:interaction-make "Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"] => Hunt
ioda:interaction-from-list
ioda:interaction-from-list list
Reports an interaction built from a list containing a name, a list of triggers, a list of conditions and a list of actions.
print ioda:interaction-from-list ["Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"]] => {{ioda:interaction ["Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"]]}}
See also ioda:interaction-make.
ioda:eval-condition
ioda:eval-condition interaction target-turtle-or-patch
ioda:eval-condition interaction nobody
Reports a list containing one or two lists, which themselves contain the actual reporters that should be evaluated in order to know wether the condition of the interaction is fulfilled or not, with a list identifying the agent (turtle or patch) running this reporter as the source agent, and the other turtle or patch as the target of the interaction (or nobody if the interaction is degenerate). The first item each sublist identifies the agent that should evaluate the reporters, the other items are the reporter themselves with their target.
let i ioda:interaction-make "Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"] print [ioda:eval-condition i one-of sheep] of one-of wolves => [[[[51] [WOLVES::adult? [25]]] [[25] [SHEEP::alone? [51]]]]] ;; means that turtle 51 (a wolf) must evaluate reporter wolves::adult? ;; with parameter turtle 25, and conversely turtle 25 (a sheep) must ;; evaluate reporter sheep::alone? with parameter turtle 51 set i ioda:interaction-make "Sleep" [["tired?"]] [["no-danger?"]] ["rest"] print [ioda:eval-condition i nobody] of one-of wolves => [[[[50] [WOLVES::no-danger? []]]]] ;; turtle 50 has to evaluate reporter wolves::no-danger? with parameter nobody ;; (no target agent, represented by the empty list following the reporter)
See also ioda:eval-trigger, ioda:perform-actions.
ioda:eval-trigger
ioda:eval-trigger interaction target-turtle-or-patch
ioda:eval-trigger interaction nobody
Reports a list containing one or two lists, which themselves contain the actual reporters that should be evaluated in order to know wether the trigger of the interaction is fulfilled or not, with the agent (turtle or patch) running this reporter as the source agent, and the other turtle or patch as the target of the interaction (or nobody if the interaction is degenerate). The first item of each sublist is the agent that should evaluate the reporters, the other items are the reporter themselves.
let i ioda:interaction-make "Hunt" [["hungry?"]] [["adult?" "target:alone?"]] ["chase"] print [ioda:eval-trigger i one-of sheep] of one-of wolves => [[[(TURTLE 5) (WOLVES::hungry?(TURTLE 1))]]] ;; means that turtle 5 (a wolf) must evaluate reporter wolves::hungry? with parameter turtle 1 set i ioda:interaction-make "Sleep" [["tired?"]] [["no-danger?"]] ["rest"] print [ioda:eval-trigger i nobody] of one-of wolves => [[[(TURTLE 4) (WOLVES::tired?(nobody))]]] ;; turtle 4 has to evaluate reporter wolves::tired? with parameter nobody (no target agent)
See also ioda:eval-condition, ioda:perform-actions.
ioda:perform-actions
ioda:perform-actions interaction target-turtle-or-patch
ioda:perform-actions interaction nobody
Reports a list containing zero, one or more lists, which themselves contain the actual procedures that should be run in order to perform the interaction, with the agent (turtle or patch) running this command as the source agent, and the other turtle or patch as the target of the interaction (or nobody if the interaction is degenerate). The first item of each sublist is the agent that should run the procedures, the other items are the procedures themselves. Note that the order of the procedures is generally important.
let i ioda:interaction-make "Eat" [["hungry?"]] [["target:healthy?"]] ["digest" "roar" "target:die"] print [ioda:perform-actions i one-of sheep] of one-of wolves => [[(TURTLE 4) (WOLVES::digest(TURTLE 0)) (WOLVES::roar(TURTLE 0))] [(TURTLE 0) (SHEEP::die(TURTLE 4))]] ;; means that turtle 4 (a wolf) must run procedure wolves::digest with parameter turtle 0, ;; then procedure wolves::roar with parameter turtle 0 ; after that turtle 0 (a sheep) must ;; run procedure sheep::die with parameter turtle 4 set i ioda:interaction-make "Sleep" ["tired?"] ["no-danger?"] ["rest"] print [ioda:perform-actions i nobody] of one-of sheep => [[(TURTLE 2) (SHEEP::rest(nobody))]] ;; turtle 2 has to run procedure sheep::rest with parameter nobody (no target agent)
See also ioda:eval-condition, ioda:eval-trigger.
Assignation-related
ioda:assignation-from-list
ioda:assignation-from-list list
Reports an assignation built from the items of the list. The list may contain the following items:
- a source breed name, an interaction name, a priority level: in that case, the target is nobody (reflexive interaction)
- a source breed name, an interaction name, a priority level, a target breed name, a limit distance
- a source breed name, an interaction name, a priority level, a target breed name, a limit distance, a target selection policy
print ioda:assignation-from-list ["ants" "Take" 20 "food" 1] ;; reports the assignation of the "Take" interaction (which must exist!) ;; to "ants" agents as sources, with "food" agents as targets, ;; at priority level 20, and with a limit distance of 1. => {{ioda:assignation ["ants" "take" 20 "food" 1 "RANDOM"]}}
ioda:assignation-to-list
ioda:assignation-to-list assignation
Reports a list built from the specified assignation. The list may contain the following items:
- a source breed name, an interaction name, a priority level: in that case, the target is nobody (reflexive interaction)
- a source breed name, an interaction name, a priority level, a target breed name, a limit distance
- a source breed name, an interaction name, a priority level, a target breed name, a limit distance, a target selection policy
ioda:get-source-breed
ioda:get-source-breed assignation
Reports the source breed for the specified assignation.
print ioda:get-source-breed ioda:assignation-from-list ["ants" "Take" 20 "food" 1] => ants
See also ioda:get-target-breed, ioda:get-priority, ioda:get-distance, ioda:get-interaction-of, ioda:target-selection-method, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:get-target-breed
ioda:get-target-breed assignation
Reports the target breed for the specified assignation.
print ioda:get-target-breed ioda:assignation-from-list ["ants" "Take" 20 "food" 1] => food print ioda:get-target-breed ioda:assignation-from-list ["ants" "Move" 10] => nobody
See also ioda:get-source-breed, ioda:get-priority, ioda:get-distance, ioda:get-interaction-of, ioda:target-selection-method, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:get-priority
ioda:get-priority assignation
Reports the priority level for the specified assignation.
print ioda:get-priority ioda:assignation-from-list ["ants" "Take" 20 "food" 1] => 20
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-distance, ioda:get-interaction-of, ioda:target-selection-method, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:get-distance
ioda:get-distance assignation
Reports the limit distance for the specified assignation.
print ioda:get-distance ioda:assignation-from-list ["ants" "Take" 20 "food" 1] => 1
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-priority, ioda:get-interaction-of, ioda:target-selection-method, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:get-interaction-of
ioda:get-interaction-of assignation
Reports the interaction for the specified assignation.
print ioda:get-interaction-of ioda:assignation-from-list ["turtles" "Delete" 20 "turtles" 1] => {{ioda:interaction ["delete" [] [] ["target:die"]]}}
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-priority, ioda:get-distance, ioda:target-selection-method, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:is-degenerate?
ioda:is-degenerate? assignation
Reports true if the assignation is degenerate (i.e. if it has
nobody
as target), false otherwise.
print ioda:is-degenerate? ioda:assignation-from-list ["turtles" "Delete" 20 "turtles" 1] => false print ioda:is-degenerate? ioda:assignation-from-list ["ants" "Move" 10] => true
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-priority, ioda:get-distance, ioda:get-interaction-of, ioda:target-selection-method, ioda:set-target-selection-method.
ioda:target-selection-method
ioda:target-selection-method assignation
Reports the interaction/target selection policy used by this assignation (by default: "RANDOM", which means that all interaction/target pairs found by the simulation engine to be realizable are chosen with equal probability for performing an interaction.
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-priority, ioda:get-distance, ioda:get-interaction-of, ioda:set-target-selection-method, ioda:is-degenerate?.
ioda:set-target-selection-method
ioda:set-target-selection-method assignation string
Defines the interaction/target selection policy used by this assignation (by default: "RANDOM", which means that all interaction/target pairs found by the simulation engine to be realizable are chosen with equal probability for performing an interaction). Possible string values are: "RANDOM", "RANDOM-INT", "BEST:/aReporter/", "PRORATA:/aReporter/", "NUMBER:/min/-/max/", "ALL-BEST:/aReporter/", "FILTER:/aReporter/". Please refer to the "Pheromones" and "Explosion" sections of the Tutorial to learn about target selection policies.
See also ioda:get-source-breed, ioda:get-target-breed, ioda:get-priority, ioda:get-distance, ioda:get-interaction-of, ioda:target-selection-method, ioda:is-degenerate?.
Interaction matrix-related
ioda:active-agents
ioda:active-agents
Reports a list of active breeds (including patches if necessary), i.e. breed (or patches in general) that can perform some interactions (according to the Interaction Matrix of the current model).
See also ioda:active-agents-with-targets, ioda:passive-agents, ioda:labile-agents.
ioda:active-agents-with-targets
ioda:active-agents-with-targets
Reports a list of active breeds (including patches if necessary) which can perform at least one non-degenerate interaction, i.e. breed (or patches in general) that can perform some interactions (according to the Interaction Matrix of the current model) on other agents.
See also ioda:active-agents, ioda:passive-agents, ioda:labile-agents.
ioda:passive-agents
ioda:passive-agents
Reports a list of passive breeds (including patches if necessary), i.e. breed (or patches in general) that can undergo some interactions (according to the Interaction Matrix of the current model).
See also ioda:active-agents, ioda:active-agents-with-targets, ioda:labile-agents.
ioda:labile-agents
ioda:labile-agents
Reports a list of labile breeds (including patches if necessary), i.e. breed (or patches in general) that can change their state through update interactions (according to the Update Matrix of the current model).
See also ioda:active-agents, ioda:active-agents-with-targets, ioda:passive-agents.
ioda:is-active?
ioda:is-active?
Reports true if this turtle or patch is member of an active breed, i.e. if its breed (or if patches in general if this agent is a patch) can perform some interactions (according to the Interaction Matrix of the current model) ; reports false otherwise.
See also ioda:is-labile?, ioda:is-passive?.
ioda:is-passive?
ioda:is-passive?
Reports true if this turtle or patch is member of a passive breed, i.e. if its breed (or if patches in general if this agent is a patch) can undergo some interactions (according to the Interaction Matrix of the current model) ; reports false otherwise.
See also ioda:is-active?, ioda:is-labile?.
ioda:is-labile?
ioda:is-labile?
Reports true if this turtle or patch is member of a labile breed, i.e. if its breed (or if patches in general if this agent is a patch) can change their state through update interactions (according to the Update Matrix of the current model) ; reports false otherwise.
See also ioda:is-active?, ioda:is-passive?.
ioda:get-interaction-matrix
ioda:get-interaction-matrix
Reports the interaction matrix for the current model.
;; load the "simple ecosystem" example and run "setup" first print ioda:get-interaction-matrix => {{ioda:matrix [{{ioda:assignation ["wolves" "eat" 10 "sheep" 1 "RANDOM"]}} {{ioda:assignation ["wolves" "hunt" 5 "sheep" 5 "RANDOM"]}} {{ioda:assignation ["wolves" "moverandomly" 0]}} {{ioda:assignation ["sheep" "eat" 10 "patches" 0 "RANDOM"]}} {{ioda:assignation ["sheep" "mate" 5 "sheep" 1 "RANDOM"]}} {{ioda:assignation ["sheep" "moverandomly" 0]}}]}}
See also ioda:set-interaction-matrix, ioda:get-update-matrix, ioda:set-update-matrix.
ioda:get-update-matrix
ioda:get-update-matrix
Reports the update matrix for the current model.
;; load the "simple ecosystem" example and run "setup" first print ioda:get-update-matrix => {{ioda:matrix [{{ioda:assignation ["patches" "grow" 0]}}]}}
See also ioda:get-interaction-matrix, ioda:set-interaction-matrix, ioda:set-update-matrix.
ioda:set-interaction-matrix
ioda:set-interaction-matrix matrix
Defines the interaction matrix for the current model.
See also ioda:get-interaction-matrix, ioda:get-update-matrix, ioda:set-update-matrix.
ioda:set-update-matrix
ioda:set-update-matrix matrix
Defines the update matrix for the current model.
See also ioda:get-interaction-matrix, ioda:set-interaction-matrix, ioda:get-update-matrix.
ioda:print-interaction-matrix
ioda:print-interaction-matrix
Prints the interaction matrix for the current model as a CSV file (with tabs as field separator).
See also ioda:print-update-matrix
ioda:print-update-matrix
ioda:print-update-matrix
Prints the update matrix for the current model as a CSV file (with tabs as field separator).
See also ioda:print-interaction-matrix
ioda:matrix-to-list
ioda:matrix-to-list matrix
Reports a list containing all assignations contained in the specified matrix.
ioda:matrix-view
ioda:matrix-view matrix
Reports a list corresponding to the actual data structure used for storing assignations (priority-ordered lists, grouped by source breeds).
;; load the "simple ecosystem" example and run "setup" first print ioda:matrix-view ioda:get-interaction-matrix => [[wolves [{{ioda:assignation ["wolves" "eat" 10 "sheep" 1 "RANDOM"]}}] [{{ioda:assignation ["wolves" "hunt" 5 "sheep" 5 "RANDOM"]}}] [{{ioda:assignation ["wolves" "moverandomly" 0]}}]] [sheep [{{ioda:assignation ["sheep" "eat" 10 "patches" 0 "RANDOM"]}}] [{{ioda:assignation ["sheep" "mate" 5 "sheep" 1 "RANDOM"]}}] [{{ioda:assignation ["sheep" "moverandomly" 0]}}]]]
ioda:add-assignation
ioda:add-assignation matrix assignation
Adds the specified assignation to the specified matrix. When used direclty, it is recommended to run ioda:check-consistency to ensure that all required concrete primitives are already written.
;; a very small IODA model let im ioda:matrix-make let i ioda:interaction-make "Take" [] [["can-take-load?"]] ["take-target" "target:die"] ioda:add-assignation im ioda:assignation-from-list ["ants" "Take" 20 "food" 1] ioda:set-interaction-matrix im
See also ioda:remove-assignation, ioda:replace-assignation, ioda:check-consistency
ioda:remove-assignation
ioda:remove-assignation matrix assignation
Removes the specified assignation from the specified matrix.
ioda:remove-assignation ioda:get-interaction-matrix ioda:assignation-from-list ["ants" "Take" 20 "food" 1]
See also ioda:add-assignation, ioda:replace-assignation
ioda:replace-assignation
ioda:replace-assignation matrix /old-assignation new-assignation
Replaces the specified assignation by the new one in the specified matrix. Replacement is done by merely removing the old assignation, then adding the new one. When used direclty, it is recommended to run ioda:check-consistency to ensure that all required concrete primitives are already written.
ioda:replace-assignation ioda:get-interaction-matrix ioda:assignation-from-list ["ants" "Take" 20 "food" 1] ioda:assignation-from-list ["ants" "Take" 30 "food" 2 "BEST"]
See also ioda:remove-assignation, ioda:add-assignation, ioda:check-consistency
ioda:get-matrix-line
ioda:get-matrix-line matrix breed
Reports a priority-ordered list corresponding to assignations where the specified breed plays the role of the source.
;; load the "particles" example and run the "setup" procedure first print ioda:get-matrix-line ioda:get-interaction-matrix turtles => [[{{ioda:assignation ["turtles" "delete" 1 "turtles" 1 "RANDOM"]}}] [{{ioda:assignation ["turtles" "moverandomly" 0]}}]]
ioda:get-breed-targets
ioda:get-breed-targets breed
Reports a list of breeds (including patches) corresponding to agentsets which can be the target of interactions performed by this breed (eventually patches).
;; load the "simple ecosystem" example and run the "setup" procedure first print ioda:get-breed-targets sheep => [patches sheep] ;; that means that sheep are able to perform interaction on patches and on other sheep
Variables
Several variables of the simulation engine are defined for internal use, thus they are not described here.
ioda:metric
ioda:metric
The name of the metric used to compute distances between agents in the IODA NetLogo simulation. In this version three metrics are pre-defined: "Euclidean", "Moore" and "Von Neumann". In order to prevent this variable to take invalid values, please use the ioda:set-metric procedure to change the metric.
See also ioda:set-metric
ioda:ordering-policy-for-selection
ioda:ordering-policy-for-selection
The task used for scheduling active agents during the interaction selection step. The default value for this variable is "random", which means that the list of active agents is shuffled at each tick (so as to avoid simulation biases). In order to prevent this variable to take invalid values, please use the ioda:set-ordering-policy-for-interaction-selection procedure to change the task.
ioda:ordering-policy-for-update
ioda:ordering-policy-for-update
The task used for scheduling labile agents during the update step. The default value for this variable is "random", which means that the list of labile agents is shuffled at each tick (so as to avoid simulation biases). In order to prevent this variable to take invalid values, please use the ioda:set-ordering-policy-for-update procedure to change the task.
See also ioda:set-ordering-policy-for-update
ioda:performed-interactions
ioda:performed-interactions
The list of actual interactions that have been performed during one
interaction selection step within the run of the ioda:go
procedure. This can be useful for statistics or debugging. The list
contains items of the form [/source-agent/ interaction-name
target-agent/], where /target-agent is nobody
in reflexive
interactions.
See also ioda:performed-updates
ioda:performed-updates
ioda:performed-updates
The list of actual interactions that have been performed during one
update step within the ioda:go
procedure. This can be useful for
statistics or debugging. The list contains items of the form
[/source-agent/ /interaction-name/] (since all update interactions are
reflexive interactions).
See also ioda:performed-interactions
ioda:alive?
ioda:patch-alive?
ioda:alive?
ioda:patch-alive?
Contains true if this agent (turtle or patch) is considered alive in
the IODA model, i.e. allowed to perform or undergo interactions (from
the interaction or update matrices). Otherwise, a dead agent cannot
take part in the simulation.
NB 1: As the alive variable has a different name in turtles
and patches, you should rather use ioda:is-alive? and ioda:set-alive
to inspect or modify this variable.
NB 2: The alive status can be used to ignore temporarily some
agents without removing them from the simulation, since dead agents
are not actually removed, unless they are explicitly killed using
the ioda:die procedure. See for instance the setup
and go
procedures in the "ants and food" example.
See also ioda:die, ioda:is-alive?, ioda:set-alive
ioda:decision
ioda:patch-decision
ioda:decision
ioda:patch-decision
Contains the interaction and target that result from the interaction
selection process of the agent. This depends on the interaction matrix
and the neighboring agents.
NB: As the decision variable has a different name in turtles and
patches, you should rather use ioda:my-decision to inspect this
variable.
See also ioda:my-decision
ioda:neighbors
ioda:patch-neighbors
ioda:neighbors
ioda:patch-neighbors
Contains the neighbors that have been perceived by the agent during
this time step.
NB: As the neighbors variable has a different name in turtles and
patches, you should rather use ioda:my-neighbors and
ioda:set-my-neighbors to inspect or modify this variable.
See also ioda:my-neighbors, ioda:set-my-neighbors, ioda:filter-neighbors-in-radius, ioda:filter-neighbors-on-patches
ioda:operative?
ioda:patch-operative?
ioda:operative?
ioda:patch-operative?
Contains false if the agent has already performed an interaction or
if it has been the target of an exclusive interaction within the
current time step.
NB: As the operative variable has a different name in turtles and
patches, you should rather use ioda:is-operative? and
ioda:set-operative to inspect or modify this variable.
See also ioda:is-operative?, ioda:set-operative.
ioda:target
ioda:patch-target
ioda:target
ioda:patch-target
This variable can be useful to identify the actual or potential
partner of an agent in an interaction.
NB:
As the target variable has a different name in turtles and patches,
you should rather use ioda:my-target to inspect this variable.
See also ioda:my-target.
Contact Information
Authors: Sébastien PICAULT and Philippe MATHIEU
Email: ioda
(at) univ-lille1.fr
Team Web Site: http://cristal.univ-lille.fr/SMAC/
Terms of Use
All contents © 2008-2015 Sébastien PICAULT and Philippe MATHIEU – SMAC Research Team
Centre de Recherche en Informatique, Signal et Automatique de Lille (CRIStAL), UMR CNRS 9189
Université de Lille (Sciences et Technologies)
– Cité Scientifique, F-59655 Villeneuve d'Ascq Cedex, FRANCE.
The IODA NetLogo extension is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The IODA NetLogo extension is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with IODA NetLogo extension. If not, see
http://www.gnu.org/licenses.
Created with Emacs Org-mode