Geertjan's Blog

  • May 4, 2010

MASON Multiagent Simulation Toolkit on the NetBeans Platform

Geertjan Wielenga
Product Manager
MASON is a fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations, and also to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D. MASON is a joint effort between George Mason University's Evolutionary Computation Laboratory and the GMU Center for Social Complexity.

The above text comes directly from the MASON homepage.

The site includes instructions for getting started with the project in NetBeans IDE. Download the sources as instructed and set everything up as described then run the project from the IDE and you'll see this:

Select one of the simulations and read about it, as shown here:

Then click "Select" and the dialog above closes, while the two below open at the same time, where you can perform the simulation of your choice:

Since each simulation is provided by a different author, wouldn't it be cool to have a pluggable container, rather than the fixed situation which MASON currently has? And wouldn't it be nice if you could see multiple simulations simultaneously? And wouldn't it be handy if you could throw away a lot of the boilerplate code and centrally register the actions?

Here's the result of the above ruminations, i.e., I ported the application to the NetBeans Platform, focusing on two of the many simulations, which are now available in the new application:

Looks better than the original, is easier to use, and the structure of the sources is nicer (i.e., rather than the looong list of packages of the original, the modular structure enables a far smaller codebase per module, making the application as a whole more manageable):

Porting simulations from the old structure to the new one is trivial. Create a new module, copy the simulation (i.e., each simulation in the original application is in its own package, which is handy) into the new module, set dependencies on the other modules (which contain utility classes and the console view), add a new action that opens the simulation, and then you're done.

As a result, each existing simulation can be ported to the new infrastructure in under 5 minutes of work, which is the time it took for me to port the Keep Away Soccer simulation into the new application:

And, two or three clicks later, without any coding in any shape or form, Office LAF can be added to the application:

I think all of this is a significant improvement to the architecture, functionality, and usability of MASON, enabling it to be far more maintainable and user friendly than it currently is... for almost no work at all.

Join the discussion

Comments ( 4 )
  • Julian Matias Tuesday, May 4, 2010

    Hi Geertjan

    First of all I have to say that I read your blog regularly and it is really helpful for my daily job. Thank you very much.

    But the reason of writing a comment is asking you how you did get the Office Look&Feel, and how you linked it to your project.

    Thank you again

  • Geertjan Wednesday, May 5, 2010
  • tborak Wednesday, May 5, 2010


    I am not very familiar with the Office LAF, so maybe I am missing something. Prior to applying the Office LAF, the app contains the "File", "Tools" and "Help" menus. Afterward, there is only "Home". Where do the other menu items move to?

    Thanks for all the great articles!

  • Geertjan Wielenga Wednesday, May 5, 2010

    That's unrelated to the OfficeLAF. You can hide menu items and toolbar buttons in the layer file.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.