See Condition

(Difference between revisions)
 Revision as of 10:39, 17 June 2011 (view source)Andri (Talk | contribs)← Older edit Revision as of 19:19, 20 April 2012 (view source)Corrina (Talk | contribs) Newer edit → Line 1: Line 1: - [[image:See-condition.png|150px]] + [[Image:See-condition.png|150px|See-condition.png]] - [[image:See-condition-additional-params.png|150px]] + [[Image:See-condition-additional-params.png|150px|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 direction contains the chosen shape, the See condition is true. Otherwise, the condition is false.
Parameters:[[Direction parameter|direction]], [[Shape parameter|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.
Example 1:same layer: 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. + | align="left" valign="top" width="80" | '''Definition:''' - [[Image:See Condition Example.png|500px]]
Example 2: different layer:In its "remove above" method, 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 example 2.png|500px]]
+ - + - + - + - + - + - + - + - + - + - + - + - + {| cellpadding="10" cellspacing="0" border="0" width="100%" - + |- - + | align="left" valign="top" width="100%" | The '''See''' condition:''checks if the agent at the cell indicated by the ''[[Direction parameter|''Direction parameter'']]''looks like the shape specified in the ''[[Shape parameter|''Shape parameter'']]''. The agent can check its own shape.''  - + |- + | align="left" valign="top" width="80" | '''Parameters:''' + | align="left" valign="top" width="100%" | + [[Direction parameter|direction]]:''the direction to check for the target agent'' - + [[Shape parameter|shape]]: ''the specific agent depiction of the target agent'' - + - + | align="left" valign="top" width="80" | '''Optional Parameters:''' - + | align="left" valign="top" width="100%" | [[Layer parameter]]: the layer to check for the target agent - + |- + | align="left" valign="top" width="80" | '''Example 1:''' + | align="left" valign="top" width="100%" | '''same layer:''' 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|500px|See Condition Example.png]] + |- + | align="left" valign="top" width="80" | '''Example 2:''' + | align="left" valign="top" width="100%" | '''different layer:'''In its "remove above" method, 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 example 2.png|500px|See condition example 2.png]] + |} [[Category:AgentCubes_Conditions]] [[Category:AgentCubes_Conditions]]

Revision as of 19:19, 20 April 2012

 Definition: The See condition:checks if the agent at the cell indicated by the Direction parameterlooks like the shape specified in the Shape parameter. The agent can check its own shape. Parameters: direction:the direction to check for the target agent shape: the specific agent depiction of the target agent Optional Parameters: Layer parameter: the layer to check for the target agent Example 1: same layer: 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. Example 2: different layer:In its "remove above" method, 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.