The sim C++ library -- version 2.0
A simulation is the execution in time of a model, represented by a
computer program, that gives information about the system being
investigated.
The library sim adopts the method of the Discrete Event Simulation.
With this approach, the components of the model consist of events,
which are activated at certain points in time and in this way affect
the overall state of the system. The points in time that an event is
activated are randomized, so no input from outside the system is
required. Events exist autonomously and they are discrete so between
the execution of two events nothing happens. The library sim provides
an event-based, as well as a process-oriented approach of writing a
simulation program. With the process-oriented approach, the components
of the program consist of entities, which combine several related
events into one entity.
Sim is written in the C++ programming language. The library provides
classes, that can be used by writing a C++ simulation program.
We provided the library with such a functionality, that the resulting
language is similar to SIMULA.
The library can be compiled to both a pure ASCII version as well as a
HUSH version. If you run the library in HUSH mode, you can use the
graphical features.
Differences between 2.0 and 1.0 versions
The following things have been changed in version 2.0 :
- You should always create and run a session.
- If you link your programs to the Hush version you always get
graphical output. As a consequence the simulation constuctor doesn't
get tk as an argument anymore.
- The histogram constructor gets a widget-path and the arguments as
a string of options. The additional options are for the formatting
of the output. The output for the (cumulative) frequency graph and
table contains no statistis anymore. The statistics can be
generated by adding an extra histogram.
- The methods suppress and scan of the simulation class don't exist
anymore. You can use the init method. Grafical output can be formatted.
- The confidence method of the analysis class takes an options
parameter now and the operator<< method has been removed.
Invoking a method of this class will immediately result in output,
which can be formatted.
- The screen class behaves different. It is like the hush-canvas
class except for the world-coordinates it uses. The widgets as the
clock etc.. have been made independent.
- The generator gets three seeds instead of one.
Advantages
- One program structure (sources and interface are clearer now).
- The period for the generator is a factor of 7000 higher.
- The graphical features are much more powerful. You can format almost
anything you want (sizes, colors etc..). Furthermore the widgets
(histogram,results from analysis and simulation,screen,
simulationclock,control,query) can be packed, be embedded in a
screen or made toplevel (instead of only be made toplevel).
Disadvantages
Keep us informed.
Mail any comments to eliens@cs.vu.nl.