|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclarion.system.AbstractExplicitModule
clarion.system.AbstractRule
public abstract class AbstractRule
This class implements an abstract rule within CLARION. It extends the AbstractExplicitModule class and implements the InterfaceTracksMatchStatistics, InterfaceHandlesFeedbackWithTime, and InterfaceTracksTime interfaces. This class is abstract and therefore cannot be instantiated on its own.
Usage:
The abstract rule is the base class for rules within the ACS. All rule types within the rule collection in the ACS extend from this class.
Known Subclasses:
This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.
Nested Class Summary | |
---|---|
static class |
AbstractRule.SelectionTypes
The various types of measures that can be selected over when performing action decision making. |
static class |
AbstractRule.UtilityOptions
The options for calculating the utility of a rule. |
Field Summary | |
---|---|
double |
BENEFIT_CONSTANT
The constant to use for benefit when using the constant option for utility. |
double |
C7
Benefit equation constant c7. |
double |
C8
Benefit equation constant c8. |
protected java.util.HashMap<java.lang.Integer,AbstractRule> |
Children
The child rules (if any) of this rule. |
double |
COST_CONSTANT
The constant to use for benefit when using the constant option for utility. |
protected DimensionValueCollection |
CurrentInput
The current input. |
static double |
DEAFUALT_PARTIAL_MATCH_ON
The default partial match threshold if partial match is turned on. |
static double |
DEFAULT_PARTIAL_MATCH_OFF
The default partial match threshold if partial match is turned off. |
double |
DENSITY
The density (the minimum frequency needed to be kept) |
private double |
Feedback
The immediate feedback (if given). |
static double |
GLOBAL_BENEFIT_CONSTANT
The constant to use for benefit when using the constant option for utility. |
static double |
GLOBAL_C7
Benefit equation constant c7. |
static double |
GLOBAL_C8
Benefit equation constant c8. |
static double |
GLOBAL_COST_CONSTANT
The constant to use for cost when using the constant option for utility. |
static double |
GLOBAL_DENSITY
The density (the minimum frequency needed to be kept) |
static double |
GLOBAL_PARTIAL_MATCH_THRESHOLD
The threshold the support must pass for the condition to be matched. |
static double |
GLOBAL_POSITIVE_MATCH_THRESHOLD
The threshold that must be passed to meet the positive match criterion. |
static AbstractRule.SelectionTypes |
GLOBAL_SELECTION_TYPE
The selection type to use for the selection measure of the rule. |
static double |
GLOBAL_SUPPORT_EPSILON
How close a condition's support must be to the current input in order for it to be considered as matching the current input. |
static AbstractRule.UtilityOptions |
GLOBAL_UTILITY_OPTION
Specifies the method to use for calculating utility. |
static double |
GLOBAL_V
The cost scaling factor. |
protected long |
LastMatch
The time-stamp associated with the last time the rule matched the input. |
protected double |
NM
The negative match counter. |
double |
PARTIAL_MATCH_THRESHOLD
The threshold the support must pass for the condition to be matched. |
protected double |
PM
The positive match counter. |
double |
POSITIVE_MATCH_THRESHOLD
The threshold that must be passed to meet the positive match criterion. |
protected AbstractAction |
rAction
The action chunk of the rule. |
protected GeneralizedConditionChunk |
rCondition
The condition chunk of the rule. |
AbstractRule.SelectionTypes |
SELECTION_TYPE
The selection type to use for the selection measure of the rule. |
double |
SUPPORT_EPSILON
How close a condition's support must be to the current input in order for it to be considered as matching the current input. |
AbstractRule.UtilityOptions |
UTILITY_OPTION
Specifies the method to use for calculating utility. |
double |
V
The cost scaling factor. |
Fields inherited from class clarion.system.AbstractExplicitModule |
---|
ACTUATION_TIME, C, D, DECISION_TIME, GLOBAL_ACTUATION_TIME, GLOBAL_C, GLOBAL_D, GLOBAL_DECISION_TIME, GLOBAL_INITIAL_BLA, GLOBAL_PERCEPTION_TIME, GLOBAL_WEIGHT, INITIAL_BLA, PERCEPTION_TIME, WEIGHT |
Constructor Summary | |
---|---|
AbstractRule(GeneralizedConditionChunk cond,
AbstractAction act)
Initializes a rule with the condition and action chunks specified. |
Method Summary | |
---|---|
boolean |
checkMatchCriterion()
Checks if the condition is matched given the new input. |
boolean |
checkMatchCriterion(long TimeStamp)
Checks if the condition is matched given the new input. |
abstract AbstractRule |
clone()
Copies the rule. |
boolean |
covers(AbstractRule r)
Checks to see if the condition of the specified rule is covered by this rule and that the two rules have the same action. |
boolean |
covers(GeneralizedConditionChunk cond,
AbstractAction act)
Checks to see if the specified condition is covered by this rule and that the specified action is the same as this rule's action. |
boolean |
equals(GeneralizedConditionChunk cond,
AbstractAction act)
Checks to see if the specified condition and action are equal to the condition and action of this rule. |
boolean |
equals(java.lang.Object R)
Checks to see if the specified object is a rule and checks to see if the condition and action of that rule are equal to this rule. |
AbstractAction |
getAction()
Gets the action of the rule. |
java.util.Collection<AbstractRule> |
getChildren()
Gets a collection of the children of this rule. |
GeneralizedConditionChunk |
getCondition()
Gets the condition of the rule. |
double |
getFeedback()
Gets the immediate feedback that was last provided to the rule. |
double |
getNM()
Gets the negative match statistic. |
int |
getNumChildren()
Gets the number of child rules in top level of the child rule tree. |
double |
getPM()
Gets the positive match statistic. |
double |
getSupport(DimensionValueCollection CurrentInput)
Gets the support based on the current input. |
double |
getUtility()
Gets the utility. |
double |
getUtility(double AverageRT)
Gets the utility using the equation option and the specified average response time. |
void |
incrementNM()
Increments the negative match statistic. |
void |
incrementPM()
Increments the positive match statistic. |
void |
initChildren()
Initializes the child rules collection. |
void |
resetChildren()
Resets the child collection. |
void |
resetMatchStatistics()
Resets the match statistics. |
void |
setCurrentInput(DimensionValueCollection input)
Sets the current input to the specified input. |
void |
setFeedback(double feedback)
Sets the immediate feedback for the rule. |
void |
setNM(double nm)
Sets the negative match statistic. |
void |
setPM(double pm)
Sets the positive match statistic. |
java.lang.String |
toString()
|
static void |
turnPartialMatchON()
Sets the partial match threshold to the default value when partial match is turned on. |
void |
updateMatchStatistics(AbstractMatchCalculator MatchCalculator)
Updates the positive or negative match statistics based on the feedback. |
Methods inherited from class clarion.system.AbstractExplicitModule |
---|
addTimeStamp, getBLA, getResponseTime |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface clarion.system.InterfaceTracksTime |
---|
addTimeStamp, getBLA |
Field Detail |
---|
protected GeneralizedConditionChunk rCondition
protected AbstractAction rAction
protected java.util.HashMap<java.lang.Integer,AbstractRule> Children
protected DimensionValueCollection CurrentInput
public static double DEFAULT_PARTIAL_MATCH_OFF
public static double DEAFUALT_PARTIAL_MATCH_ON
public static double GLOBAL_PARTIAL_MATCH_THRESHOLD
public double PARTIAL_MATCH_THRESHOLD
public static double GLOBAL_SUPPORT_EPSILON
public double SUPPORT_EPSILON
public static double GLOBAL_DENSITY
public double DENSITY
public static AbstractRule.UtilityOptions GLOBAL_UTILITY_OPTION
public AbstractRule.UtilityOptions UTILITY_OPTION
public static double GLOBAL_BENEFIT_CONSTANT
public double BENEFIT_CONSTANT
public static double GLOBAL_COST_CONSTANT
public double COST_CONSTANT
public static double GLOBAL_V
public double V
public static double GLOBAL_C7
public static double GLOBAL_C8
public double C7
public double C8
protected double PM
protected double NM
public static double GLOBAL_POSITIVE_MATCH_THRESHOLD
public double POSITIVE_MATCH_THRESHOLD
private double Feedback
public static AbstractRule.SelectionTypes GLOBAL_SELECTION_TYPE
public AbstractRule.SelectionTypes SELECTION_TYPE
protected long LastMatch
Constructor Detail |
---|
public AbstractRule(GeneralizedConditionChunk cond, AbstractAction act) throws java.lang.IllegalArgumentException
cond
- The condition for the new rule.act
- The action for the new rule.
java.lang.IllegalArgumentException
- If the condition or action are null.Method Detail |
---|
public double getUtility()
getUtility
in class AbstractExplicitModule
public double getUtility(double AverageRT)
AverageRT
- The average response time used for calculating the cost.
public double getSupport(DimensionValueCollection CurrentInput)
getSupport
in class AbstractExplicitModule
CurrentInput
- The current input represented as a dimension-value collection.
public GeneralizedConditionChunk getCondition()
public AbstractAction getAction()
public void setCurrentInput(DimensionValueCollection input)
input
- The input to set as the current input.public boolean checkMatchCriterion(long TimeStamp)
checkMatchCriterion
in interface InterfaceHandlesFeedbackWithTime
TimeStamp
- The current time stamp.
public boolean checkMatchCriterion()
checkMatchCriterion
in interface InterfaceHandlesFeedback
public boolean covers(AbstractRule r)
r
- The rule to check against this rule.
public boolean covers(GeneralizedConditionChunk cond, AbstractAction act)
cond
- The condition to check against the condition of this rule.act
- The action to check.
public boolean equals(java.lang.Object R)
equals
in class AbstractExplicitModule
R
- The object to compare to this rule
public boolean equals(GeneralizedConditionChunk cond, AbstractAction act)
cond
- The condition to check.act
- The action to check.
public double getPM()
getPM
in interface InterfaceTracksMatchStatistics
public double getNM()
getNM
in interface InterfaceTracksMatchStatistics
public void setPM(double pm)
setPM
in interface InterfaceTracksMatchStatistics
pm
- The value to set as the positive match statistic.public void setNM(double nm)
setNM
in interface InterfaceTracksMatchStatistics
nm
- The value to set as the negative match statistic.public double getFeedback()
getFeedback
in interface InterfaceHandlesFeedback
public void setFeedback(double feedback)
setFeedback
in interface InterfaceHandlesFeedback
feedback
- The value of the feedback.public void updateMatchStatistics(AbstractMatchCalculator MatchCalculator)
This update is usually performed after the feedback has been set.
updateMatchStatistics
in interface InterfaceTracksMatchStatistics
MatchCalculator
- The match calculator to use to determine positivity.public void resetMatchStatistics()
resetMatchStatistics
in interface InterfaceTracksMatchStatistics
public void incrementPM()
incrementPM
in interface InterfaceTracksMatchStatistics
public void incrementNM()
incrementNM
in interface InterfaceTracksMatchStatistics
public static void turnPartialMatchON()
public int getNumChildren()
public java.util.Collection<AbstractRule> getChildren()
public void initChildren()
public void resetChildren()
public abstract AbstractRule clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |