MACS
Class Integrator

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

class Integrator
extends java.lang.Object

The Integrator class is in charge of merging the partial anticipations of a list of classifiers so as to predict the situations that the agent may reach at the next time step. This list of anticipated situations is used by the ActionSelector to compute the value of each possible next action. The only method called from outside is "buildAnticipatedSituations" For a given action in a given situation, it receives a list of effectparts, the evaluation level of the classifier containing this effect part, and the list of perceptions already seen in the environment. From that, it computes the list of possible perceptions matching with the effects parts. The algorithm is as follows: From the list of anticipations (e.g. [[?|?|?|0|?|?|?|?], [?|?|?|?|?|?|?|1], [?|?|?|?|?|?|?|0]) it computes for each attribute what are the possible values anticipated. Then it filters the list of perceptions already seen in the environment: For each of these perceptions, and for each attribute, if the value of this attribute in this perception is not possible, then discard it. Note that, though MACS only predicts one attribute per classifier (e.g. [?|?|?|?|?|?|?|0]), the process will also work properly with classifiers predicting several attributes (e.g. [?|1|?|?|0|?|?|0]). This has not been checked, but I'm confident about it! (Olivier Sigaud, 20/08/03)

Author:
Olivier Sigaud and Pierre Gérard.

Field Summary
static boolean DEBUG
           
static boolean localDEBUG
           
 
Constructor Summary
(package private) Integrator()
           
 
Method Summary
static java.util.Vector buildAnticipatedSituations(java.util.Vector effectparts, java.util.Vector infoGains, MACS.PerceptionList perceptionList)
          Main method: computes the list of anticipated situations (see the class comment)
private static java.util.Vector buildFilteredPerceptionList(MACS.PossibleTokenMap[] tokPossibilities, MACS.PerceptionList referenceSet)
          private static Vector sort(Vector v) { TreeSet retour = new TreeSet(v); Vector w = new Vector(retour); return w; }
private static MACS.PossibleTokenMap[] buildTokPossibilitiesAndTokInformation(java.util.Vector effectparts, java.util.Vector infoGains)
          This method builds the structure containing each possible value for each token The key is a token, the value is the information gain
private static double isCompatibleWith(Classifier.Perception p, MACS.PossibleTokenMap[] tokPossibilities)
          This method checks whether a perception from the list of perceptions already seen in the environment is compatible with the list of tokens just created, i.e. if it can be anticipated from the model of transitions
private static double isPossible(Classifier.Token t, MACS.PossibleTokenMap tokPossibilities)
          This method checks whether a given attribute is compatible in the list of tokens just created
static void main(java.lang.String[] args)
           
 
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

localDEBUG

public static boolean localDEBUG
Constructor Detail

Integrator

Integrator()
Method Detail

buildTokPossibilitiesAndTokInformation

private static MACS.PossibleTokenMap[] buildTokPossibilitiesAndTokInformation(java.util.Vector effectparts,
                                                                              java.util.Vector infoGains)
This method builds the structure containing each possible value for each token The key is a token, the value is the information gain

Parameters:
effectparts -
infoGains -
Returns:
MACS.PossibleTokenMap[]

isCompatibleWith

private static double isCompatibleWith(Classifier.Perception p,
                                       MACS.PossibleTokenMap[] tokPossibilities)
This method checks whether a perception from the list of perceptions already seen in the environment is compatible with the list of tokens just created, i.e. if it can be anticipated from the model of transitions

Parameters:
p -
tokPossibilities -
Returns:
double

isPossible

private static double isPossible(Classifier.Token t,
                                 MACS.PossibleTokenMap tokPossibilities)
This method checks whether a given attribute is compatible in the list of tokens just created

Parameters:
t -
tokPossibilities -
Returns:
double

buildFilteredPerceptionList

private static java.util.Vector buildFilteredPerceptionList(MACS.PossibleTokenMap[] tokPossibilities,
                                                            MACS.PerceptionList referenceSet)
private static Vector sort(Vector v) { TreeSet retour = new TreeSet(v); Vector w = new Vector(retour); return w; }

Parameters:
tokPossibilities -
referenceSet -
Returns:
java.util.Vector

buildAnticipatedSituations

public static final java.util.Vector buildAnticipatedSituations(java.util.Vector effectparts,
                                                                java.util.Vector infoGains,
                                                                MACS.PerceptionList perceptionList)
Main method: computes the list of anticipated situations (see the class comment)

Parameters:
effectparts -
infoGains -
perceptionList -
Returns:
Vector

main

public static void main(java.lang.String[] args)