Difference between revisions of "Stacked Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Corrina
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[image:See a condition.png|150px]]
+
[[Image:Stacked.png|200px|Stacked.png]]  
  
[[image:See a condition additional params.png|150px]]
+
{| cellpadding="10" cellspacing="0" border="0" width="100%"
<table cellpadding="10" cellspacing="0" border="0" width="100%">
+
|-
<tr>
+
| align="left" valign="top" width="80" | '''Definition:'''
<td align="left" valign="top" width="80"><b>Definition:</b></td>
+
| align="left" valign="top" width="100%" | The '''Stacked''' condition: ''checks if the agent's location in relation to the agent specified by the exact&nbsp;''[[Shape parameter|''shape'']]''matches the adjacency choice.''<br>
<td align="left" valign="top" width="100%">The <strong>See-A</strong> condition checks if the agent at the cell indicated by the [[Direction parameter]] is of the class specified in the [[Agent Class Name parameter]]. If the cell in the indicated direction contains an agent of the specified class, the See-a condition is true. Otherwise, the condition is false. In contrast to the [[See Condition]], the See-a condition picks out all the shapes of a given agent. Use it to identify an agent regardless of the way it looks. </td>
+
====== The difference between the Stacked and the [[Stacked-a Condition|Stacked-A]] conditions is that the Stacked condition checks for a specific shape/look and is true only if the agent has that exact depiction, whereas Stacked-A checks for any depiction of the given agent and is true regardless of how the agent looks. ======
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
 
<td align="left" valign="top" width="100%">[[Direction parameter|direction]], [[Agent Class Name parameter|agent class name]] </td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Optional Parameters:</b></td>
 
<td align="left" valign="top" width="100%">[[Layer parameter]]: the See-a condition can check to see if the specified agent exists in a layer other than the current layer the agent resides on.</td>
 
</tr>
 
  
<tr>
+
|-
<td align="left" valign="top" width="80"><b>Example:</b></td>
+
| align="left" valign="top" width="80" | '''Parameters:'''
<td align="left" valign="top" width="100%">If the Frog agent in the Frogger game sees a Truck agent to its left (no matter how the truck looks like), it will collide with it and plays a sound, changes to look like the dead frog, waits half a second, erases itself, decrements the Lives counter and broadcasts to the frog_generator to create a new Frog at the start.
+
| align="left" valign="top" width="100%" |
[[Image:See a condition example.png|500px]]</td>
+
[[Adjacency parameter|adjacency]]: ''where to look for the target agent''
</tr>
 
  
</table>
+
[[Shape parameter|shape]]: ''the exact depiction of agent to look for''
 +
 
 +
|-
 +
| align="left" valign="top" width="80" | '''Example:'''
 +
| align="left" valign="top" width="100%" | <br>
 +
|}
  
 
[[Category:AgentCubes_Conditions]]
 
[[Category:AgentCubes_Conditions]]

Latest revision as of 01:13, 21 April 2012

Stacked.png

Definition: The Stacked condition: checks if the agent's location in relation to the agent specified by the exact shapematches the adjacency choice.
The difference between the Stacked and the Stacked-A conditions is that the Stacked condition checks for a specific shape/look and is true only if the agent has that exact depiction, whereas Stacked-A checks for any depiction of the given agent and is true regardless of how the agent looks.
Parameters:

adjacency: where to look for the target agent

shape: the exact depiction of agent to look for

Example: