de.cesr.lara.components.decision.impl
Class LAbstractBinaryDecsionTree<A extends LaraAgent<A,? super BO>,BO extends LaraBehaviouralOption<?,BO>,P>

java.lang.Object
  extended by de.cesr.lara.components.decision.impl.LAbstractBinaryDecsionTree<A,BO,P>
Type Parameters:
A - agent class this decision tree is used by
BO - type of behavioural options
P - the parameter class type
All Implemented Interfaces:
LaraDecisionTree<A,BO,P>

public abstract class LAbstractBinaryDecsionTree<A extends LaraAgent<A,? super BO>,BO extends LaraBehaviouralOption<?,BO>,P>
extends Object
implements LaraDecisionTree<A,BO,P>


Field Summary
protected  LaraDecisionTree<A,BO,P> falseTree
          This decision tree is evaluated in case evaluate() returns false
protected  LaraDecisionTree<A,BO,P> trueTree
          This decision tree is evaluated in case evaluate() returns true
 
Constructor Summary
LAbstractBinaryDecsionTree()
           
LAbstractBinaryDecsionTree(LaraDecisionTree<A,BO,P> trueTree, LaraDecisionTree<A,BO,P> falseTree)
          Init the decision tree with true decision tree and false decision tree.
 
Method Summary
protected abstract  boolean evaluate(A agent, P parameter)
           
 Set<BO> getBos(A agent, P parameter)
          Processes this node of the decision tree.
 void setFalseDecisionTree(LaraDecisionTree<A,BO,P> falseTree)
           
 void setTrueDecisionTree(LaraDecisionTree<A,BO,P> trueTree)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

falseTree

protected LaraDecisionTree<A extends LaraAgent<A,? super BO>,BO extends LaraBehaviouralOption<?,BO>,P> falseTree
This decision tree is evaluated in case evaluate() returns false


trueTree

protected LaraDecisionTree<A extends LaraAgent<A,? super BO>,BO extends LaraBehaviouralOption<?,BO>,P> trueTree
This decision tree is evaluated in case evaluate() returns true

Constructor Detail

LAbstractBinaryDecsionTree

public LAbstractBinaryDecsionTree()

LAbstractBinaryDecsionTree

public LAbstractBinaryDecsionTree(LaraDecisionTree<A,BO,P> trueTree,
                                  LaraDecisionTree<A,BO,P> falseTree)
Init the decision tree with true decision tree and false decision tree.

Parameters:
trueTree - This decision tree is evaluated in case evaluate() returns true
falseTree - This decision tree is evaluated in case evaluate() returns false
Method Detail

getBos

public Set<BO> getBos(A agent,
                      P parameter)
Description copied from interface: LaraDecisionTree
Processes this node of the decision tree.

Specified by:
getBos in interface LaraDecisionTree<A extends LaraAgent<A,? super BO>,BO extends LaraBehaviouralOption<?,BO>,P>
Parameters:
agent - the LaraAgent this decision tree is processed for
parameter - the parameter object (decisionBuilder, for instance)
Returns:
a set of LaraBehaviouralOptions

setFalseDecisionTree

public void setFalseDecisionTree(LaraDecisionTree<A,BO,P> falseTree)
Parameters:
falseTree - the decision tree to evaluate when evaluate() returns false

setTrueDecisionTree

public void setTrueDecisionTree(LaraDecisionTree<A,BO,P> trueTree)
Parameters:
trueTree - the decision tree to evaluate when evaluate() returns true

evaluate

protected abstract boolean evaluate(A agent,
                                    P parameter)
Returns:
false when the false tree shall be evaluated, true if the true tree shall be evaluated.