dk.deepthought.sidious.ruleengine
Class RuleEngineImpl

java.lang.Object
  extended by dk.deepthought.sidious.ruleengine.RuleEngineImpl
All Implemented Interfaces:
RuleEngine

public class RuleEngineImpl
extends java.lang.Object
implements RuleEngine


Field Summary
private static org.apache.commons.logging.Log logger
          Logger for this class
 
Constructor Summary
RuleEngineImpl()
           
 
Method Summary
 double evaluate(SuperLinkID requesterID, State current, State next, Step step)
          This method evaluates the rules associated with the given plan requester.
(package private)  double evaluateRules(java.util.Collection<Rule> rules, State current, State next, Step step)
          This method evaluates each of the input rules according to the input states (current and next), and returns a combined value.
 java.util.Collection<Goal> extractGoals(SuperLinkID requesterID)
          This method extracts the goals of the specified PlanRequester.
(package private)  java.util.Collection<Goal> extractGoalsFromRules(java.util.Collection<Rule> rules)
          Method extracts and returns all goals from the input rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Logger for this class

Constructor Detail

RuleEngineImpl

public RuleEngineImpl()
Method Detail

evaluate

public double evaluate(SuperLinkID requesterID,
                       State current,
                       State next,
                       Step step)
Description copied from interface: RuleEngine
This method evaluates the rules associated with the given plan requester.

The calculation is based upon the state change from current to next.

Specified by:
evaluate in interface RuleEngine
Parameters:
requesterID - the ID of the plan requester
current - the current state
next - the next state
step - the step
Returns:
the combined evaluation.

evaluateRules

double evaluateRules(java.util.Collection<Rule> rules,
                     State current,
                     State next,
                     Step step)
This method evaluates each of the input rules according to the input states (current and next), and returns a combined value.

Parameters:
rules - the input collection of rules
current - the current state
next - the next state
step - the step
Returns:
a combined evaluation, 0 if rules is empty

extractGoals

public java.util.Collection<Goal> extractGoals(SuperLinkID requesterID)
Description copied from interface: RuleEngine
This method extracts the goals of the specified PlanRequester.

Specified by:
extractGoals in interface RuleEngine
Parameters:
requesterID - the id of the plan requester
Returns:
the extracted goals

extractGoalsFromRules

java.util.Collection<Goal> extractGoalsFromRules(java.util.Collection<Rule> rules)
Method extracts and returns all goals from the input rules.

Parameters:
rules - the rules the goals will be extracted from
Returns:
the extracted goals


Copyright © Deepthought Development - All Rights Reserved.