||x + y
x - y
x * y
x / y
|Basic arithmetic operations
||3 + 4
|Agent Attribute Access
||Access the value of an agent attribute. An agent can have any number of attributes defined by the user
Diameter * 3.14
|value of the agent attribute "Diameter"
value of attribute "Diameter" multiplied by 3.14
|Remote Agent Attribute Access
|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.
You may also use attribute[stacked_above]
to access the value of attribute in the agent that is stacked directly above and attribute[stacked_below]
to access the value of attribute in the agent that is stacked directly below.
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.
value of the "height" attribute of the agent stacked directly above
|Simulation Property Access
||Access the value of a global simulation property
Simulation Properties 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.
||value of simulation property "Time"
|Agent Query Functions
||Query function that returns the number of agents with a given depiction.
||returns the number of agents that have a depiction with the name "dead_frog" in the simulation.
||Query function that returns the number of agents with a given name.
||returns the number of "frog" agents in the simulation.
||Trigonometric function sine, where x is expressed in radians
||Trigonometric function cosine, where x is expressed in radians
||Trigonometric function tangent, where x is expressed in radians
|Random Number Generator
||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.
|returns decimal number between 0 (inclusive) and 4.0 (exclusive)
returns either 0.0, 1.0, 2.0, or 3.0
||x ^^ y
||Exponentiation function. Raises the base number x to the exponent y
||Square root function. Takes the square root of number x, where x is a non-negative integer or a decimal number (x>=0).
|x % y
||Modulo function. Gives the remainder of the division of x / y.
||17 % 4