org.grinvin.conjecture.engine.apengine
Class TreeGenerator<T,extends,BinaryTree>
java.lang.Object
org.grinvin.conjecture.engine.apengine.TreeGenerator<T,extends,BinaryTree>
public class TreeGenerator<T,extends,BinaryTree>
extends java.lang.Object
boolean | complete(T tree) - Is the given
LabeledBinaryTree complete? A tree is complete if its
amount of unary and binary operators matches the current unary and
binary operator count respectively.
|
boolean | correct(T tree) - Is the given
LabeledBinaryTree correct? A tree is correct if it is still
possible to extend it to a complete tree.
|
protected void | extend() - Try to extend the workingTree.
|
T | nextTree() - Return the next
LabeledBinaryTree .
|
protected void | pushNextOperatorCount() - Push a new depthstate on the stack with the next number of unary and binary operators.
|
completeWorkingTree
protected boolean completeWorkingTree
currentBinaryOperators
protected int currentBinaryOperators
currentUnaryOperators
protected int currentUnaryOperators
treeFactory
protected TreeFactory treeFactory
workingTree
protected T workingTree
TreeGenerator
public TreeGenerator(TreeFactory treeFactory)
TreeGenerator
public TreeGenerator(int unaryOperators,
int binaryOperators,
TreeFactory treeFactory)
complete
public boolean complete(T tree)
Is the given
LabeledBinaryTree
complete? A tree is complete if its
amount of unary and binary operators matches the current unary and
binary operator count respectively.
correct
public boolean correct(T tree)
Is the given
LabeledBinaryTree
correct? A tree is correct if it is still
possible to extend it to a complete tree.
extend
protected void extend()
Try to extend the workingTree.
nextTree
public T nextTree()
pushNextOperatorCount
protected void pushNextOperatorCount()
Push a new depthstate on the stack with the next number of unary and binary operators.
The operators are added as follows: