László Gulyás, Tamás Kozsik and John B. Corliss (1999)
The Multi-Agent Modelling Language and the Model Design Interface
Journal of Artificial Societies and Social Simulation vol. 2, no. 3, <https://www.jasss.org/2/3/8.html>
To cite articles published in the Journal of Artificial Societies and Social Simulation, please reference the above information and include paragraph numbers if necessary
Received: 21-Oct-99 Published: 31-Oct-99
In its current version, MAML is a macro-language for Swarm (a freely distributed toolset under development at SFI), but it is also part of a larger Swarm-independent framework. Also, the design of MAML, while influenced by concepts from Swarm, is general enough to allow for later extension of the supported simulation kernels. This paper gives an overview of the mentioned larger framework, with special emphasis on MAML and its graphical CASE tool, the Model Design Interface.
Figure 1: The Telemodeling Project
Figure 2: Parameterization
Figure 3: Visualization in VRML
@model School { ... }The "components" of the model are defined in its body. For instance a model can contain agents. Agents are never described alone, but, similarly to the OOP terminology, agent classes can be defined. Agents are created as instances of the appropriate agent class. Again, a MAML construct, starting with the @agent keyword corresponds to agent classes. Analogously to models, the definition of an agent class includes a name and a body. This body contains the components of the agent class definition.
@agent Student { ... }
Example 1: The definition of a plan and a schedule in MAML.
@planDef StartLesson {
@to teacher enterRoom;
@forEach students stopTalking;
@to monitor report;
}
@schedule cyclic(60) Lesson {
0: @plan StartLesson;
44: @to bell ring;
45: @plan StartBreak;
}
Example 2: The definition of the same plan and schedule in Swarm. (The first two lines should go into a header file, separately from the rest.)
id StartLesson;
id Lesson;
StartLesson = [ActionGroup create: [self getZone]];
[StartLesson createActionTo: teacher message: M(enterRoom)];
[StartLesson createActionForEach: students message: M(stopTalking)];
[StartLesson createActionTo: monitor message: M(report)];
Lesson = [Schedule createBegin: [self getZone]];
[Lesson setRepeatInterval: 60]; Lesson = [Lesson createEnd];
[Lesson at: 0 createAction: StartLesson];
[Lesson at: 44 createActionTo: bell message: M(ring)];
[Lesson at: 45 createAction: StartBreak];
@sub protected: (void) findNewPosition { ... }
@var static private: int numOfAgents;
The default values for the modifiers are chosen according to an important language-design concept of ours: "if you don't understand it, don't care about it". Thus, public visibility is assumed if it is not ordered explicitly otherwise. Two more remarks: first, subroutines are not only used for implementing rules, but also for event-handling and for inter-agent communication. Second, we should not forget about the pro-activeness of agents (Wooldridge & Jennings 1995): schedules and plans can be placed not only into models, but also into an @agent definition.
Example 3: In this example the agent class Student is defined, as a subclass of Person.
@agent Student : Person {
@var protected: List marks; // list of marks received so
far
@sub: (void) receiveMark: (int) mark { [marks add: mark];
}
@sub static: (void) goToSchool { ... }
/* etc. */
@schedule cyclic(1440) {
480: @to self goToSchool;
840: @to self goHome;
850: @to mother giveLunch;
960: @to self doHomework;
}
}
@model School {
// components of the model
@var: int numOfRooms; // this is a parameter
...
@init:
// initialization code
numOfRooms = 12;
...
}
Such an initialization usually contains the creation of the initial agent structure of the model. MAML supports this with the @create statement. It can be used to create and initialize agents and collections of agents in a fairly compact way. The following lines create a ten by ten matrix of Bug agents and initialize them by invoking their setX:Y: subroutine:
@create [10:i,10:j] Bug bugs {
[bugs[i][j] setX: i Y: j];
}
@addToSchedule Lesson 40: @to Teacher AssignHomeWorkstatement will add the AssignHomeWork action the schedule named Lesson to be generated at the 40th time-step. Similarly, the
@addToPlan StartLesson @plan CheckHomeworkstatement will hierarchically add the CheckHomework plan to StartLesson.
Example 4: This plan definition is similar to the one in Example 1, but the second message goes for every Students agent instead of the programmer-defined group of agents, students. The definition of groupOfStudents is provided automatically by MAML.
@planDef StartLesson {
@to teacher enterRooom;
@forEach groupOfStudents stopTalking;
@to monitor report;
}
@observe School {...}
After the keyword the name of the observed model and -- between curly braces -- the body of the observation aspect should be specified. This body can define further (observational) agent classes, schedules, plans, variables and subroutines, and it can extend existing ones, as it will be outlined in the following.
Example 5: The observation of the School model introduces a histogram object and extends the Student agent class with a function. (For the details of the difference between this approach and the usual OOP inheritance, the interested reader may follow these links: Kinczales et al 1997; Gulyás and Kozsik 1999.)
@observe School {
@var: Histogram h;
@extendAgent Student {
@sub: (double) computeAverageOfMarks { ... }
}
}
Figure 4: Weaving together a model and an observer
Figure 5: A screen capture of the simulation of Schelling's model
Figure 6: Screen Capture from the Model Design Interface
2 This definition of the language was announced at SwarmFest'99, The Third Annual Meeting of the Swarm Users Group held at UCLA, Los Angeles, March 1999.
3 In contrast to objects, agents are also active, in the sense, that they can have their own thread of control. Certain object-oriented programming languages, for example (C++//) are appropriate to implement this.
GULYÁS L., Kozsik T.: Aspect-Oriented Programming in Scientific Simulations, Proceedings of The Sixth Fenno-Ugric Symposium on Software Technology, Estonia 1999, http://www.syslab.ceu.hu/maml/papers/aopss.ps
PARKER, M. T.: Parallel Evolution, or Swarm and Swarm-a-like: the 'ascape' Agent Based Modelling Framework. SwarmFest 1999, March 27-29 1999, UCLA http://www.brook.edu/es/dynamics/models/ascape/
CAROMEL, D., Belloncle F., Roudier Y.: The C++// system, in Parallel Programming Using C++, G. Wilson and P. Lu (eds.), MIT Press, 1996. http://www-sop.inria.fr/sloop/c++ll/c++ll.ps
JONES, T., Forrest, S.: An introduction to SFI Echo Technical Report 93-12-074, Santa Fe Institute, Santa Fe, NM. http://www.santafe.edu/~pth/echo/
GILBERT, N.: Models, Processes, and Algorithms: Towards a Simulation Toolkit. Paper given at the Dagstuhl Seminar on Social Science Microsimulation, May 5-9, 1997. http://www.uni-koblenz.de/~kgt/Dag9719/Gilbert.html
GULYÁS L.: Using Object-Oriented Techniques to Develop Multi-Agent Simulations. Proceedings of the 1st International Conference of PhD Students, University of Miskolc, Hungary, 1997, pp. 63-69.
GULYÁS L., Kozsik T., Fazekas S.: The Multi-Agent Modelling Language, http://www.syslab.ceu.hu/maml/
GULYÁS L., Kozsik T., Fazekas S.: The Multi-Agent Modelling Language, Proceedings of the 4th International Conference on Applied Informatics, Eger-Noszvaj, Hungary, 1999.
GULYÁS L., Kozsik T.: The MAML Tutorial. Central European University, Complex Adaptive Systems Laboratory, http://www.syslab.ceu.hu/maml/tutorial/
MENTGES, E.: Concepts for an agent-based framework for interdisciplinary social science simulation. Journal of Artificial Societies and Social Simulation vol. 2, no. 2. https://www.jasss.org/2/2/4.html
GULYÁS L., Kozsik T.: Model Design Interface - A CASE Tool for the Multi-Agent Modelling Language, Proceedings of the 2nd International Conference of PhD Students, Miskolc, Hungary, 1999. http://www.syslab.ceu.hu/maml/papers/mdi.ps
GULYÁS L, Kozsik T, Czabala P, Corliss, J.B.: Telemodeling ñ Overview of a System, Teleteaching '98, Distance Learning, Training and Education, Proceedings of the XV. IFIP World Computer Congress '98, 31 Aug - 4 Sep 1998, Vienna/Austria and Budapest/Hungary, Austrian Computer Society (OCG), 1998. p. 59. http://www.syslab.ceu.hu/telemodeling/
MÖHRING, M., Troitzsch, K. G.: MIMOSE (Micro- und Multilevel Modelling Software). http://www.uni-koblenz.de/~moeh/projekte/mimose.html
MINAR, N., Burkhart, R., Langton, C., Askenazi, M.: The Swarm Simulation System: A Toolkit for Building Multi-agent Simulations, http://www.santafe.edu/projects/ swarm/overview/overview.html
CUBERT, R. M., Fishwick, P. A.: MOOSE: An Object-Oriented Multimodeling and Simulation Application Framework. Submitted to Simulation, June 1997. http://www.cise.ufl.edu/~fishwick/moose.html
APPLE: Object-Oriented Programming and the Objective-C Language, http://developer.apple.com/techpubs/macosxserver/ObjectiveC/
GAMMA, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 1994
SCHELLING, T.: 1971. Dynamic Models of Segregation.. Journal of Mathematical Sociology, 1971, 1:143-186.
MOSS, S., Gaylard, H., Wallis, S., Edmonds, B.: SDML: A Multi-Agent Language for Organizational Modelling. Computational and Mathematical Organization Theory (forthcoming). http://www.cpm.mmu.ac.uk:80/cpmrep16.html
SLOMAN, A., Poli, R.: SIM_AGENT: A toolkit for exploring agent designs. in Intelligent Agents Vol II (ATAL-95), Eds. Mike Wooldridge, Joerg Mueller, Milind Tambe, Springer-Verlag, pp. 392--407
SUMPTER, D. J. T.: Introduction to Multi Agent Simulation. http://www.ma.umist.ac.uk/dsumpter/beesim/Simulation/overview.htm
SANTA FE INSTITUTE: The Swarm Simulation Package, http://www.santafe.edu/projects/swarm/
SONNENSCHEIN, M., Köster, F., Lorek, H., Vogel, U.: The WESP Project. http://www.offis.uni-oldenburg.de/projekte/ecotools/project_ecotools5.htm
WOOLDRIDGE, M. and Jennings,N. R.: Agent Theories, Architectures and Languages: A Survey, Intelligent Agents ECAI-94 Worshop Proceedings, Lecture Notes in Artificial Intelligence 890, pp. 1-39, Springer-Verlag, Berlin, 1995.
Return to Contents of this issue
© Copyright Journal of Artificial Societies and Social Simulation, 1999