Introduction to MAML
MAML = Multi-Agent Modeling Language
... is an easy-to-learn language for writing models. It is only in a pre-beta phase now, but we would like to
share it with possible users: evaluation of the current version can help us make progress in its development.
Here we will give a short introduction to MAML. We will summarize its main concepts, reveal its advantages, we
try to convince you that it's advantageaus to use MAML.
First of all, let's view the reason why we've started developing MAML, starting with the...
Project description: Modeling Environment
We are planning to develop a complex modeling environment. Using this environment, we are going to support scientists,
who are not experts in programming, doing research in computer-assisted modeling. Such a modeling environment will
enable and encourage experimentation and exploration, providing freedom in all phases of modeling. The
supported modeling discipline is agent-based modeling.
Our target users are scientists and students in social and human sciences (e.g., economy, environmental science,
sociology, political science, etc.). They are often not great computer scientists, nor do they want to be...
They want easy-to-use tools to efficiently express their ideas.
What is this modelling environment for? There are (at least) 4 tasks:
- to develop models (that is, to write computer programs which represent a model of the real world),
- to run simulations (that is, to execute the programs),
- to search in parameter space (that is, to run many simulations of the same model with different parameters),
- to analyse results (that is, to create and prove
assumptions on the model's behavior, and expose it to real-world
- It should have a graphical user interface.
- It should support work through the web.
- It should be based on an adequate programming
- Users without great programming skills can learn to use it. The graphical user interface is self-explanatory and
so is the model programming language: it reflects a natural way of thinking about modeling. There is no need to
bother with implementation details. The environment will do it for you.
users should learn "tricks" to increase efficiency...)
- Users can access remote resources through the web. (Our user community in Central and Eastern Europe
binds that access to the resources of our Lab very helpful.
Some of our plans to establish a relatively powerful computing centre in the Lab
have already been realized, and we are striving for further improvements.
- Users are aided with graphical tools, which are essential in result analysis.
Artistic solutions can inspire scientists in further research.
And it's not enough to be aesthetic: the user should be able to animate it, to interact with it.
- Creating a simple way to describe models, this
environment can facilitate the publication of those models. (The entire
model is easily published, not just simulation results and main
concepts.) By enabling users to descibe models easily, without
implementation details, this environment improves communication among
scientists and facilitates the understanding and reuse of their work.
- First pre-beta release of a model programming language. More details
will follow in the next section.
- Examples of graphical tools for result analysis. They are Web-based;
they use Java and VRML.
- Remote parametrization and running of simulations. Parameter space
search can be distributed over a LAN of Linux boxes. We have made
experiments in collecting results and storing them in DB for later reuse.
- Research on developing a model building tool with graphical user
MAML: Multi-Agent Modeling Language is a programming language for building
Why do we feel it's needed?
We had many problems teaching Swarm / Objective-C
/ C to non-programmers. They were always lost when we started to explain arrays and pointers. They didn't know
eventually how to start writing a model. We think a higher-level programming language could help solve this
problem. This language need not be a general purpose one in the sense that Objective-C is, but it
should be appropriate when formalizing models.
We have observed that whenever you write a model in Swarm, you make a copy of an existing one and start to modify
it. Why is this so? Because there are a lot of things that "should be there". It seems a good idea to let
the compiler "put it there" for you. That's again a reason to develop sg. over Swarm.
Where are we now in developing this language?
- MAML introduces high-level constructs, and thus increases the brevity of the code
- One doesn't have to know "tricks" to code certain things
- The constructs are at a high abstraction level: it's easier to read and understand the code
- The constructs provided by the language are intended to be used for modeling: model, agent, schedule, plan;
this enables clearer program structure
- We don't forbid pure Swarm in the code, so we
preserve expressiveness and flexibility until the whole MAML language is
- One still has to write "too much" C and Objective-C code
- Finding an error is sometimes harder (if the situation forces you, you have to look at the generated Swarm code), though
we have an error-redirection mechanism in the MAML_2_Swarm compiler
- Unique syntax (a temporary means to ease the
compiler in source analysis)
- MAML separates the model and its "observations". The technique used is superposition. (This is similar
to Aspect Oriented Programming. Note that Objective-C also supports this, though in a restricted way, with "categories".)
This technique to structure the program helps the user to concentrate on one thing at a time, thus easing the development and
understanding of the code. It also improves program maintainability. Adding new observations to an existing model
becomes much easier, too.
- The program components correspond to agent-based modeling terms: model, agent, schedule and
plan. In Swarm these were expressed in terms of objects, classes and messages. A higher level of abstraction
makes it possible to define such things as schedules, for example, with a much simpler syntax.
- There are certain constructs/statements in MAML which proved to be helpful in implementation and in writing
code. A good example of this is the development of a new, very compact way to create objects, arrays and arrays of objects.
- We have added some predefined (and automaticaly maintained) variables. Of course they introduce some overhead,
but they are used in so many cases that it's worth providing them. (e.g. groupOf,..., maxTimestep.)
- Like Swarm, we differentiate between "gui" and
"batch" observations. We have simplified the use of probes though. We
emphasize their importance in developing fast prototypes and in program
- We would like to define higher level patterns of agent communication.
- The notion of "groups" will also be implemented. Efficient operations on groups will be provided.
- Probing (only as output) should be extended for supporting batch observations.
- Useful types (e.g. modular integer) will be introduced.
- Syntax support for arrays will be provided.