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 take
    abstract Coordinate[] getNeighbourhood()
    Gets the neighbourhood of the turmite
    abstract int getNewDirection​(int action, int turmiteDirection)
    Gets the new direction of the turmite
    abstract int getOppositeDirection​(int direction)
    Gets direction opposite to the direction passed in
    abstract Tiling getTiling()
    Gets the tiling the neighbourhood applies to

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getTiling

      public abstract Tiling 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

      public abstract Coordinate[] 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 turmite
      turmiteDirection - The turmite's direction
      Returns:
      Returns the new direction of the turmite