The AnticipatedSituationMap class is used to store temporarily
the list of anticipated situations computed from each perception
through the model of transitions.
This class is used to implement standard classifiers such as ZCS classifiers
If you want to improve the speed of MACS, you can delete this class
and put all its methods in AnticipatoryClassifier.
From one list of condition parts, this method produces a list of more general condition parts,
each member in the list generalizing over one specific attribute of one of the initial condition part.
From one condition part, this method produces a list of more general condition parts,
each member in the list generalizing over one specific attribute of the initial condition part.
Necessary because contains does not seem to work for something else than
addresses
protected final boolean contains(Perception perc)
{
Iterator it = iterator();
while (it.hasNext())
{
if (((Perception)it.next()).equals(perc))return true;
}
return false;
}
This method generates recursively a list of condition parts more general than those of the list it receives,
checking that no condition in the list is in conflict with those of the classifierList
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
This methods computes for each possible action the list of anticipated
situations
and the associated information gains, and it fills tables with it:
- retour[0] = actions (contains the list of possible actions)
- retour[1] = anticipationSet (contains the list of anticipations from
classifiers)
- retour[2] = infoGains (contains the list of infogains corresponding to each
classifier)
If the value has already been computed, it does not compute it again.
The InfoValueEstimator class is in charge of returning
the estimated immediate information value in the current
situation from the informations provided by the Integrator.
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 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
This method checks whether the given Perception is matched by the condition part
of any member of the classifierList, given that this list contains classifier
whose action and effect part match the last action and the current situation.
The MACSActionSelector class is in charge of choosing the next action
both in the context of actual action and in the context of
"mental" propagation of values.
This method computes the ImmediateInfoGain for each possible anticipated
situation, given that for the same action different values can be estimated:
for each situation and for a given action,
it takes the max of the values computed for each situation resulting from this action
for each (S0,a,S1) triple
for all those whose action is a
their ImmediateInfoGain is the max ImmediateInfoGain of the group
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
This method returns the index of the best possible action
-> positive or null if there is one
-> -1 if there is no
-> -2 if the possibilities are equivalent
The algorithm is the following: for each action, retreive the best anticipated situation
corresponding to that action and its value.
This method is slightly less efficient than Pierre's
(calling selectWorstPossibilityForAction and selectBestPossibilityForAction),
but far more clear...
This method scatters the model of Transitions into subsets
For each classifier, if the classifier matches the current perception/action
couple, it is put into a set whose index corresponds to its first specialized symbol.
The TokenRepository class is used to store the set of all Tokens used by the LCS
All tokens are created once and for all so as to prevent
the extensive use of "new".