clarion.nacs
Class AssocRule

java.lang.Object
  extended byclarion.nacs.AssocRule
All Implemented Interfaces:
java.lang.Cloneable, CloneableListElement

public class AssocRule
extends java.lang.Object
implements CloneableListElement


Constructor Summary
AssocRule(short[] con, short conc, Global global)
          constructor.
 
Method Summary
 int calcAssocRuleAppTime()
          Compute the rule application time.
 double calcBLA(long currentTime)
          Compute rule BLA.
 void calculateSupport(java.util.Vector con, double[] weights)
          Computes the rule support.
 java.lang.Object clone()
          methods from class Object
 boolean equals(java.lang.Object other)
          methods from class Object
 int getAge()
          Return the age of the rule.
 double getBLA()
          Returns the rule BLA.
 int getConclusion()
          Returns the conclusion in terms of chunk index.
 short[] getCondition()
          Returns the condition in terms of chunk indices on the chunk list in GKS.
 void getCondition(short[] con)
          Returns the condition in terms of chunk indices on the chunk list in GKS.
 int getConditionNum()
          Returns the number of chunks in the condition.
 double getSupport()
          Return the rule support.
 int hashCode()
          methods from class Object
 void increaseAge()
          increase the rule age.
 void increaseUsage(long currentTime)
          update the rule usage.
 boolean isCondition(short[] cond)
          Check if the specific condition is the rule condition or not.
 boolean isInCondition(int cond)
          Check if the specific chunk is in the rule condition or not.
 void resetAge()
           
 void setConclusion(short conc)
          Sets the rule conclusion in terms of chunk index.
 void setCondition(short[] con)
          Sets the rule condition in terms of chunk indices.
 void setReasoningMethod(int method)
          Sets GKS reasoning method.
 java.lang.String toString()
          methods from class Object
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssocRule

public AssocRule(short[] con,
                 short conc,
                 Global global)
constructor.

Parameters:
con - the rule condition in terms of chunk indices on the chunk list in GKS.
conc - the rule conclusion in terms of chunk index on the chunk list in GKS.
global - the associated global settings.
Method Detail

isInCondition

public boolean isInCondition(int cond)
Check if the specific chunk is in the rule condition or not.

Parameters:
cond - the specific chunk.
Returns:
true if it is in the rule condition, false otherwise.

isCondition

public boolean isCondition(short[] cond)
Check if the specific condition is the rule condition or not.

Returns:
true if it is the rule condition, false otherwise.

getAge

public int getAge()
Return the age of the rule.

Returns:
the age of the rule.

getConclusion

public int getConclusion()
Returns the conclusion in terms of chunk index.

Returns:
the conclusion.

getConditionNum

public int getConditionNum()
Returns the number of chunks in the condition.

Returns:
the number of chunks in the condition.

getCondition

public short[] getCondition()
Returns the condition in terms of chunk indices on the chunk list in GKS.

Returns:
the condition.

getCondition

public void getCondition(short[] con)
Returns the condition in terms of chunk indices on the chunk list in GKS.

Parameters:
con - the array to store the rule condition.

getBLA

public double getBLA()
Returns the rule BLA.

Returns:
the rule BLA.

getSupport

public double getSupport()
Return the rule support.

Returns:
the rule support.

resetAge

public void resetAge()

increaseAge

public void increaseAge()
increase the rule age.


setReasoningMethod

public void setReasoningMethod(int method)
Sets GKS reasoning method.

Parameters:
method - the reasoning method to set.

setConclusion

public void setConclusion(short conc)
Sets the rule conclusion in terms of chunk index.


setCondition

public void setCondition(short[] con)
Sets the rule condition in terms of chunk indices.


calculateSupport

public void calculateSupport(java.util.Vector con,
                             double[] weights)
Computes the rule support.

Parameters:
con - a vector of chunks used to compare the condition to compute the rule support.
weights - the weights of subcondition for computing the rule support.

increaseUsage

public void increaseUsage(long currentTime)
update the rule usage.

Parameters:
currentTime - current time when this rule is used.

calcBLA

public double calcBLA(long currentTime)
Compute rule BLA.

Parameters:
currentTime - current time.

calcAssocRuleAppTime

public int calcAssocRuleAppTime()
Compute the rule application time.


toString

public java.lang.String toString()
methods from class Object


hashCode

public int hashCode()
methods from class Object


equals

public boolean equals(java.lang.Object other)
methods from class Object


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
methods from class Object

Specified by:
clone in interface CloneableListElement
Throws:
java.lang.CloneNotSupportedException