MACS
Class GeneralizationManager

java.lang.Object
  |
  +--MACS.GeneralizationManager

final class GeneralizationManager
extends java.lang.Object

The GeneralizationManager class is in charge of generalizing classifiers in the model of transitions. The only method called from outside is run(). The process can be described into for main stages: - First, the system builds Set A of classifiers matching the last action and the current perception. - Second, if all the classifiers in Set A anticipate correctly and have been evaluated enough, the system builds a Set B of general classifiers from the Set A. This is done in the "buildGeneralClassifierList" method. - Third, the system builds from each set B a Set C of classifiers... see the papers! - Fourth, the system builds from each set C a Set D of classifiers... see the papers! Note that if we had implemented MACS as building one module per attribute, this component would be far more efficient.

Author:
Olivier Sigaud and Pierre Gérard.

Field Summary
private  MACS.ClassifierSystem classifierSystem
           
static boolean DEBUG
           
private  MACS.AnticipatoryClassifierList genClassifiers
           
private  MACS.AnticipatoryClassifierList specClassifiers
           
 
Constructor Summary
protected GeneralizationManager(MACS.ClassifierSystem cs)
           
 
Method Summary
private  MACS.AnticipatoryClassifierList buildGeneralClassifierList(MACS.AnticipatoryClassifierList concernedClassifierList)
           
private  boolean chooseBetweenGeneralAndInitial(MACS.AnticipatoryClassifierList general, MACS.AnticipatoryClassifierList initial, MACS.AnticipatoryClassifierList incompatible)
           
private  void generalizeClassifiers(MACS.AnticipatoryClassifierList concernedClassifierList, MACS.AnticipatoryClassifierList incompatibleClassifierList)
          First, the system builds Set B of general classifiers from set A If some improvement results, then the improvements are optimized and the model of transition is updated
private  MACS.PerceptionList getPerceptionList()
          Returns the list of already seen perceptions
private  boolean moreGeneralThan(Classifier.AnticipatoryClassifier classifier1, Classifier.AnticipatoryClassifier classifier2)
           
private  boolean optimizeClassifierList(MACS.AnticipatoryClassifierList cs)
           
protected  void run(Classifier.Perception lastPerception, Classifier.Action lastAction, Classifier.Perception currentPerception)
          First, the system builds Set A of classifiers matching the last action and the current perception.
private  void updateClassifierSystem(MACS.AnticipatoryClassifierList concernedSet, MACS.AnticipatoryClassifierList newSet)
          From note 1, it seems that ClassifierSystem can contain several times the same classifier
private  void updateReliabilities(Classifier.Perception lastPerception, Classifier.Action lastAction, Classifier.Perception currentPerception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

classifierSystem

private MACS.ClassifierSystem classifierSystem

specClassifiers

private MACS.AnticipatoryClassifierList specClassifiers

genClassifiers

private MACS.AnticipatoryClassifierList genClassifiers
Constructor Detail

GeneralizationManager

protected GeneralizationManager(MACS.ClassifierSystem cs)
Parameters:
cs -
Method Detail

getPerceptionList

private MACS.PerceptionList getPerceptionList()
Returns the list of already seen perceptions

Returns:
MACS.PerceptionList

chooseBetweenGeneralAndInitial

private boolean chooseBetweenGeneralAndInitial(MACS.AnticipatoryClassifierList general,
                                               MACS.AnticipatoryClassifierList initial,
                                               MACS.AnticipatoryClassifierList incompatible)
Parameters:
general -
initial -
incompatible -
Returns:
boolean

moreGeneralThan

private boolean moreGeneralThan(Classifier.AnticipatoryClassifier classifier1,
                                Classifier.AnticipatoryClassifier classifier2)
Parameters:
classifier1 -
classifier2 -
Returns:
boolean

optimizeClassifierList

private boolean optimizeClassifierList(MACS.AnticipatoryClassifierList cs)
Parameters:
cs -
Returns:
boolean

buildGeneralClassifierList

private MACS.AnticipatoryClassifierList buildGeneralClassifierList(MACS.AnticipatoryClassifierList concernedClassifierList)
Parameters:
concernedClassifierList -
Returns:
MACS.AnticipatoryClassifierList

updateClassifierSystem

private void updateClassifierSystem(MACS.AnticipatoryClassifierList concernedSet,
                                    MACS.AnticipatoryClassifierList newSet)
From note 1, it seems that ClassifierSystem can contain several times the same classifier

Parameters:
concernedSet -
newSet -

updateReliabilities

private final void updateReliabilities(Classifier.Perception lastPerception,
                                       Classifier.Action lastAction,
                                       Classifier.Perception currentPerception)
Parameters:
lastPerception -
lastAction -
currentPerception -

generalizeClassifiers

private final void generalizeClassifiers(MACS.AnticipatoryClassifierList concernedClassifierList,
                                         MACS.AnticipatoryClassifierList incompatibleClassifierList)
First, the system builds Set B of general classifiers from set A If some improvement results, then the improvements are optimized and the model of transition is updated

Parameters:
concernedClassifierList -
incompatibleClassifierList -

run

protected final void run(Classifier.Perception lastPerception,
                         Classifier.Action lastAction,
                         Classifier.Perception currentPerception)
First, the system builds Set A of classifiers matching the last action and the current perception. If all the classifiers in Set A anticipate correctly and have been evaluated enough, then this set of classifier can be generalized

Parameters:
lastPerception -
lastAction -
currentPerception -