Matthias Meyer and Klaus Hufschlag (2006)
A Generic Approach to an Object-Oriented Learning Classifier System Library
Journal of Artificial Societies and Social Simulation
vol. 9, no. 3
<https://www.jasss.org/9/3/9.html>
For information about citing this article, click here
Received: 31-Mar-2006 Accepted: 01-Apr-2006 Published: 30-Jun-2006
Figure 1. Simplified scheme of the library's main classes |
Figure 2. Steps for building a classifier system using the library |
Example 1: Building a genetic algorithm using the library | |
Code | Explanation |
Public void GA() { | Method-header, then random choice whether or not to run GA. |
Random r = new Random(); | |
if (r.nextDouble() < getrho()) { | |
ClassifierSystem pool = (ClassifierSystem) this.clone(); | Make working-copy of this CS and generate new CS as set of victims (pool) to enable random drawings (without putting back). |
ClassifierSystem victims = new ClassifierSystem(); | |
for (int lauf = 1; lauf <= getNumVictimsGA(); lauf++) { | Select given number of victims by roulette-wheel choice (here with inverted probabilities), remove them from working copy of CS and add to set of victims. |
StandardClassifier victim = (StandardClassifier) | |
pool.RoulettewheelChoice("getStrength", true); | |
pool.remove(victim); | |
victims.add(victim);} | |
ClassifierSystem offsprings = new ClassifierSystem(); | Generate new CS as set of offsprings |
for (int lauf = 1; lauf <= getNumVictimsGA(); lauf++) { | Select given number of classifiers as offspring using (normal) roulette-wheel choice, remove them from working copy of CS. Strength of offspring is set to half, as classifiers get duplicated (according to ZCS-instruction). Add copy of offspring-classifiers to set of offspring-copies. |
StandardClassifier offspring = (StandardClassifier) | |
pool.RoulettewheelChoice("getStrength", false); | |
pool.remove(offspring); | |
offspring.setStrength((offspring.getStrength() / 2)); | |
offsprings.add((StandardClassifier) offspring.clone());} | |
if (r.nextDouble() < chi) { | With given probability, start a pair wise mating-process of the classifiers in offspring set of offspring-copies. |
offsprings = offsprings.crossover();} | |
offsprings = offsprings.mutation(my); | Initiate mutation of the offspring-copies (after crossover) with given probability. |
remove(victims); | Remove victims from original CS. |
add(offsprings);}} | Add processed offspring to original CS. |
Example 2: Defining symbols, languages, classifiers and LCS | |
Code | Explanation |
Language lang1 = new Language("BasicLang"); | Definition of language (lang1). |
lang1.add(new Symbol("0")); | Symbols are defined and added to Language lang1. |
lang1.add(new Symbol("1")); | |
Language lang2 = new Language("ConditionLang"); | 2nd language (lang2) gets defined; all members of lang1 are added. In addition, a wildcard symbol gets defined and added to lang2. |
lang2.add(lang1); | |
Symbol wild = new Symbol("#"); | |
wild.addMember(lang1); | |
lang2.add(wild); | |
StandardClassifier c1test = new StandardClassifier(new Rule( new StandardSituation(lang2, 10), new StandardSituation(lang1,10)), 1); | A classifier of type StandardClassifier is defined, nesting definitions of a Rule and of two StandardSituations with given languages and determined length. |
ZLCS testsys = new ZLCS("Test", c1test, 400, true); | A new LCS of the ZLCS-type is instantiated, using the defined classifier as a sample for generating rules. The size of the LCS is 400 classifiers and the initial set is randomized. |
testsys.setgamma(0); | Setting further parameters |
2 This library will also be provided as open source. See footnote 14 for details.
3 This complexity of control flows in computer simulation models led to the development of "Simula" programming language in 1967, as one of the origins of object-orientation (see Janßen and Bundschuh 1993). Moreover, because the control flow can become a matter of research in itself, classic procedural approaches in such cases fail to meet their objectives.
4 For a methodological discussion see Lindenberg (1992), who suggests a stepwise development of assumptions as a "method of decreasing abstraction".
5 For a detail description of these different classifier systems see Holland et al. (1987), Wilson (1994) and Butz and Wilson (2002). For a direct comparison, see Bull (2004).
6 Mutation also can be used for altering environment states represented by a Situation-object.
7 Example 1 in the Appendix shows how the ZLCS class uses inherited functions — especially selection and manipulation of sets of classifiers — to implement its genetic algorithm.
8 Additional, as a practical side aspect, integration with Repast needs no further requisites.
9 For the first step, the library itself comes with a ZCS implementation (ZLCS-class) that can be used as a ready-made LCS, but is mainly intended as an example of building a specific classifier system achieved by deriving it from the ClassifierSystem-class.
10 The steps are also shown in Example 2 presented in the Appendix.
11 See Marengo (1992). The replication is part of the SILC-Project, which is a cooperation of members of the chair of Controlling and Telecommunications at the Otto Beisheim School of Management in Vallendar (Bernd-Oliver Heine, Klaus Hufschlag and Matthias Meyer) and the Institute for IS Research of the University Koblenz-Landau (Klaus Troitzsch and Iris Lorscheid). The main objective of this project was to acquire knowledge of how to use LCS for modelling individual and organisational learning.
12 This is a translation of the working title of the PhD project of Bernd-Oliver Heine (in German: Konzeptionelle Nutzung von Controllinginformationen — ein modelltheoretischer Ansatz").
13 Translation of the working title of the PhD project of Klaus Hufschlag (in German: "Informationsstrukturen bei begrenzter Rationalität").
14 A zip-File of the library's source code can be downloaded at http://www.openabm.org/model-archive/glcslib.
BUTZ, M and WILSON, S W (2002). An algorithmic description of XCS. Soft Computing, Vol. 6, No. 3-4, pp. 144-153.
CHANG, M-H and HARRINGTON, J E (in press). Agent-Based Computational Economics. In Judd, K L and Tesfatsion, L (Ed.): Agent-Based Models of Organisations: Handbook of Computational Economics II. Amsterdam: North-Holland.
CHATTOE, E (1998). Just How (Un)realistic are Evolutionary Algorithms as Representations of Social Processes? Journal of Artificial Societies and Social Simulation, Vol. 1, No. 3.
HOLLAND, J H (1992). Genetic algorithms. Scientific American, Vol. 267, No. 1, pp. 44-50.
HOLLAND, J H, HOLYOAK, K J, NISBETT, R E and THAGARD, P R (1987). Induction: processes of inference, learning, and discovery. 2nd printing. Cambridge, Mass.: MIT Press.
JANßEN, H and BUNDSCHUH, M (1993). Objektorientierte Software-Entwicklung. München, Wien: Oldenbourg.
KOZA, J R, RICE, J P and ROUGHGARDEN, J (1992). Evolution of Food Foraging Strategies for the Caribbean Anolis Lizard Using Genetic Programming, Santa Fe Institute Working Paper 92-06-028, Santa Fe, NM.
LINDENBERG, S (1992). The Method of Decreasing Abstraction. In Coleman, J S and Fararo, T J (Ed.): Rational choice theory: advocacy and critique. Newsbury Park: Sage Publ., pp. 3-20.
MARENGO, L (1992). Coordination and organizational learning in the firm. Journal of Evolutionary Economics, Vol. 2, No. 4, pp. 313-326.
MARSCHAK, J and RADNER, R (1972). Economic Theory of Teams. New Haven, London: Yale University Press.
MEYER, D, KARATZOGLOU, A, LEISCH, F, BUCHTA, C and HORNIK, K (2003). A Simulation Framework for Heterogenous Agents. Computational Economics, Vol. 22, No., pp. S. 285-301.
OSTROM, T M (1988). Computer simulation: The third symbol system. Journal of Experimental Social Psychology, Vol. 24, No., pp. 381-392.
RADNER, R (2000). Costly and Bounded Rationality in Individual and Team Decision-Making. Industrial and Corporate Change, Vol. 9, No. 4, pp. 623-658.
VRIEND, N J (1995). Self-Organization of Markets: An Example of a Computational Approach. Computational Economics, Vol. 8, No. 3, pp. 205-231.
WELCH, O J, REEVES, T E and WELCH, S T (1998). Using a genetic algorithm-based classifier system for modeling auditor decision behavior in a fraud setting, Intelligent Systems in Accounting. Finance & Management, Vol. 7, No. 3, pp. 173 - 186.
WILSON, S W (1994). ZCS: A zeroth level classifier system. Evolutionary Computation, Vol. 2, No. 1, pp. S. 1-18.
Return to Contents of this issue
© Copyright Journal of Artificial Societies and Social Simulation, [2006]