MACS
Class ClassifierSystem

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--MACS.ClassifierList
                          |
                          +--MACS.AnticipatoryClassifierList
                                |
                                +--MACS.ClassifierSystem
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public final class ClassifierSystem
extends AnticipatoryClassifierList

This class is used to represent a list of anticipatory classifiers and contains methods used in LCSs.

Author:
Olivier Sigaud and Pierre Gérard.
See Also:
Serialized Form

Field Summary
protected  java.lang.String actionForm
           
private  MACS.AnticipationLearningManager anticipationLearningManager
           
private  MACS.ConditionCoveringManager conditionCoveringManager
           
static boolean DEBUG
           
private  MACS.GeneralizationManager generalizationManager
           
private  MACS.PerceptionList knownPerceptions
           
 Classifier.BasicClassifier lastActiveClassifier
           
private  MACS.ClassifierSystemLoader loader
           
static boolean localDEBUG
           
private  short nbActions
           
protected  java.lang.String perceptionForm
           
private  MACS.MACSActionSelector perceptionListPointer
           
private  Classifier.Action[] possibleActionsArray
           
private  MACS.SpecializationManager specializationManager
           
private  long time
           
protected static boolean TIME
           
protected static boolean TRACE
           
private  MACS.ClassifierSystemTraceManager traceManager
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ClassifierSystem(MACS.ClassifierSystem csyst)
           
ClassifierSystem(java.lang.String rulesForm, java.lang.String initString)
           
 
Method Summary
 void addNewClassifier(java.lang.String input, java.lang.String action)
           
 double checkForConformityWith(MACS.ClassifierSystem classifierList)
          This method is used to measure the percentage of knowledge
 java.util.Vector computeAnticipatedSituations(Classifier.Perception perception, Classifier.Action action)
          renvoie la liste des anticipations concrètes possibles pour la perception courante et l'action courante.
private  void fillPossibleActionsArray()
           
protected  Classifier.Action getAction(short index)
           
protected  java.lang.String getActionForm()
           
protected  MACS.GeneralizationManager getGeneralizationManager()
           
protected  short getIndexOf(Classifier.Action action)
           
protected  short getNbActions()
           
protected  java.lang.String getPerceptionForm()
           
protected  MACS.PerceptionList getPerceptionList()
           
 Classifier.Action getRandomAction()
           
 java.lang.String getStepInformation()
           
 MACS.ClassifierSystemTraceManager getTraceManager()
           
protected  byte nbActionsCovered(Classifier.Perception situation)
          This method returns the number of actions covered for a given perception by the ClassifierSystem It is used to see if the agent should go again to the situation to improve its model of transitions
protected  void setPerceptionList(MACS.PerceptionList p)
           
protected  void setPerceptionListPointer(MACS.MACSActionSelector ac)
           
 java.lang.String toString()
           
 java.lang.String toString(boolean verboseForClassifiers)
           
protected  void updateModelOfTransitions(Classifier.Transition trans, boolean lastActive)
           
 
Methods inherited from class MACS.AnticipatoryClassifierList
addClassifier, buildAnticipatoryConcernedSets, buildIncompatibleSets, checkForIncompatibilityWith, contains, contains, containsClassifierMatching, containsComparableWith, containsEqualOrLessGeneralThan, containsEqualOrMoreGeneralThan, containsLessGeneralThan, containsMoreGeneralThan, containsWellAnticipatingClassifierMatching, freeMemories, getNbMoreSpecializedThan, getNbWellAnticipatingClassifiers, hasBeenEvaluatedEnoughForGeneralization, hasBeenEvaluatedEnoughForMutspec, selectClassifiersMatching
 
Methods inherited from class MACS.ClassifierList
addClassifier, addClassifiersFrom, contains, containsClassifierMatching, containsClassifierMatching, containsClassifierNotMatching, containsComparableWith, containsEqualOrLessGeneralThan, containsEqualOrMoreGeneralThan, containsLessGeneralThan, containsMoreGeneralThan, getActionString, getClassifier, getIndexOfClassifier, getNbClassifiers, getNbClassifiersMatching, getNbClassifiersMatching, getNbMoreSpecializedThan, getPerceptionString, removeClassifier, removeClassifier, removeClassifiersOf, selectMostSpecializedClassifiers, selectSubSetForAction, setClassifier
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

DEBUG

public static boolean DEBUG

localDEBUG

public static boolean localDEBUG

TIME

protected static final boolean TIME
See Also:
Constant Field Values

TRACE

protected static final boolean TRACE
See Also:
Constant Field Values

perceptionForm

protected java.lang.String perceptionForm

actionForm

protected java.lang.String actionForm

nbActions

private short nbActions

time

private long time

lastActiveClassifier

public Classifier.BasicClassifier lastActiveClassifier

possibleActionsArray

private Classifier.Action[] possibleActionsArray

anticipationLearningManager

private MACS.AnticipationLearningManager anticipationLearningManager

specializationManager

private MACS.SpecializationManager specializationManager

conditionCoveringManager

private MACS.ConditionCoveringManager conditionCoveringManager

generalizationManager

private MACS.GeneralizationManager generalizationManager

loader

private MACS.ClassifierSystemLoader loader

traceManager

private MACS.ClassifierSystemTraceManager traceManager

knownPerceptions

private MACS.PerceptionList knownPerceptions

perceptionListPointer

private MACS.MACSActionSelector perceptionListPointer
Constructor Detail

ClassifierSystem

public ClassifierSystem(MACS.ClassifierSystem csyst)
Parameters:
csyst -

ClassifierSystem

public ClassifierSystem(java.lang.String rulesForm,
                        java.lang.String initString)
Parameters:
rulesForm -
initString -
Method Detail

setPerceptionList

protected void setPerceptionList(MACS.PerceptionList p)
Parameters:
p -

setPerceptionListPointer

protected void setPerceptionListPointer(MACS.MACSActionSelector ac)
Parameters:
ac -

getPerceptionList

protected MACS.PerceptionList getPerceptionList()
Returns:
MACS.PerceptionList

fillPossibleActionsArray

private void fillPossibleActionsArray()

addNewClassifier

public final void addNewClassifier(java.lang.String input,
                                   java.lang.String action)
Parameters:
input -
action -

getNbActions

protected final short getNbActions()
Returns:
short

getAction

protected final Classifier.Action getAction(short index)
Parameters:
index -
Returns:
Classifier.Action

getRandomAction

public final Classifier.Action getRandomAction()
Returns:
Classifier.Action

getIndexOf

protected final short getIndexOf(Classifier.Action action)
Parameters:
action -
Returns:
short

getTraceManager

public final MACS.ClassifierSystemTraceManager getTraceManager()
Returns:
MACS.ClassifierSystemTraceManager

getGeneralizationManager

protected final MACS.GeneralizationManager getGeneralizationManager()
Returns:
MACS.GeneralizationManager

getPerceptionForm

protected final java.lang.String getPerceptionForm()
Returns:
String

getActionForm

protected final java.lang.String getActionForm()
Returns:
String

updateModelOfTransitions

protected final void updateModelOfTransitions(Classifier.Transition trans,
                                              boolean lastActive)
Parameters:
trans -
lastActive -

checkForConformityWith

public final double checkForConformityWith(MACS.ClassifierSystem classifierList)
This method is used to measure the percentage of knowledge

Parameters:
classifierList -
Returns:
double

getStepInformation

public final java.lang.String getStepInformation()
Returns:
String

nbActionsCovered

protected final byte nbActionsCovered(Classifier.Perception situation)
This method returns the number of actions covered for a given perception by the ClassifierSystem It is used to see if the agent should go again to the situation to improve its model of transitions

Parameters:
situation -
Returns:
byte : the number of actions covered

computeAnticipatedSituations

public final java.util.Vector computeAnticipatedSituations(Classifier.Perception perception,
                                                           Classifier.Action action)
renvoie la liste des anticipations concrètes possibles pour la perception courante et l'action courante. Vector est un vecteur de triplets : [0] anticipations (Perceptions) [1] réels (informations) [2] booleen(reliabilities)

Parameters:
perception -
action -
Returns:
java.util.Vector

toString

public final java.lang.String toString(boolean verboseForClassifiers)
Overrides:
toString in class ClassifierList
Parameters:
verboseForClassifiers -
Returns:
String

toString

public final java.lang.String toString()
Overrides:
toString in class ClassifierList
Returns:
String