Next-to Condition

From AgentSheetsWiki

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
|-
|-
| align="left" valign="top" width="80" | '''Parameters:'''  
| align="left" valign="top" width="80" | '''Parameters:'''  
-
| align="left" valign="top" width="100%" | [[Comparator parameter|comparator]]&nbsp;''mathematical operator'' <br>[[VAT Formula parameter|number]]&nbsp;''how many'' <br> [[Shape parameter|shape]]&nbsp;''what shape''
+
| align="left" valign="top" width="100%" |  
 +
[[Comparator parameter|comparator]]:&nbsp;''mathematical operator'' <br>[[VAT Formula parameter|number]]:&nbsp;''how many''&nbsp;(may be a number or VAT formula)<br> [[Shape parameter|shape]]:&nbsp;''what shape''
 +
layer: which layer to search for the target agent
 +
 
|-
|-
| align="left" valign="top" width="80" | '''Example:'''  
| align="left" valign="top" width="80" | '''Example:'''  
| align="left" valign="top" width="100%" |  
| align="left" valign="top" width="100%" |  
-
'''nextTo (&gt;=, 2, ghost)''' means: are there 2 or more ghosts immediatly adjacent to me?
+
'''nextTo (&gt;=, 2, ghost)''' means: are there 2 or more ghosts immediatly adjacent to me?  
-
 
+
 +
<br>
-
The Particle agent in the Accretion 3D project checks if it is next to at least one stationery Particle in the same layer or in the layers above (+1) or below (-1). If so, it changes itself to be a stationery Particle, increments a count and maps its color to a shade, based on the current count of stationery particles. [[Image:Next to condition example.png|500px|Next to condition example.png]]
+
The Particle agent in the Accretion 3D project checks if it is next to at least one stationery Particle in the same layer or in the layers above (+1) or below (-1). If so, it changes itself to be a stationery Particle, increments a count and maps its color to a shade, based on the current count of stationery particles. [[Image:Next to condition example.png|500px|Next to condition example.png]]  
|}
|}
[[Category:AgentCubes_Conditions]]
[[Category:AgentCubes_Conditions]]

Revision as of 19:23, 20 April 2012

Next to condition.png

Next to expanded.png

Definition: True if there is a certain number of agents adjacent to me. Only check the 8 immediatly adjacent agents around me. 
Parameters:

comparatormathematical operator
numberhow many (may be a number or VAT formula)
shapewhat shape layer: which layer to search for the target agent

Example:

nextTo (>=, 2, ghost) means: are there 2 or more ghosts immediatly adjacent to me?


The Particle agent in the Accretion 3D project checks if it is next to at least one stationery Particle in the same layer or in the layers above (+1) or below (-1). If so, it changes itself to be a stationery Particle, increments a count and maps its color to a shade, based on the current count of stationery particles. Next to condition example.png

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox