Sunday, May 13, 2007

PLT Scheme Simulation Collection Version 2.2 Released

Yesterday I released PLT Scheme Simulation Collection Version 2.2 via PLaneT. Version 2.2 includes some additional graphical examples. See the examples directory (in the PLaneT cache). All of the graphical examples can be run under either DrScheme or MrEd (mred -r ...).
The interactions.ss example is still my favorite. It shows the use of a simulation monitor to produce a visualization of a simulation, in this case, the interaction of particles with both attractive and repulsive forces. It is a hybrid simulation with both discrete-event (creating and deletion of particles) and continuous (modeling the forces) simulation elements. The animation works very well when its window is on the top, but doesn't repaint when it has been hidden. I have played a little with using a bitmap for the animation and transferring the bitmap to the canvas each update. This fixes the repaint when it's hidden, but I haven't been able to get a decent looking animation without flicker or other artifacts. A good animation example (or just plain help) would be appreciated. The only other thing I'd like to add to this simulation is a was to stop the simulation.
The other graphical examples aren't animations, they just provide a GUI for the simulation. For each of these there was already a simulation with graphical elements (i.e., a histogram or other plot of simulation data). The graphical example adds a GUI that allows simulation parameters to be modified.
The best GUI example is open-closed-loop-graphical.ss. This provides an example GUI for performing analysis on a (very simple) system. From the Edit > Options ... menu, you can select either open-loop (infinite resources) or closed-loop (with a specified number of resources) processing and other simulation parameters. The number of runs and number of customers per run are specified via sliders on the main window. The results are displayed in a pane in the main window.
As both a user of graphical tools (i.e., PLoT) and a provider of graphical tools, I am still annoyed at the differences between the various ways of providing graphical output in the PLT Scheme suite of tools (e.g., DrScheme, MrEd, and open-output-text-editor). I thought I had a nice mental model of DrScheme as an IDE for graphical PLT Scheme programs and MrEd as a run-time for the same programs. To the PLT Scheme developers the model seems to be that MrEd is (just) a tool to develop DrScheme and other graphical applications. My mental model of a graphical PLT Scheme program is just an illusion. Unfortunately, to people with my mental model, it seems that MrEd is just brain damaged with respect to executing what to me seems to be valid PLT Scheme graphical programs.

Labels: