Package toxi.sim.automata
Class CARule2D
java.lang.Object
toxi.sim.automata.CARule2D
- All Implemented Interfaces:
CARule
,MatrixEvolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final byte[]
booleanToByteArray
(boolean[] kernel) static final byte[]
byteListToArray
(List<Byte> rules) void
byte[]
int
byte[]
boolean
boolean
isTiling()
void
void
setAutoExpire
(boolean state) void
setBirthRules
(byte[] b) void
setRandomProbabilities
(float birth, float survival) void
setStateCount
(int num) void
setSurvivalRules
(byte[] s) void
setTiling
(boolean state) toString()
-
Constructor Details
-
CARule2D
public CARule2D(byte[] brules, byte[] srules, int st, boolean tiled)
-
-
Method Details
-
booleanToByteArray
public static final byte[] booleanToByteArray(boolean[] kernel) -
byteListToArray
-
evolve
- Specified by:
evolve
in interfaceMatrixEvolver
-
getBirthRules
public byte[] getBirthRules() -
getStateCount
public int getStateCount()- Specified by:
getStateCount
in interfaceCARule
-
getSurvivalRules
public byte[] getSurvivalRules() -
isAutoExpire
public boolean isAutoExpire()- Specified by:
isAutoExpire
in interfaceCARule
-
isTiling
public boolean isTiling() -
randomize
public void randomize() -
setAutoExpire
public void setAutoExpire(boolean state) - Specified by:
setAutoExpire
in interfaceCARule
-
setBirthRules
public void setBirthRules(byte[] b) -
setRandomProbabilities
public void setRandomProbabilities(float birth, float survival) -
setStateCount
public void setStateCount(int num) - Specified by:
setStateCount
in interfaceCARule
-
setSurvivalRules
public void setSurvivalRules(byte[] s) -
setTiling
public void setTiling(boolean state) -
toString
-