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
    int applyTransition​(int cellState, int[] neighbours)
    Applies the transition to get the output state
    java.util.Map<java.lang.Integer,​java.lang.Integer> getValues()  
    java.util.Map<java.lang.Integer,​Variable> getVariables()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 ruletable
      permute - Is there permute symmetry?
      transition - The string representing the transition
      variables - 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 cell
      neighbours - 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

      public java.util.Map<java.lang.Integer,​Variable> getVariables()