In the trend of developing complex system of multi-disciplinary, composing and coupling models are days by days become the most attractive research objectives. GAMA is supporting the co-modelling and co-simulation which are suppose to be the common coupling infrastructure.
A Comodel is a model, especially an multi-agent-based, compose several sub-model, called micro-model. A comodel itself could be also a micro-model of an other comodel. From the view of a micro-model, comodel is called a macro-model.
A micro-model must be import, instantiate, and life-control by macro-model.
to be completed…
The GAML language has been evolve by extend the import section. The old importation tell the compiler to merge all imported elements into as one model, but the new one allows modellers to keep the elements come from imported models separately with the caller model.
Defining a micro-model of comodel is to import an existing model with an alias name. The syntax is:
import <path to the GAML model> as <identifier>
The identifier is then become the new name of the micro-model.
After the importation and giving an identifier, micro-model must be explicitly instantiated. It could be done by create statement.
create <micro-model identifier> . <experiment name> [optional parameter];
THe
Note: Creation of multi-instant is not create multi-simulation, but multi-experiment. Modellers could create a experiment with multi-simulation by explicitly do the init inside the experiment scope.
A micro-model can be control as the normal agent by asking the correspond identifier, and also be destroy by the ‘o die’ statement. As fact, it can be recreate any time we need.
ask (<micro-model identifier> . <experiment name> at <number> ) . simulation {
...
}
The micro-model species could display in comodel with the support of agent layer
agents "name of layer" value: (<micro-model> . <experiment name> at <number>).<get List of agents>;
Reusing of two existing models:Flood Simulation and Evacuation.
Toy Models/Evacuation/models/continuous_move.gaml
Toy Models/Flood Simulation/models/Hydrological Model.gaml
The comodel explore the effect of flood on evacuation plan:
Simulation results: