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 Summary
Fields Modifier and Type Field Description protected java.util.HashMap<java.lang.Character,java.util.ArrayList<java.lang.Integer>>
anisotropicTransitionLookup
protected java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Character,java.util.ArrayList<java.lang.Integer>>>
isotropicTransitionLookup
protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>
reverseAnisotropicTransitionLookup
protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>
reverseIsotropicTransitionLookup
protected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>
reverseTransitionLookup
protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>[]
transitionsByNeighbourhoodCount
Fields inherited from class application.model.rules.isotropic.transitions.INTTransitions
neighbourhood, sortedTransitionTable, transitionString, transitionTable
-
Constructor Summary
Constructors Constructor Description DoubleLetterTransitions(java.lang.String string)
Constructs the INT transitions that consist of 2 letters -
Method Summary
Modifier and Type Method Description void
addTransition(java.lang.String transition)
Adds an INT transitionjava.lang.String
canoniseTransitions()
Canonises the transitions based on the currently loaded parametersprotected 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 transitionsjava.lang.String
getRegex()
Gets the regex to identify a single transition block (number + characters)java.lang.String
getTransitionsFromNeighbours(java.util.ArrayList<java.lang.Integer> neighbours)
Gets the INT transition from the neighboursprotected void
parseTransitions(java.lang.String string)
Parses transitions from the provided stringvoid
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 lookupsvoid
removeTransition(java.lang.String transition)
Removes an INT transitionMethods inherited from class application.model.rules.isotropic.transitions.INTTransitions
addTransition, checkSubset, checkTransition, checkTransition, clone, getMaxTransition, getMinTransition, getNeighbourhood, getSortedTransitionTable, getSymmetries, getTransitionString, getTransitionTable, randomise, removeTransition, setTransitionString
-
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 transitionsstream2
- 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 classINTTransitions
- 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 classINTTransitions
- 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 classINTTransitions
- 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 classINTTransitions
- 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 classINTTransitions
- Parameters:
transition
- The INT transition to add
-
removeTransition
public void removeTransition(java.lang.String transition)Removes an INT transition- Specified by:
removeTransition
in classINTTransitions
- 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
-