|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstract1DGrid
Rules
The 1 dimensional grid of rules with some utilities.
Field Summary | |
private Rule[] |
rules
Array of rules. |
Fields inherited from class Abstract1DGrid |
|
Constructor Summary | |
Rules(int size)
Creates Rules with the specified size. |
|
Rules(Rules rules)
Creates Rules from the specified rules. |
Method Summary | |
static Rules |
generateRandomRules(int size)
Generates a grid of random rules. |
static Rules |
generateRules(int size,
int ruleCode)
Generates a grid of specific rules defined by the ruleCode. |
Rule |
get(int index)
|
Rule |
getLeft(int index)
|
Rule |
getRight(int index)
|
void |
set(int index,
Rule rule)
Replaces the old rule with the given rule at the specified index. |
java.lang.String |
toString()
|
Methods inherited from class Abstract1DGrid |
getLeftIndex, getRightIndex, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Rule[] rules
Constructor Detail |
public Rules(int size)
Rules
with the specified size. All rules are set to
0 code.
size
- the grid size (number of rules).public Rules(Rules rules)
Rules
from the specified rules.
rules
- the rules (null
not permitted).Method Detail |
public static Rules generateRandomRules(int size)
size
- the grid size (number of rules).
null
not possible).public static Rules generateRules(int size, int ruleCode)
size
- the grid size (number of rules).ruleCode
- the rule code for all rules.
null
not possible).public Rule get(int index)
index
- the rule index.
null
not possible).public void set(int index, Rule rule)
index
- the rule index.rule
- the new rule (null
not permitted).public Rule getLeft(int index)
index
- the rule index.
null
not
possible).public Rule getRight(int index)
index
- the rule index.
null
not
possible).public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |