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>>anisotropicTransitionLookupprotected java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Character,java.util.ArrayList<java.lang.Integer>>>isotropicTransitionLookupprotected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>reverseAnisotropicTransitionLookupprotected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>reverseIsotropicTransitionLookupprotected java.util.HashMap<java.util.ArrayList<java.lang.Integer>,java.lang.String>reverseTransitionLookupprotected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>[]transitionsByNeighbourhoodCountFields 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 voidaddTransition(java.lang.String transition)Adds an INT transitionjava.lang.StringcanoniseTransitions()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.StringgetRegex()Gets the regex to identify a single transition block (number + characters)java.lang.StringgetTransitionsFromNeighbours(java.util.ArrayList<java.lang.Integer> neighbours)Gets the INT transition from the neighboursprotected voidparseTransitions(java.lang.String string)Parses transitions from the provided stringvoidreadTransitionsFromFile(java.io.InputStream stream, java.io.InputStream stream2)Reads the transitions from 2 files with the provided filename and loads them into 2 transition lookupsvoidremoveTransition(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:
parseTransitionsin 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:
canoniseTransitionsin 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:
getRegexin 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:
getTransitionsFromNeighboursin 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:
addTransitionin classINTTransitions- Parameters:
transition- The INT transition to add
-
removeTransition
public void removeTransition(java.lang.String transition)Removes an INT transition- Specified by:
removeTransitionin 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
-