In the first category, we have the classes Token, Message, Action, Perception, Anticipation and their derivatives, as shown in the next pictures.
A Message is made out of Tokens. Each token can take either a "don't care" (#) value, a "don't change" (=) value, a "don't know" (?) value, or an integer value in a range between 0 and a maximum value specified in the Message format.
The TokenRepository is an optimization trick used to create less objects. Any possible Token is created just once and for all and stored in the repository. The repository delivers a pointer on it each time it is necessary. This also makes the comparisons easier, since just addresses need to be compared.
An Action, Perception, and Anticipation is a Message. Anticipation is an interface, different classes of Classifiers containing different kinds of Anticipations implementing this interface. But an Anticipation is also a particular kind of Perception, thus concrete Anticipations must extend Perception.
The following picture represents different sorts of Classifiers available. The BasicClassifier contains the common core of all classifiers : a condition part and an action part.
More characteristic of this package is the AnticipatoryClassifier class. As BasicClassifier, it contains a Condition and an Action part, but it also contains an Anticipation part. AnticipatoryClassifiers in YACS and MACS just differ from the kind of Anticipation they use. The MACSAnticipation class is ready for use, while the YACSAnticipation class must be programmed (up to now it is just a copy of MACSAnticipation).
The main class in the package MACS is ModularClassifierSystem.
It comes with a ClassifierSystemLoader class whose role is to load an ALCS,
a ClassifierSystemParameters class containing all the experimental parameters
listed in configuration files and two TraceManagers, ModularClassifierSystemTraceManager
and ClassifierSystemTraceManager, whose role is to display everything happening in MACS.
The ModularClassifierSystem's processes are split in two parts: those which take care
of the model of transitions, and those which take care of the ActionSelection processes.
The package MACS
The package MACS heavily relies on the package Classifier.
Two layers can be distinguished in it: the high level layer represents
important classes in MACS, while the lower level layer is just made of
lists (Vectors) or Sets (TreeSets) of Classifiers providing useful services.
The lower level layer will be described further in the text.
The model of transitions in MACS
The model of transitions in MACS is stored in the ClassifierSystem class, which itself
derives from AnticipatoryClassifierList,
deriving from ClassifierList.
With this class come three Managers whose role is to improve the model of transitions: the GeneralizationManager, the SpecializationManager and the ConditionCoveringManager.
Each of these Managers is called through the method run(). Detailled algorithms are explained in papers on MACS.
The MultiModelOfPayoff is a quite flexible class with which you can represent different kinds of models of payoffs with different priority levels among the different criteria that you want to use. The list of criteria and their hierarchical organization into level is read in the parameter file that goes with MACS. The action selection mechanism requires the construction of a list of anticipated situations. This process is performed by the Integrator class in conjunction with the Anticipator class. Since the Integrator algorithms are computationnally expensive and should be called several times per time step if the system performs mental rehearsal of its model, we have added a memory of all anticipated situations recheable from each possible Perception. This memory is implemented by the AnticipatedSituationsMap class.
The PayoffModel class implements a list of immediate values and expected values associated to each possible perception. It is organized as a Map whose key is a Perception and whose value is a couple of doubles: the immediate value and the expected value.
As shown in the picture below, the ClassifierSystem class itself extends an AnticipatoryClassifierList. Similarly, the set of all encountered Perceptions is implemented as a PerceptionList.
Conceptually, a Set is a container where an item can appear only once while it can appear more than once in Lists. Also, we more often access to items in sequence in Lists than in Sets. Ordering Sets is efficient if you often have to look for a particular item.