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
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
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 |
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
ClassifierSystem
public ClassifierSystem(MACS.ClassifierSystem csyst)
- Parameters:
csyst
-
ClassifierSystem
public ClassifierSystem(java.lang.String rulesForm,
java.lang.String initString)
- Parameters:
rulesForm
- initString
-
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