Class Neighbourhood
java.lang.Object
application.model.rules.misc.turmites.Neighbourhood
- Direct Known Subclasses:
Hexagonal
,Triangular
,VonNeumann
public abstract class Neighbourhood
extends java.lang.Object
The base class for various turmite neighbourhoods
-
Constructor Summary
Constructors Constructor Description Neighbourhood()
-
Method Summary
Modifier and Type Method Description abstract int[]
getActions()
Gets the actions the turmite can takeabstract Coordinate[]
getNeighbourhood()
Gets the neighbourhood of the turmiteabstract int
getNewDirection(int action, int turmiteDirection)
Gets the new direction of the turmiteabstract int
getOppositeDirection(int direction)
Gets direction opposite to the direction passed inabstract Tiling
getTiling()
Gets the tiling the neighbourhood applies to
-
Constructor Details
-
Neighbourhood
public Neighbourhood()
-
-
Method Details
-
getTiling
Gets the tiling the neighbourhood applies to- Returns:
- Returns the tiling of the neighbourhood
-
getActions
public abstract int[] getActions()Gets the actions the turmite can take- Returns:
- Returns the actions that the turmite can take
-
getNeighbourhood
Gets the neighbourhood of the turmite- Returns:
- Returns the neighbourhood of the turmite
-
getOppositeDirection
public abstract int getOppositeDirection(int direction)Gets direction opposite to the direction passed in- Parameters:
direction
- The direction- Returns:
- Returns the opposite direction of the direction passed in
-
getNewDirection
public abstract int getNewDirection(int action, int turmiteDirection)Gets the new direction of the turmite- Parameters:
action
- The action taken by the turmiteturmiteDirection
- The turmite's direction- Returns:
- Returns the new direction of the turmite
-