|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectsimuLCS.Classifier
A Classifier is a rule: if CONDITION then ACTION.
| Field Summary | |
static int |
ACT_ALL
|
static int |
ACT_EXACT
|
protected java.lang.String |
action
|
static int |
COND_ALL
|
static int |
COND_EXACT
|
static int |
COND_MATCH
|
protected java.lang.String |
condition
|
protected java.lang.String |
name
|
static int |
PART_ACTION
|
static int |
PART_CONDITION
|
| Constructor Summary | |
Classifier()
|
|
Classifier(java.lang.String c,
java.lang.String a)
Creates a Classifier with the given condition and action. |
|
Classifier(java.lang.String c,
java.lang.String a,
java.lang.String n)
|
|
| Method Summary | |
static int |
createSharedClassifier(Classifier c,
Agent[] ag)
Create a unique instance of a classifier shared by several Agents so that the user has to modify only this classifier to affect the behaviour of all the Agents |
static Classifier |
fromString(java.lang.String s,
Template t)
Returns a Classifier object from a string "XXX->YYYY [cccc]" where X,Y = {0,1,#} XXX is the condition part, YYYY is the action part cccc is the name to put between square brackets (optional) |
java.lang.String |
getAction()
|
java.lang.String |
getBits(int position,
int length,
int whichpart)
Get the bits from position position to position + length
for the either the Condition or the Action, depending on whichpart |
static java.lang.String |
getBits(java.lang.String s)
If a String contains only 0s and 1s, returns that string. |
java.lang.String |
getBitsAction(int position,
int length)
|
java.lang.String |
getBitsCondition(int position,
int length)
|
java.lang.String |
getCondition()
|
java.lang.String |
getName()
|
double |
getValue()
Gives the "value" of this classifier to be plotted. |
boolean |
match(Classifier c,
int CondMatch,
int ActMatch)
Returns true if the classifier satisfies the properties described by CondMatch and ActMatch |
boolean |
match(java.lang.String state)
Returns true if the classifier matches in the current situation. |
static int |
removeSharedClassifier(Classifier c,
Agent[] ag)
|
void |
setAction(java.lang.String string)
|
void |
setBits(java.lang.String s,
int position,
int whichpart)
|
void |
setBitsAction(java.lang.String s,
int position)
|
void |
setBitsCondition(java.lang.String s,
int position)
|
void |
setCondition(java.lang.String string)
|
void |
setName(java.lang.String string)
|
java.lang.String |
toString()
Returns a string representing the classifier (ie. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int PART_CONDITION
public static final int PART_ACTION
protected java.lang.String condition
protected java.lang.String action
protected java.lang.String name
public static final int COND_ALL
public static final int COND_MATCH
public static final int COND_EXACT
public static final int ACT_ALL
public static final int ACT_EXACT
| Constructor Detail |
public Classifier()
public Classifier(java.lang.String c,
java.lang.String a)
c - a -
public Classifier(java.lang.String c,
java.lang.String a,
java.lang.String n)
| Method Detail |
public static int createSharedClassifier(Classifier c,
Agent[] ag)
c - ag -
public static int removeSharedClassifier(Classifier c,
Agent[] ag)
public static Classifier fromString(java.lang.String s,
Template t)
s - the String describing the classifiert - the Template which describes the number of bits for cond/action
public static java.lang.String getBits(java.lang.String s)
s -
Config.PROBLEMpublic java.lang.String getAction()
public java.lang.String getBitsAction(int position,
int length)
public java.lang.String getCondition()
public java.lang.String getBitsCondition(int position,
int length)
public java.lang.String getBits(int position,
int length,
int whichpart)
position to position + length
for the either the Condition or the Action, depending on whichpart
position - length - whichpart - @see Classifier#PART_ACTION @see Classifier#PART_CONDITION
public void setAction(java.lang.String string)
public void setCondition(java.lang.String string)
public void setBitsAction(java.lang.String s,
int position)
public void setBitsCondition(java.lang.String s,
int position)
public void setBits(java.lang.String s,
int position,
int whichpart)
public java.lang.String toString()
public java.lang.String getName()
public void setName(java.lang.String string)
public boolean match(java.lang.String state)
state - The current situation which is the description of an external
agent by a bit of strings.
public boolean match(Classifier c,
int CondMatch,
int ActMatch)
CondMatch and ActMatch
c - CondMatch - ActMatch -
public double getValue()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||