MACS
Class AnticipatoryClassifierList

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

public class AnticipatoryClassifierList
extends ClassifierList

This class is intended to store a list of AnticipatoryClassifier. It is extended by ClassifierSystem. It defines a lot of useful low level functionalities.

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

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AnticipatoryClassifierList()
           
AnticipatoryClassifierList(MACS.AnticipatoryClassifierList cset)
          copy constructor
 
Method Summary
protected  void addClassifier(Classifier.AnticipatoryClassifier cl)
           
private static MACS.AnticipationList buildAnticipationList(java.util.Vector concernedSets)
          --------------------------------------------------------------------------------
protected  java.util.Vector buildAnticipatoryConcernedSets(Classifier.Action lastAction, Classifier.Perception currentPerception)
          -------------------------------------------------------------------------------- -------
protected  java.util.Vector buildIncompatibleSets(java.util.Vector concernedSets, Classifier.Action lastAction)
          Creates sets of classifiers with the correct action, that do not match the anticipation set, sorted by perception
protected  Classifier.Perception checkForIncompatibilityWith(Classifier.AnticipatoryClassifier classifier)
           
 boolean contains(Classifier.AnticipatoryClassifier newClassifier)
           
protected  boolean contains(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsClassifierMatching(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsComparableWith(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsEqualOrLessGeneralThan(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsEqualOrMoreGeneralThan(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsLessGeneralThan(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsMoreGeneralThan(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
protected  boolean containsWellAnticipatingClassifierMatching(Classifier.Perception situation)
           
 void freeMemories()
           
protected  short getNbMoreSpecializedThan(Classifier.AnticipatoryClassifier newClassifier, boolean watchForAnticipation)
           
 int getNbWellAnticipatingClassifiers()
           
protected  boolean hasBeenEvaluatedEnoughForGeneralization()
           
protected  boolean hasBeenEvaluatedEnoughForMutspec()
           
protected  MACS.AnticipatoryClassifierList selectClassifiersMatching(Classifier.Perception perception, Classifier.Action act)
           
 
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, toString, toString
 
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
 

Constructor Detail

AnticipatoryClassifierList

public AnticipatoryClassifierList(MACS.AnticipatoryClassifierList cset)
copy constructor

Parameters:
cset -

AnticipatoryClassifierList

public AnticipatoryClassifierList()
Method Detail

addClassifier

protected final void addClassifier(Classifier.AnticipatoryClassifier cl)
Parameters:
cl -

freeMemories

public final void freeMemories()

getNbWellAnticipatingClassifiers

public int getNbWellAnticipatingClassifiers()
Returns:
int

hasBeenEvaluatedEnoughForMutspec

protected final boolean hasBeenEvaluatedEnoughForMutspec()
Returns:
boolean

hasBeenEvaluatedEnoughForGeneralization

protected final boolean hasBeenEvaluatedEnoughForGeneralization()
Returns:
boolean

contains

protected final boolean contains(Classifier.AnticipatoryClassifier newClassifier,
                                 boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

contains

public final boolean contains(Classifier.AnticipatoryClassifier newClassifier)
Parameters:
newClassifier -
Returns:
boolean

containsClassifierMatching

protected final boolean containsClassifierMatching(Classifier.AnticipatoryClassifier newClassifier,
                                                   boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

containsWellAnticipatingClassifierMatching

protected final boolean containsWellAnticipatingClassifierMatching(Classifier.Perception situation)
Parameters:
situation -
Returns:
boolean

containsLessGeneralThan

protected final boolean containsLessGeneralThan(Classifier.AnticipatoryClassifier newClassifier,
                                                boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

containsMoreGeneralThan

protected final boolean containsMoreGeneralThan(Classifier.AnticipatoryClassifier newClassifier,
                                                boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

checkForIncompatibilityWith

protected final Classifier.Perception checkForIncompatibilityWith(Classifier.AnticipatoryClassifier classifier)
Parameters:
classifier -
Returns:
Classifier.Perception

getNbMoreSpecializedThan

protected final short getNbMoreSpecializedThan(Classifier.AnticipatoryClassifier newClassifier,
                                               boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
short

containsEqualOrLessGeneralThan

protected final boolean containsEqualOrLessGeneralThan(Classifier.AnticipatoryClassifier newClassifier,
                                                       boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

containsEqualOrMoreGeneralThan

protected final boolean containsEqualOrMoreGeneralThan(Classifier.AnticipatoryClassifier newClassifier,
                                                       boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

containsComparableWith

protected final boolean containsComparableWith(Classifier.AnticipatoryClassifier newClassifier,
                                               boolean watchForAnticipation)
Parameters:
newClassifier -
watchForAnticipation -
Returns:
boolean

selectClassifiersMatching

protected MACS.AnticipatoryClassifierList selectClassifiersMatching(Classifier.Perception perception,
                                                                    Classifier.Action act)
Parameters:
perception -
act -
Returns:
AnticipatoryClassifierList

buildAnticipationList

private static MACS.AnticipationList buildAnticipationList(java.util.Vector concernedSets)
--------------------------------------------------------------------------------

Parameters:
concernedSets -
Returns:
MACS.AnticipationList

buildIncompatibleSets

protected final java.util.Vector buildIncompatibleSets(java.util.Vector concernedSets,
                                                       Classifier.Action lastAction)
Creates sets of classifiers with the correct action, that do not match the anticipation set, sorted by perception

Parameters:
concernedSets -
lastAction -
Returns:
java.util.Vector

buildAnticipatoryConcernedSets

protected final java.util.Vector buildAnticipatoryConcernedSets(Classifier.Action lastAction,
                                                                Classifier.Perception currentPerception)
-------------------------------------------------------------------------------- -------

Parameters:
lastAction -
currentPerception -
Returns:
java.util.Vector