MASON Multi-Agent Simulation Framework
repository·master·Indexed 41 days ago
https://github.com/eclab/masonA multi-agent simulation framework featuring a core engine and various extensions. Key extensions include MASON DES for discrete event simulation, GeoMason for vector and raster geospatial data support, Distributed MASON for MPI-based simulations, and JBox2D integration for 2D physics. The framework supports 3D visualization via Java3D and JOGL.
What's inside MASON
- GeoMason is an optional extension for the MASON simulation framework that provides support for vector and raster geospatial data. It allows developers to build geographically explicit models within the MASON ecosystem.
Overview of the MASON DES library
masterThedesdirectory contains the main collection of classes for MASON's DES (Discrete Event Simulation) library. For detailed explanations of the individual classes and their usage, refer to thedocs/manual.pdffile within the repository.Understand the MASON Repository Layout
masterThe MASON repository is organized into two main directories:
mason/: Contains the core MASON project.contrib/: Contains various independent extensions to MASON. Each extension in this directory is its own separate project.
For more detailed information, visit the MASON website.
Explore DES simulation examples
masterThe
contrib/des/sim/appdirectory contains four Discrete Event Simulation (DES) examples developed for testing purposes. These examples demonstrate different levels of complexity, from simple GUIs to specific queueing models and scenarios:- DESExample: A trivial example featuring a simple Graphical User Interface (GUI).
- MM1: An implementation of an M/M/1 Queue.
- Streetfood: A simulation scenario involving street food service.
- Ticket: A simulation scenario involving ticket processing.
Kahan summing implementation
masterTheKahanclass provides an implementation of the Kahan summation algorithm, which is used to reduce numerical errors when adding a sequence of finite-precision floating-point numbers. Note that as of the current version, this class is not actively used within the project.Use MASON DES Extensions for Discrete Event Simulation
masterThe MASON DES Extensions library provides discrete event simulation (DES) facilities for MASON.
To use these extensions in your project:
- Classpath Configuration: Add the parent directory
contrib/desto your project's CLASSPATH. - Documentation: For a detailed description of the DES facility and specific usage instructions, refer to
docs/manual.pdfwithin the repository. - Reference Implementation: You can examine a simple application demonstrating the DES capabilities in
sim/app/desexample.
- Classpath Configuration: Add the parent directory
Set up Distributed MASON in Eclipse
masterTo develop with Distributed MASON in Eclipse, you must import and build both the core MASON project and the distributed extension as Maven projects, then link them in your Java Build Path.
- Import Core MASON:
File -> Import -> Existing Maven Projects -> Root Directory. - Build Core MASON: Right-click the MASON project and select
Run as -> Maven install. If dependencies are missing, useright click -> maven -> update project. - Import Distributed MASON:
File -> Import -> Existing Maven Projects -> distributed Directory. - Build Distributed MASON: Right-click the distributed project and select
Run as -> Maven install. Useright click -> maven -> update projectif needed. - Configure Classpath: Go to
Java Build Path -> Add -> masonto ensure the distributed project can access the core MASON classes.
# No single command block, but follows the sequence above.- Import Core MASON:
Use the DES portrayal classes for visualization
masterThe
des.portrayalpackage provides rudimentary classes used to display the DES (Discrete Event Simulation) facility within MASON's visualization package.To implement basic usage of these portrayal classes, refer to the implementation pattern found in the
DESExampleWithUI.javafile.// See sim/app/desexample/DESExampleWithUI.java for a complete usage exampleExport a Runnable JAR for Distributed MASON
masterTo create an executable JAR that includes all necessary dependencies for a distributed simulation, use the Eclipse Export wizard:
- Select
Export -> Runnable JAR. - Specify the main class and the destination.
- Select the option
“package required libraries into Generated JAR”.
- Select
Download required data files for GeoMason
masterTo use the GeoMason applications, you must manually download the necessary data files from the official GeoMason website. The applications require these files to function correctly.
Download location: https://people.cs.gmu.edu/~eclab/projects/mason/extensions/geomason/
Import MASON into Eclipse
masterTo use MASON within the Eclipse IDE:
- Clone the repository to your local machine.
- Import the project using the following path:
File->Import->Existing Maven Projects->Root Directory. - To build and install, locate the
mason-buildproject, right-click it, and selectRun as->Maven install.
Build MASON with 3D support
masterTo enable 3D capabilities in MASON, you must install Java3D and JOGL libraries.
Required Libraries
Java3D Libraries:
j3dcore.jarj3dutils.jarvecmath.jar
JOGL Libraries:
gluegen-rt.jargluegen-rt-natives-[your-platform].jarjoal.jarjoal-all-natives-[your-platform].jarjogl-all.jarjogl-natives-[your-platform].jar
Installation Notes
- OS X Users: It is recommended to install Java3D and JOGL directly from the jogamp website. A collection of working libraries for OS X can be found here.
- Library Location: Install these libraries in your system-wide Java library location. On macOS, this is
/Library/Java/Extensions/.