Class DoubleLetterTransitions

java.lang.Object
application.model.rules.isotropic.transitions.INTTransitions
application.model.rules.isotropic.transitions.DoubleLetterTransitions
Direct Known Subclasses:
R2CheckerboardINT, R2VonNeumannINT, R3CrossINT

public abstract class DoubleLetterTransitions
extends INTTransitions
Implements INT transitions that consist of 2 letters (one isotropic, the another anisotropic) such as the range 2 von neumann INT transitions
  • Field Details

    • anisotropicTransitionLookup

      protected java.util.HashMap<java.lang.Character,​java.util.ArrayList<java.lang.Integer>> anisotropicTransitionLookup
    • isotropicTransitionLookup

      protected java.util.HashMap<java.lang.Integer,​java.util.HashMap<java.lang.Character,​java.util.ArrayList<java.lang.Integer>>> isotropicTransitionLookup
    • reverseAnisotropicTransitionLookup

      protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,​java.lang.String> reverseAnisotropicTransitionLookup
    • reverseIsotropicTransitionLookup

      protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,​java.lang.String> reverseIsotropicTransitionLookup
    • reverseTransitionLookup

      protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,​java.lang.String> reverseTransitionLookup
    • transitionsByNeighbourhoodCount

      protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>[] transitionsByNeighbourhoodCount
  • Constructor Details

    • DoubleLetterTransitions

      public DoubleLetterTransitions​(java.lang.String string)
      Constructs the INT transitions that consist of 2 letters
      Parameters:
      string - The string representation of the INT transitions
  • Method Details

    • readTransitionsFromFile

      public void readTransitionsFromFile​(java.io.InputStream stream, java.io.InputStream stream2)
      Reads the transitions from 2 files with the provided filename and loads them into 2 transition lookups
      Parameters:
      stream - The input stream of the file with the anisotropic transitions
      stream2 - The input stream of the file with the isotropic transitions
    • parseTransitions

      protected void parseTransitions​(java.lang.String string)
      Parses transitions from the provided string
      Specified by:
      parseTransitions in class INTTransitions
      Parameters:
      string - The string representation of the INT transitions
    • canoniseTransitions

      public java.lang.String canoniseTransitions()
      Canonises the transitions based on the currently loaded parameters
      Specified by:
      canoniseTransitions in class INTTransitions
      Returns:
      Returns the canonised transitions in the form of a string
    • getRegex

      public java.lang.String getRegex()
      Gets the regex to identify a single transition block (number + characters)
      Specified by:
      getRegex in class INTTransitions
      Returns:
      Returns the regex that identifies that transition block
    • getTransitionsFromNeighbours

      public java.lang.String getTransitionsFromNeighbours​(java.util.ArrayList<java.lang.Integer> neighbours)
      Gets the INT transition from the neighbours
      Specified by:
      getTransitionsFromNeighbours in class INTTransitions
      Parameters:
      neighbours - The neighbours of the cell
      Returns:
      Returns the INT transition (e.g. 2aa, 3ca, 8xl)
    • addTransition

      public void addTransition​(java.lang.String transition)
      Adds an INT transition
      Specified by:
      addTransition in class INTTransitions
      Parameters:
      transition - The INT transition to add
    • removeTransition

      public void removeTransition​(java.lang.String transition)
      Removes an INT transition
      Specified by:
      removeTransition in class INTTransitions
      Parameters:
      transition - The INT transition to remove
    • getIsotropicSymmetries

      protected abstract java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getIsotropicSymmetries​(java.util.ArrayList<java.lang.Integer> transition)
      Applies the symmetries to the provided isotropic transitions
      Parameters:
      transition - The transition on which the symmetries will be applied
      Returns:
      Returns the applied symmetries