Difference between revisions of "See Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Andri
Line 17: Line 17:
  
 
<tr>
 
<tr>
<td align="left" valign="top" width="80"><b>Example:</b></td>
+
<td align="left" valign="top" width="80"><b>Examples:</b></td>
 
<td align="left" valign="top" width="100%">If the Tree agent in the Forest Fire simulation is currently a burning tree (i.e. sees itself as a burning tree shape), with a 50% chance (the die out probability for the fire) changes itself to a burnt tree, incremetns the burnt tree count (the simulation property called "Burnt_Trees") and calculates the percentage of burnt trees in the forest.
 
<td align="left" valign="top" width="100%">If the Tree agent in the Forest Fire simulation is currently a burning tree (i.e. sees itself as a burning tree shape), with a 50% chance (the die out probability for the fire) changes itself to a burnt tree, incremetns the burnt tree count (the simulation property called "Burnt_Trees") and calculates the percentage of burnt trees in the forest.
 
[[Image:See Condition Example.png]]
 
[[Image:See Condition Example.png]]
 +
 +
If the Nebuchadnezzar agent in the 3D Matrix game sees a Matrix shame in the layer above it, it plays the Whip sound, removes the Matrix (erases the agent in the same x,y position, but the layer above it) and replaces it with a Hole agent.
 +
[[Image:See Condition Example2.png]]
 +
</td>
 
</td>
 
</td>
 
</tr>
 
</tr>

Revision as of 16:26, 17 June 2011

See-condition.png

See-condition-additional-params.png

Definition: The See condition checks if the agent at the cell indicated by the Direction parameter looks like the shape specified in the Shape parameter. The dot (.) in the direction parameter refers to the agent itself, so the agent can check its own shape. If the cell in the indicated contains the chosen shape, the See condition is true. Otherwise, the condition is false.
Parameters: direction, shape
Optional Parameters: Layer parameter: the See condition can check to see if the specified shape exists in a layer other than the current layer the agent resides on.
Examples: If the Tree agent in the Forest Fire simulation is currently a burning tree (i.e. sees itself as a burning tree shape), with a 50% chance (the die out probability for the fire) changes itself to a burnt tree, incremetns the burnt tree count (the simulation property called "Burnt_Trees") and calculates the percentage of burnt trees in the forest.

See Condition Example.png

If the Nebuchadnezzar agent in the 3D Matrix game sees a Matrix shame in the layer above it, it plays the Whip sound, removes the Matrix (erases the agent in the same x,y position, but the layer above it) and replaces it with a Hole agent. File:See Condition Example2.png