MASON Multi-Agent Simulation Framework

repository·master·Indexed 41 days ago

https://github.com/eclab/mason

A 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.

Tokens
16.9K
Snippets
27
Records
126
Agent score
52%

What's inside MASON

  1. Understand the MASON Repository Layout

    master

    The 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.

  2. Explore DES simulation examples

    master

    The contrib/des/sim/app directory 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:

    1. DESExample: A trivial example featuring a simple Graphical User Interface (GUI).
    2. MM1: An implementation of an M/M/1 Queue.
    3. Streetfood: A simulation scenario involving street food service.
    4. Ticket: A simulation scenario involving ticket processing.
  3. Kahan summing implementation

    master
    The Kahan class 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.
  4. Use MASON DES Extensions for Discrete Event Simulation

    master

    The MASON DES Extensions library provides discrete event simulation (DES) facilities for MASON.

    To use these extensions in your project:

    1. Classpath Configuration: Add the parent directory contrib/des to your project's CLASSPATH.
    2. Documentation: For a detailed description of the DES facility and specific usage instructions, refer to docs/manual.pdf within the repository.
    3. Reference Implementation: You can examine a simple application demonstrating the DES capabilities in sim/app/desexample.
  5. Set up Distributed MASON in Eclipse

    master

    To 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.

    1. Import Core MASON: File -> Import -> Existing Maven Projects -> Root Directory.
    2. Build Core MASON: Right-click the MASON project and select Run as -> Maven install. If dependencies are missing, use right click -> maven -> update project.
    3. Import Distributed MASON: File -> Import -> Existing Maven Projects -> distributed Directory.
    4. Build Distributed MASON: Right-click the distributed project and select Run as -> Maven install. Use right click -> maven -> update project if needed.
    5. Configure Classpath: Go to Java Build Path -> Add -> mason to ensure the distributed project can access the core MASON classes.
    # No single command block, but follows the sequence above.
  6. Use the DES portrayal classes for visualization

    master

    The des.portrayal package 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.java file.

    // See sim/app/desexample/DESExampleWithUI.java for a complete usage example
  7. Export a Runnable JAR for Distributed MASON

    master

    To create an executable JAR that includes all necessary dependencies for a distributed simulation, use the Eclipse Export wizard:

    1. Select Export -> Runnable JAR.
    2. Specify the main class and the destination.
    3. Select the option “package required libraries into Generated JAR”.
  8. Import MASON into Eclipse

    master

    To use MASON within the Eclipse IDE:

    1. Clone the repository to your local machine.
    2. Import the project using the following path: File -> Import -> Existing Maven Projects -> Root Directory.
    3. To build and install, locate the mason-build project, right-click it, and select Run as -> Maven install.
  9. Build MASON with 3D support

    master

    To enable 3D capabilities in MASON, you must install Java3D and JOGL libraries.

    Required Libraries

    Java3D Libraries:

    • j3dcore.jar
    • j3dutils.jar
    • vecmath.jar

    JOGL Libraries:

    • gluegen-rt.jar
    • gluegen-rt-natives-[your-platform].jar
    • joal.jar
    • joal-all-natives-[your-platform].jar
    • jogl-all.jar
    • jogl-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/.