cz.cuni.amis.pogamut.shady.engine
Class ShadeEngine<EXECUTOR extends IWorkExecutor>

Package class diagram package ShadeEngine
java.lang.Object
  extended by cz.cuni.amis.pogamut.shady.engine.ShadeEngine<EXECUTOR>

public class ShadeEngine<EXECUTOR extends IWorkExecutor>
extends Object

This class is taking a shade plan (already parsed in form of ShadeTree and executing it using supplied IWorkExecutor. Shade engine is an if-then tree like structure, that is evaluated during every iteration. It is very simple, but it should be the advantage, not disadvantage. Posh engine is very complicated with many features very few know about, much less actually use.

Author:
Honza

Constructor Summary
ShadeEngine(ShadeTree plan, EXECUTOR executor)
          Create new engine with set plan and executor.
 
Method Summary
 void evaluate()
          Take the plan evaluate it and run the target primitive.
protected  BigDecimal executeCall(NodeCall call)
           
protected  NodeElement getSelectedElement(ShadeNode node)
          Take the node and find which of its elements should be selected according to highest priority and enabled trigger.
protected  NodeCall selectCall(ShadeNode node)
          Go throught the node tree and find the leaf (NodeElement) that doesn't call another {@link ShadeNode node} and return the call of the leaf.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadeEngine

public ShadeEngine(ShadeTree plan,
                   EXECUTOR executor)
Create new engine with set plan and executor.

Parameters:
plan - plan that this engine will execute.
executor - executor used to execute queries and actions.
Method Detail

evaluate

public void evaluate()
              throws MissingRootException,
                     NoEligibleElementException
Take the plan evaluate it and run the target primitive.

Throws:
MissingRootException
NoEligibleElementException

selectCall

protected NodeCall selectCall(ShadeNode node)
                       throws NoEligibleElementException
Go throught the node tree and find the leaf (NodeElement) that doesn't call another {@link ShadeNode node} and return the call of the leaf.

Parameters:
node - node where we start the search. Node must be part of the plan (not checked).
Returns:
Found call
Throws:
NoEligibleElementException

getSelectedElement

protected NodeElement getSelectedElement(ShadeNode node)
                                  throws NoEligibleElementException
Take the node and find which of its elements should be selected according to highest priority and enabled trigger.

Parameters:
node - node for searched elements
Returns:
selected node
Throws:
NoEligibleElementException

executeCall

protected BigDecimal executeCall(NodeCall call)


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.