Difference between revisions of "See Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
m (moved See condition to See-Condition: to make compatible with AgentCubes)
imported>Corrina
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<table cellpadding="10" cellspacing="0" border="0" width="100%">
+
[[Image:See-condition.png|150px|See-condition.png]]  
<tr>
 
<td align="left" valign="top" width="80"><b>Definition:</b></td>
 
<td align="left" valign="top" width="100%">The <strong>See </strong>condition checks if the agent at the cell indicated by the [[Direction parameter]] looks like the shape specified in the [[Shape parameter]]. The dot (.) refers to the agent itself.<br>
 
      If the indicated cell contains the chosen depiction, the condition is true. Otherwise, the condition is false.</td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
 
<td align="left" valign="top" width="100%">[[Direction parameter|direction]], [[Shape parameter|shape]] </td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Optional Parameters:</b></td>
 
<td align="left" valign="top" width="100%"><a href="tm_ti_direction.html" target="body"><strong>direction</strong></a>, <a href="tm_ti_depiction.html" target="body"><strong>depiction</strong></a><strong> </strong></td>
 
<td></td>
 
</tr>
 
  
<tr>
+
[[Image:See-condition-additional-params.png|150px|See-condition-additional-params.png]]
<td align="left" valign="top" width="80"><b>Example:</b></td>
 
<td align="left" valign="top" width="100%">The Shark agent in the <a title="The applet link will only work if you are accessing the documentation from the AgentSheets web pages." href="http://www.agentsheets.com/Applets/fish-tank/index.html" target="Demo Window"><strong>Fish Tank</strong></a> simulation looks above it to see if there is a Fish agent to eat, and also checks to see if the Shark itself looks like a Shark going left and decides to change directions or move to the left.
 
  
<center>
+
{| cellpadding="10" cellspacing="0" border="0" width="100%"
<p><img align="bottom" border="0" src="images/condition_see_example.gif">
+
|-
</center>
+
| align="left" valign="top" width="80" | '''Definition:'''
</td>
+
| 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.''&nbsp;
<td></td>
+
|-
</tr>
+
| align="left" valign="top" width="80" | '''Parameters:'''
</table>
+
| align="left" valign="top" width="100%" |
 +
[[Direction parameter|direction]]:&nbsp;''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.<br> [[Image:See condition example 2.png|500px|See condition example 2.png]]
 +
|}
 +
 
 +
[[Category:AgentCubes_Conditions]]

Latest revision as of 01:19, 21 April 2012

See-condition.png

See-condition-additional-params.png

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:

directionthe 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. See Condition Example.png
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.
See condition example 2.png