MASON Multiagent Simulation Toolkit on the NetBeans Platform

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.

Comments:

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

Posted by Julian Matias on May 04, 2010 at 04:58 PM PDT #

Read all about it here, Julian:

http://netbeans.dzone.com/news/office-laf-netbeans-platform

Posted by Geertjan on May 04, 2010 at 06:51 PM PDT #

Geertjan

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!

Posted by tborak on May 05, 2010 at 02:25 AM PDT #

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

Posted by Geertjan Wielenga on May 05, 2010 at 02:28 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today