Class CARule2D

java.lang.Object
toxi.sim.automata.CARule2D
All Implemented Interfaces:
CARule, MatrixEvolver

public class CARule2D extends Object implements CARule
  • Constructor Details

    • CARule2D

      public CARule2D(byte[] brules, byte[] srules, int st, boolean tiled)
  • Method Details

    • booleanToByteArray

      public static final byte[] booleanToByteArray(boolean[] kernel)
    • byteListToArray

      public static final byte[] byteListToArray(List<Byte> rules)
    • evolve

      public void evolve(EvolvableMatrix m)
      Specified by:
      evolve in interface MatrixEvolver
    • getBirthRules

      public byte[] getBirthRules()
    • getStateCount

      public int getStateCount()
      Specified by:
      getStateCount in interface CARule
    • getSurvivalRules

      public byte[] getSurvivalRules()
    • isAutoExpire

      public boolean isAutoExpire()
      Specified by:
      isAutoExpire in interface CARule
    • isTiling

      public boolean isTiling()
      Specified by:
      isTiling in interface CARule
    • randomize

      public void randomize()
      Specified by:
      randomize in interface CARule
    • setAutoExpire

      public void setAutoExpire(boolean state)
      Specified by:
      setAutoExpire in interface CARule
    • setBirthRules

      public void setBirthRules(byte[] b)
    • setRandomProbabilities

      public void setRandomProbabilities(float birth, float survival)
    • setStateCount

      public void setStateCount(int num)
      Specified by:
      setStateCount in interface CARule
    • setSurvivalRules

      public void setSurvivalRules(byte[] s)
    • setTiling

      public void setTiling(boolean state)
      Specified by:
      setTiling in interface CARule
    • toString

      public String toString()
      Overrides:
      toString in class Object