How gama-platform/gama works
Project type and purpose
• This is an open-source, Eclipse-based, multi-module Java application implementing the GAMA modeling and simulation platform.
• It provides both a full GUI application (Eclipse RCP + plugins) and a headless server, plus a domain-specific language (GAML) compiler, an annotation processor, a host of extensions, documentation, and packaging scripts.
Top-level components
• Build & CI: Maven parent POM, Travis CI scripts, module dependency management.
• Core engine (“gama.core”): the simulation kernel, message bus, metamodel, runtime, scheduler, outputs.
• GAML language support
• Annotation processor (“gama.processor”): generates metadata, docs, test scaffolding.
• Compiler (“gaml.compiler”): Xtext-based parser, validator, code generator.
• UI application (Eclipse RCP product)
• Application shell (“gama.ui.application”): workbench, perspectives.
• Editor (“gama.ui.editor”): GAML text editor, Xtext integration.
• Experiment view (“gama.ui.experiment”): controls and displays simulation runs.
• Navigator (“gama.ui.navigator”): project browser.
• Shared UI libraries (“gama.ui.shared”), viewers (“gama.ui.viewers”), display implementations (“java2d”, “opengl”).
• Headless server (“gama.headless”): command parser, batch runner, WebSocket server.
• Extensions (“gama.extension.*”): optional plugins adding BDI, database connectors, network skills, physics, stats, etc.
• Dependencies bundle (“gama.dependencies”): third-party jars (Geotools, JTS, JFreeChart, etc.).
• Documentation generator (“gama.documentation”): XSLT and Java tools producing user docs.
• Product packaging (“gama.product”, “gama.p2site”): assembly of features into installable Eclipse products.
Relationships & interactions
• Build pipeline (Maven + Travis) compiles modules in order: annotations → processor → parent → product.
• At runtime:
GAML source (editor or CLI) → compiler → core engine ← annotation-generated helpers.
Core engine publishes events to UI display plugins.
UI application orchestrates editor, experiment and display plugins via OSGi/Eclipse extension points.
Headless server exposes core engine services over WebSockets and CLI.
Extensions register new GAML statements or skills via the annotation processor and plugin.xml.
Architectural patterns & principles
• Plugin-based modularization: each feature or layer is an Eclipse/OSGi plugin.
• Multi-module Maven reactor: clear build-time dependency management.
• DSL implementation via Xtext: parser→AST→EMF metamodel→validation→generator.
• Layered separation: language/compiler layer, core engine, UI layer, headless server, packaging.
• Extension points and inversion of control: new behaviors added via plugin.xml and Java annotations.
Technologies & frameworks
• Java 21, Maven, Travis CI.
• Eclipse PDE/RCP, OSGi.
• Xtext (for GAML).
• EMF (metamodels, AST).
• WebSocket (Java-WebSocket) for headless server.
• Geotools, JTS, JFreeChart for spatial and chart outputs.
• YourKit profiler support.