clarion.system
Class RefineableRule

java.lang.Object
  extended by clarion.system.AbstractExplicitModule
      extended by clarion.system.AbstractRule
          extended by clarion.system.RefineableRule
All Implemented Interfaces:
InterfaceDeleteable, InterfaceHandlesFeedback, InterfaceHandlesFeedbackWithTime, InterfaceTracksMatchStatistics, InterfaceTracksTime
Direct Known Subclasses:
AbstractIRLRule

public class RefineableRule
extends AbstractRule
implements InterfaceDeleteable

This class implements a refineable rule within CLARION. It extends the AbstractRule class and implements the InterfaceDeleteable interface.

Usage:

A refineable rule is a rule within the ACS that can be specialized, generalize, and deleted automatically within CLARION. This is the base class for any rule type that can be refined. It is also the class that is generated when RER rules are extracted from the bottom level. The primary difference between a refineable rule and other rules is that refineable rules keep track or hidden minor rule variations that are the central components for enabling generalization and specialization.

Known Subclasses:

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
private  int hash
          The hash for this object.
protected  AbstractRule MatchAll
          The Match all rule related to the action chunk of the rule.
protected  java.util.HashMap<java.lang.Integer,AbstractRule> Variations
          The rule variations (hidden rules that contain + or - one activated dimension-value pair in the condition of the 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
RefineableRule(GeneralizedConditionChunk Cond, AbstractAction Act)
          Initializes a refineable rule with the condition and action specified.
 
Method Summary
 boolean checkDeletionByDensity(long TimeStamp)
          Checks to see if deletion should occur based on the density parameter.
 RefineableRule clone()
          Clones the rule.
 AbstractRule getMatchAll()
          Gets the match all rule related to this rule.
 AbstractRule getMaxVariationMinusOne(RuleRefiner r)
          Gets the rule variation (containing 1 less activated dimension-value pair) with the maximum information gain compared to this rule.
 AbstractRule getMaxVariationPlusOne(RuleRefiner r)
          Gets the rule variation (containing 1 additional activated dimension-value pair) with the maximum information gain compared to this rule.
 int getNumVariations()
          Gets the number of rule variations this rule has.
 java.util.Map<java.lang.Integer,AbstractRule> getVariations()
          Gets a collection of the variations of this rule.
 int hashCode()
           
 void initVariations()
          Initializes the rule variations collection.
 void resetVariations()
          Resets the rule variations collection.
 void setMatchAll(AbstractRule MA)
          Sets the match all rule related to this rule.
 
Methods inherited from class clarion.system.AbstractRule
checkMatchCriterion, checkMatchCriterion, covers, covers, equals, equals, getAction, getChildren, getCondition, getFeedback, getNM, getNumChildren, getPM, getSupport, getUtility, 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, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface clarion.system.InterfaceTracksTime
addTimeStamp, getBLA
 

Field Detail

hash

private int hash
The hash for this object. When this item is cloned, so is this hash.


MatchAll

protected AbstractRule MatchAll
The Match all rule related to the action chunk of the rule. This rule is considered to be a hidden rule. It is used specifically for rule refinement.


Variations

protected java.util.HashMap<java.lang.Integer,AbstractRule> Variations
The rule variations (hidden rules that contain + or - one activated dimension-value pair in the condition of the rule). The rule variations are used specifically for rule refinement.

Constructor Detail

RefineableRule

public RefineableRule(GeneralizedConditionChunk Cond,
                      AbstractAction Act)
Initializes a refineable rule with the condition and action specified.

Parameters:
Cond - The condition for the rule.
Act - The action for the rule.
Method Detail

getNumVariations

public int getNumVariations()
Gets the number of rule variations this rule has.

Returns:
The number of rule variations.

getVariations

public java.util.Map<java.lang.Integer,AbstractRule> getVariations()
Gets a collection of the variations of this rule.

Returns:
A collection the variations of this rule.

initVariations

public void initVariations()
Initializes the rule variations collection.


resetVariations

public void resetVariations()
Resets the rule variations collection.


getMaxVariationPlusOne

public AbstractRule getMaxVariationPlusOne(RuleRefiner r)
Gets the rule variation (containing 1 additional activated dimension-value pair) with the maximum information gain compared to this rule.

Parameters:
r - The rule refine to use for calculating the information gain.
Returns:
The rule variation with the maximum information gain.

getMaxVariationMinusOne

public AbstractRule getMaxVariationMinusOne(RuleRefiner r)
Gets the rule variation (containing 1 less activated dimension-value pair) with the maximum information gain compared to this rule.

Parameters:
r - The rule refine to use for calculating the information gain.
Returns:
The rule variation with the maximum information gain.

getMatchAll

public AbstractRule getMatchAll()
Gets the match all rule related to this rule.

Returns:
The match all rule.

setMatchAll

public void setMatchAll(AbstractRule MA)
Sets the match all rule related to this rule.

Parameters:
MA - The match all rule.

checkDeletionByDensity

public boolean checkDeletionByDensity(long TimeStamp)
Checks to see if deletion should occur based on the density parameter.

Specified by:
checkDeletionByDensity in interface InterfaceDeleteable
Parameters:
TimeStamp - The current time stamp.
Returns:
True if deletion should occur based on density, otherwise false.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public RefineableRule clone()
Clones the rule.

Specified by:
clone in class AbstractRule
Returns:
A copy of the rule.