Next-to Condition

From AgentCubes
Revision as of 03:05, 20 April 2012 by imported>Repenning
Jump to navigation Jump to search

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: comparator mathematical operator
number how many
shape what shape
Example: 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