Class SQC
java.lang.Object
application.model.rules.ruleloader.Directive
application.model.rules.ruleloader.RuleDirective
application.model.rules.ruleloader.SQC
public class SQC extends RuleDirective
Implements Square Cell Ruletables (@SQC) which are essentially transition tables
that work based on neighbourhood sum.
_ Example:
_ Example:
\@SQC neighborhood:[(0, 0), (-2, 0), (-1, 0), (0, -2), (0, -1), (0, 1), (0, 2), (1, 0), (2, 0), (0, 0)] state_weights:0,1 0,0,1,0,0,0,0,0 0,0,0,0,0,0,0,0
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SQC(java.lang.String content)
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
Deep copies the directiveCoordinate[]
getNeighbourhood()
This method returns the neighbourhood of a given cellvoid
parseContent(java.lang.String content)
Parses the content of the directiveint
transitionFunc(int[] neighbours, int cellState)
This method represents the transition function of the ruleMethods inherited from class application.model.rules.ruleloader.RuleDirective
getNeighbourhood, getNumStates, getStateWeights, getSymmetry, getTiling, getTiling, getWeights
-
Constructor Details
-
SQC
public SQC(java.lang.String content)
-
-
Method Details
-
parseContent
public void parseContent(java.lang.String content)Description copied from class:Directive
Parses the content of the directive- Specified by:
parseContent
in classDirective
- Parameters:
content
- The content of the directive
-
getNeighbourhood
Description copied from class:RuleDirective
This method returns the neighbourhood of a given cell- Specified by:
getNeighbourhood
in classRuleDirective
- Returns:
- A list of Coordinates that represent the neighbourhood
-
transitionFunc
public int transitionFunc(int[] neighbours, int cellState)Description copied from class:RuleDirective
This method represents the transition function of the rule- Specified by:
transitionFunc
in classRuleDirective
- Parameters:
neighbours
- The cell's neighbours in the order of the neighbourhood providedcellState
- The current state of the cell- Returns:
- The state of the cell in the next generation
-
clone
public java.lang.Object clone()Description copied from class:Directive
Deep copies the directive
-