Class VonNeumann
java.lang.Object
application.model.rules.misc.turmites.Neighbourhood
application.model.rules.misc.turmites.VonNeumann
public class VonNeumann extends Neighbourhood
Implements turmites on the von neumann neighbourhood
-
Constructor Summary
Constructors Constructor Description VonNeumann() -
Method Summary
Modifier and Type Method Description int[]getActions()Gets the actions the turmite can takeCoordinate[]getNeighbourhood()Gets the neighbourhood of the turmiteintgetNewDirection(int action, int turmiteDirection)Gets the new direction of the turmiteintgetOppositeDirection(int direction)Gets direction opposite to the direction passed inTilinggetTiling()Gets the tiling the neighbourhood applies to
-
Constructor Details
-
VonNeumann
public VonNeumann()
-
-
Method Details
-
getTiling
Description copied from class:NeighbourhoodGets the tiling the neighbourhood applies to- Specified by:
getTilingin classNeighbourhood- Returns:
- Returns the tiling of the neighbourhood
-
getActions
public int[] getActions()Description copied from class:NeighbourhoodGets the actions the turmite can take- Specified by:
getActionsin classNeighbourhood- Returns:
- Returns the actions that the turmite can take
-
getNeighbourhood
Description copied from class:NeighbourhoodGets the neighbourhood of the turmite- Specified by:
getNeighbourhoodin classNeighbourhood- Returns:
- Returns the neighbourhood of the turmite
-
getOppositeDirection
public int getOppositeDirection(int direction)Description copied from class:NeighbourhoodGets direction opposite to the direction passed in- Specified by:
getOppositeDirectionin classNeighbourhood- Parameters:
direction- The direction- Returns:
- Returns the opposite direction of the direction passed in
-
getNewDirection
public int getNewDirection(int action, int turmiteDirection)Description copied from class:NeighbourhoodGets the new direction of the turmite- Specified by:
getNewDirectionin classNeighbourhood- Parameters:
action- The action taken by the turmiteturmiteDirection- The turmite's direction- Returns:
- Returns the new direction of the turmite
-