Remote Agent Attribute Access
|
attribute[up]
attribute[down] attribute[left] attribute[right] attribute[top] attribute[bottom] attribute[row, col]
|
Access the value of other agents' attribute using relative coordinates.
Valid coordinates are up, down, left, right, top and bottom. Coordinates can also be specified numerically as row, column. Valid values for row and column are -1, 0, 1. Positive row values indicates right, positive column indicates down.
|
age[left]
age[top] Temperature[-1,-1] 0.25 * (Temp[left] + Temp[right]+ Temp[up] + Temp[down])
|
value of the "Age" attribute of agent to the left
value of the "Age" attribute of the agent on top value of the "Temperature" attribute of the agent above to the left The average of the value of the "Temp" attribute of the agents left, right, up and down.
|
Simulation Property Access
|
@simproperty
|
Access the value of a global simulation property
<a href="tm_simulation_properties.html">Simulation Properties</a> are used to share information between agents. Users can inspect and edit the values of simulation properties using the simulation property editor. The "@" sign is used to differentiate the simulation properties from agent attributes.
|
@Time
|
value of simulation property "Time"
|
Random Number Generator
|
random(number)
|
Returns a pseudo random number between zero and number .
AgentSheets differentiates between integers and decimal numbers. If the number is an integer (e.g. 4), an integer between 0 and number is returned, whereas if number is a decimal number, a decimal number between 0 and number is returned.
|
random(4.0)
random(4)
|
returns decimal number between 0 (inclusive) and 4.0 (exclusive)
returns either 0.0, 1.0, 2.0, or 3.0
|