Class Transition
java.lang.Object
application.model.rules.ruleloader.ruletable.Transition
public class Transition
extends java.lang.Object
Represents a ruletable transition
-
Constructor Summary
Constructors Constructor Description Transition(int numStates, boolean permute, java.lang.String transition, java.util.Map<java.lang.String,Variable> variables)Constructs a transition -
Method Summary
Modifier and Type Method Description intapplyTransition(int cellState, int[] neighbours)Applies the transition to get the output statejava.util.Map<java.lang.Integer,java.lang.Integer>getValues()java.util.Map<java.lang.Integer,Variable>getVariables()
-
Constructor Details
-
Transition
public Transition(int numStates, boolean permute, java.lang.String transition, java.util.Map<java.lang.String,Variable> variables)Constructs a transition- Parameters:
numStates- The number of states of the ruletablepermute- Is there permute symmetry?transition- The string representing the transitionvariables- The variables representing the transition
-
-
Method Details
-
applyTransition
public int applyTransition(int cellState, int[] neighbours)Applies the transition to get the output state- Parameters:
cellState- The state of the cellneighbours- The neighbours of the cell- Returns:
- Returns -1 if the transition does not match, returns the cell's next state if it does
-
getValues
public java.util.Map<java.lang.Integer,java.lang.Integer> getValues() -
getVariables
-