Class SQC


public class SQC
extends RuleDirective
Implements Square Cell Ruletables (@SQC) which are essentially transition tables that work based on neighbourhood sum.

_ Example:
 \@SQC
 neighborhood:[(0, 0), (-2, 0), (-1, 0), (0, -2), (0, -1), (0, 1), (0, 2), (1, 0), (2, 0), (0, 0)]
 state_weights:0,1
 0,0,1,0,0,0,0,0
 0,0,0,0,0,0,0,0
 
  • Constructor Details

    • SQC

      public SQC​(java.lang.String content)
  • Method Details

    • parseContent

      public void parseContent​(java.lang.String content)
      Description copied from class: Directive
      Parses the content of the directive
      Specified by:
      parseContent in class Directive
      Parameters:
      content - The content of the directive
    • getNeighbourhood

      public Coordinate[] getNeighbourhood()
      Description copied from class: RuleDirective
      This method returns the neighbourhood of a given cell
      Specified by:
      getNeighbourhood in class RuleDirective
      Returns:
      A list of Coordinates that represent the neighbourhood
    • transitionFunc

      public int transitionFunc​(int[] neighbours, int cellState)
      Description copied from class: RuleDirective
      This method represents the transition function of the rule
      Specified by:
      transitionFunc in class RuleDirective
      Parameters:
      neighbours - The cell's neighbours in the order of the neighbourhood provided
      cellState - The current state of the cell
      Returns:
      The state of the cell in the next generation
    • clone

      public java.lang.Object clone()
      Description copied from class: Directive
      Deep copies the directive
      Specified by:
      clone in class Directive
      Returns:
      Return a deepcopy of the directive