clarion.system
Class AbstractFixedRule

java.lang.Object
  extended by clarion.system.AbstractExplicitModule
      extended by clarion.system.AbstractRule
          extended by clarion.system.AbstractFixedRule
All Implemented Interfaces:
InterfaceHandlesFeedback, InterfaceHandlesFeedbackWithTime, InterfaceTracksMatchStatistics, InterfaceTracksTime

public abstract class AbstractFixedRule
extends AbstractRule

This class implements a fixed rule within CLARION. It extends the AbstractRule class. This class is abstract and therefore cannot be instantiated on its own. All user defined fixed rules MUST extend this class.

Usage:

Fixed rules are rules within CLARION that are more complex than a simple Condition ---> Action pairing. Some examples of fixed rules include:

Fixed rules must contain an action chunk (although a condition chunk is optional). The values of the dimension-value pairs within an action chunk can be manipulated by the rule (although the structure may not be changed).

All operations performed by the fixed rule (including matching the condition) must be specified within the "getSupport" method. The getSupport method returns a value which is equal to the support for the rule. Fixed rules are no different than any other type of rule in terms of selection. They will compete with the other rules for selection based on their support and utility.

Note also that as an option you can also override the getUtility function. By default the getUtility function for a fixed rule will simply return the DEFAULT_UTILITY constant.

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.

Version:
6.0.4
Author:
Nick Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class clarion.system.AbstractRule
AbstractRule.SelectionTypes, AbstractRule.UtilityOptions
 
Field Summary
 double DEFAULT_UTILITY
          The default utility for the fixed rule.
static double GLOBAL_DEFAULT_UTILITY
          The default utility for the fixed rule.
 
Fields inherited from class clarion.system.AbstractRule
BENEFIT_CONSTANT, C7, C8, Children, COST_CONSTANT, CurrentInput, DEAFUALT_PARTIAL_MATCH_ON, DEFAULT_PARTIAL_MATCH_OFF, DENSITY, GLOBAL_BENEFIT_CONSTANT, GLOBAL_C7, GLOBAL_C8, GLOBAL_COST_CONSTANT, GLOBAL_DENSITY, GLOBAL_PARTIAL_MATCH_THRESHOLD, GLOBAL_POSITIVE_MATCH_THRESHOLD, GLOBAL_SELECTION_TYPE, GLOBAL_SUPPORT_EPSILON, GLOBAL_UTILITY_OPTION, GLOBAL_V, LastMatch, NM, PARTIAL_MATCH_THRESHOLD, PM, POSITIVE_MATCH_THRESHOLD, rAction, rCondition, SELECTION_TYPE, SUPPORT_EPSILON, UTILITY_OPTION, V
 
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
AbstractFixedRule(AbstractAction act)
          Initializes the fixed rule with the specified action.
AbstractFixedRule(GeneralizedConditionChunk cond, AbstractAction act)
          Initializes the fixed rule with the specified condition and action.
 
Method Summary
abstract  boolean covers(java.lang.Object R)
          This method is overridden by the user to handle the comparing of two two rules to see if one covers the other.
abstract  boolean equals(java.lang.Object R)
          This method is overridden by the user to handle condition matching when comparing two rules.
abstract  double getSupport(DimensionValueCollection CurrentInput)
          Performs the user specified operations for the fixed rule.
 double getUtility()
          Gets the utility for this fixed rule.
 
Methods inherited from class clarion.system.AbstractRule
checkMatchCriterion, checkMatchCriterion, clone, covers, covers, equals, getAction, getChildren, getCondition, getFeedback, getNM, getNumChildren, getPM, getUtility, incrementNM, incrementPM, initChildren, resetChildren, resetMatchStatistics, setCurrentInput, setFeedback, setNM, setPM, toString, turnPartialMatchON, updateMatchStatistics
 
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

GLOBAL_DEFAULT_UTILITY

public static double GLOBAL_DEFAULT_UTILITY
The default utility for the fixed rule.


DEFAULT_UTILITY

public double DEFAULT_UTILITY
The default utility for the fixed rule.

Constructor Detail

AbstractFixedRule

public AbstractFixedRule(AbstractAction act)
Initializes the fixed rule with the specified action.

Parameters:
act - The action for the new rule.

AbstractFixedRule

public AbstractFixedRule(GeneralizedConditionChunk cond,
                         AbstractAction act)
Initializes the fixed rule with the specified condition and action. This constructor is used in cases where you want to create a fixed rule with a standard condition chunk.

Parameters:
cond - The condition for the new rule.
act - The action for the new rule.
Method Detail

getSupport

public abstract double getSupport(DimensionValueCollection CurrentInput)
Performs the user specified operations for the fixed rule. This method is written by the user to handle matching of the current input to the rule as well other operations as deemed necessary.

Overrides:
getSupport in class AbstractRule
Parameters:
CurrentInput - The current input.
Returns:
The support for the fixed rule.

getUtility

public double getUtility()
Gets the utility for this fixed rule. By default the utility of a fixed rule is always set to the default utility constant. However the user has the option of defining their own utility function by simply overriding this method.

Overrides:
getUtility in class AbstractRule
Returns:
The utility of the fixed rule.

equals

public abstract boolean equals(java.lang.Object R)
This method is overridden by the user to handle condition matching when comparing two rules. The general rule of thumb is to have this method simply return false.

Overrides:
equals in class AbstractRule
Parameters:
R - The object to compare to this rule.
Returns:
True if the specified object is equal to this rule, otherwise false.

covers

public abstract boolean covers(java.lang.Object R)
This method is overridden by the user to handle the comparing of two two rules to see if one covers the other. The general rule of thumb is to have this method simply return false.

Parameters:
R - the object to compare to this rule.
Returns:
True if this rule covers the specified object, otherwise false.