clarion.common
Class RuleAttributes

java.lang.Object
  extended byclarion.common.RuleAttributes

public class RuleAttributes
extends java.lang.Object


Field Summary
protected  boolean acsRuleFlag
          ACS rule or NACS rule.
protected  int actionTime
          RT variables.
protected  int age
          age from last application of this rule.
protected  int assocAppTime
          associative application time.
protected  double BLA
          the parameters for BLA.
protected  int blaOption
          base-level activation option: constant or variable.
protected  double c
          the parameters for BLA.
protected  double chunkBLA
          parameters for chunk retrieval time.
protected  double d
          the parameters for BLA.
protected  Global global
          global settings.
protected  double iBLA
          the parameters for BLA.
protected  int MAX_USAGE_NUM
          maxmal number of usage.
protected  int netIdx
          the net index.
protected  double NM
          parameters for utility.
protected  double PM
          parameters for utility.
protected  int ruleSet
          the rule set the rule belongs to.
protected  int ruleType
          the rule type.
protected  double t0
          parameters for chunk retrieval time.
protected  double t1
          parameters for chunk retrieval time.
protected  TaskClarion taskClarion
          task-specific clarion settings.
protected  int TLDT
          RT variables.
protected  int TLPT
          RT variables.
protected  int TLRT
          RT variables.
protected  int[] usages
          the variables for calculating the BLA.
protected  int usedNum
          the variables for calculating the BLA.
protected  double utility
          parameters for utility.
protected  int utlOption
          utility option.
 
Constructor Summary
RuleAttributes(Global global)
          constructor.
RuleAttributes(int netIdx, int ruleType, int ruleSet, Global global)
          constructor.
 
Method Summary
 void calcAssocRuleAppTime()
          calculate the associative rule application time for one iteration.
 void calcBLA(int curTime)
          calcluate the BLA.
 void calcTLAT(boolean flag, int chunkRetrTime)
          calculate the TL Decision Time given chunk BLA.
 void calcTLDT(double chunkBLA)
          calculate the TL Decision Time given chunk BLA.
 void calcTLRT(int TL_AT)
          calculate the response time given the top-level actuation time.
 void calcUtility(double cost)
          calcluate the utility.
 java.lang.Object clone()
          methods from class Object
 void discountMatches(double discount)
          discount the matches using the given discount value.
 int getAge()
          returns age from last application of this rule.
 int getAssocRuleAppTime()
          returns associative rule application time.
 double getBLA()
          returns the BLA of this rule.
 double getNM()
          returns number of negative matches of this rule.
 double getPM()
          returns number of positive matches of this rule.
 int getResponseTime()
          returns current response time.
 double getUtility()
          returns the utility of this rule.
 void reinit()
          reinitalization routine.
 void resetMatches()
          reset the matches.
 void setAge(int age)
          set age of this rule.
 void setChunkBLA(double val)
          set chunk BLA.
 void setNM(double NM)
          set negative matches.
 void setPM(double PM)
          set positive matches.
 void setUsages(int[] arr)
          set info of usages of this rule.
 void setUsedNum(int usedNum)
          set number of usages of this rule.
 void updateAge()
          update the age.
 void updateMatches(boolean flag)
          update the matches.
 void updateMatches(int matchType)
          update the matches.
 void updateUsages(int curTime)
          update the usage info.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

global

protected Global global
global settings.


taskClarion

protected TaskClarion taskClarion
task-specific clarion settings.


acsRuleFlag

protected boolean acsRuleFlag
ACS rule or NACS rule.


netIdx

protected int netIdx
the net index.


ruleType

protected int ruleType
the rule type.


ruleSet

protected int ruleSet
the rule set the rule belongs to.


age

protected int age
age from last application of this rule.


TLRT

protected int TLRT
RT variables.


TLPT

protected int TLPT
RT variables.


TLDT

protected int TLDT
RT variables.


actionTime

protected int actionTime
RT variables.


assocAppTime

protected int assocAppTime
associative application time.


t0

protected double t0
parameters for chunk retrieval time.


t1

protected double t1
parameters for chunk retrieval time.


chunkBLA

protected double chunkBLA
parameters for chunk retrieval time.


blaOption

protected int blaOption
base-level activation option: constant or variable.


MAX_USAGE_NUM

protected int MAX_USAGE_NUM
maxmal number of usage.


usedNum

protected int usedNum
the variables for calculating the BLA.


usages

protected int[] usages
the variables for calculating the BLA.


BLA

protected double BLA
the parameters for BLA.


c

protected double c
the parameters for BLA.


d

protected double d
the parameters for BLA.


iBLA

protected double iBLA
the parameters for BLA.


utlOption

protected int utlOption
utility option.


utility

protected double utility
parameters for utility.


PM

protected double PM
parameters for utility.


NM

protected double NM
parameters for utility.

Constructor Detail

RuleAttributes

public RuleAttributes(Global global)
constructor. used for NACS rules.

Parameters:
global - the associated global settings.

RuleAttributes

public RuleAttributes(int netIdx,
                      int ruleType,
                      int ruleSet,
                      Global global)
constructor. used for ACS rules.

Parameters:
netIdx - the network index this rule belongs to.
ruleType - rule type.
ruleSet - rule set this rule belongs to.
global - the associated global settings.
Method Detail

reinit

public void reinit()
reinitalization routine.


getAge

public int getAge()
returns age from last application of this rule.

Returns:
age of the rule.

getPM

public double getPM()
returns number of positive matches of this rule.

Returns:
number of positive matches.

getNM

public double getNM()
returns number of negative matches of this rule.

Returns:
number of negative matches.

getUtility

public double getUtility()
returns the utility of this rule.

Returns:
the utility.

getBLA

public double getBLA()
returns the BLA of this rule.

Returns:
the BLA.

getResponseTime

public int getResponseTime()
returns current response time.

Returns:
current response time.

getAssocRuleAppTime

public int getAssocRuleAppTime()
returns associative rule application time.

Returns:
associative rule application time.

setAge

public void setAge(int age)
set age of this rule.

Parameters:
age - the value to set.

setPM

public void setPM(double PM)
set positive matches.

Parameters:
PM - the value to set.

setNM

public void setNM(double NM)
set negative matches.


setUsedNum

public void setUsedNum(int usedNum)
set number of usages of this rule.

Parameters:
usedNum - the value to set.

setUsages

public void setUsages(int[] arr)
set info of usages of this rule.

Parameters:
arr - the value to set.

setChunkBLA

public void setChunkBLA(double val)
set chunk BLA.

Parameters:
val - the value to set.

resetMatches

public void resetMatches()
reset the matches.


discountMatches

public void discountMatches(double discount)
discount the matches using the given discount value.


calcTLRT

public void calcTLRT(int TL_AT)
calculate the response time given the top-level actuation time.

Parameters:
TL_AT - the top-level acuation time.

calcTLDT

public void calcTLDT(double chunkBLA)
calculate the TL Decision Time given chunk BLA.

Parameters:
chunkBLA - the relevant chunk BLA.

calcTLAT

public void calcTLAT(boolean flag,
                     int chunkRetrTime)
calculate the TL Decision Time given chunk BLA.

Parameters:
flag - the flag indicates involving NACS or not.
chunkRetrTime - the relevant chunk retrieval time.

calcAssocRuleAppTime

public void calcAssocRuleAppTime()
calculate the associative rule application time for one iteration. needs user definition.


calcUtility

public void calcUtility(double cost)
calcluate the utility.

Parameters:
cost - the cost of using this rule.

calcBLA

public void calcBLA(int curTime)
calcluate the BLA.

Parameters:
curTime - current time.

updateAge

public void updateAge()
update the age.


updateMatches

public void updateMatches(boolean flag)
update the matches.

Parameters:
flag - indicates positive or negative matches.

updateMatches

public void updateMatches(int matchType)
update the matches.

Parameters:
matchType - indicates positive or negative matches.

updateUsages

public void updateUsages(int curTime)
update the usage info.

Parameters:
curTime - current time when this rule is applied.

clone

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