Patch agent actions
Table of Contents
The action
tag defines a single action. Nested tags include action.parameter
for parameters and action.register
for registration to a population.
<actions>
<action id="[ID]" class="[CLASS]">
<action.parameter id="[ID]" value="[VALUE]" scale="[SCALE]" />
<action.register id="[ID]" />
...
</action>
...
</actions>
Action creation
The action
tag attributes are used to create an action.
- Each action must have a unique
id
- Each action must specify a
class
Valid options for classes include:
insert
- Inserts cell agents into the simulation
remove
- Remove cell agents from the simulation
convert
- Converts cell agents to a different population
ATTRIBUTE | DESCRIPTION | TYPE | REQUIRED |
---|---|---|---|
id | unique name for the action | string | Y |
class | action class option | string | Y |
Example: Initializing one agent action
Specifies an agent action, A, with the insert action class.
<actions>
<action id="A" class="insert" />
</actions>
Example: Initializing two agent actions
Specifies two agent actions, A and B. Action A uses the insert action class, and action B uses the convert action class.
<actions>
<action id="A" class="insert" />
<action id="B" class="convert" />
</actions>
Action parameters
The action.parameter
tag defines action parameters. Unless modified, default values are used for all parameters. Defaults are listed in parameter.patch.xml.
- Either or both
value
andscale
attributes can be applied, withvalue
applied first - Only numeric parameters can be modified using
scale
ATTRIBUTE | DESCRIPTION |
---|---|
id | parameter name |
value | new parameter value |
scale | scaling factor applied to parameter value |
Example: Modifying action parameters
The insert radius parameter is set to the new value 2000.
<action.parameter id="INSERT_RADIUS" value="2000" />
The default value of the insert radius parameter is scaled by 2.
<action.parameter id="INSERT_RADIUS" scale="2" />
The insert radius parameter is set to the new value 10 * 2 = 20.
<action.parameter id="INSERT_RADIUS" value="10" scale="2" />
Registration to populations
The action.register
tag registers the action to a specific population. The registered population id must match a population defined in the cell population setup. Actions may or may not need to have registered populations, depending on the specific action class. For example, the remove
action does not need a registered population while the insert
action may be registered to multiple populations.
ATTRIBUTE | DESCRIPTION |
---|---|
id | population id |
Example: Registering one population to an action
The action is registered to population A.
<action.register id="A" />
Example: Registering two populations to an action
The action is registered to population A and B.
<action.register id="A" />
<action.register id="B" />