Project | Documents | Downloads | History | Links |
GS DSLibs: a GeneSim set of libraries for Discrete Simulation
The main goal of the DSLibs subproject is to experiment with discrete system modelling and generation patterns from UML/SysML to OO code. The subproject is part of the long term plan to integrate continue and discrete simulation in GeneSim.
Source distributions of DSLibs are available since late 2006. DSLibs were used in a real case study carried out in collaboration with MAIOR srl. In this case DSLibs were used to develop a simulator for an on-demand public transport service. Since 2006, DSLibs were also used for teaching purposes in a simulation course (Simulation & Logistics, BSc in Applied Computer Science, University of Pisa, detachment in La Spezia).
GS DSLibs provides an object oriented framework for development of discrete simulators. The source distribution currently includes the following libraries, which actually are developed as separated GeneSim subprojects.
Event Driven Engine. This library provides an event driven engine, a generic queue class and base classes for events and entities. UML modelling techniques are defined using class, object and state machine diagrams. A simulator is obtained by the specialization of the base classes for events and entities. Code generation patterns are defined to derive the specialized classes and methods from the UML diagrams that model the system.
Random Variables. This library provides an implementation of random variable that follows the intuitive meaning of such widely used terminology: a random variable cannot be assigned but each time it is accessed it shows a different (random) value according to its distribution function. The Library provide classes for discrete and continue random variables and virtual classes for generic distributions and for basic pseudorandom generators. Several implementations of both virtual classes are available using different methods for basic generators (like Quick & Dirt 32, Park & Miller's Minimal Standard, Marsaglia's generators and Mersenne Twiester) and for known distributions (like sampled, triangular, exponential, normal, Weibull ...).
DSLibs Demos. This library is a collections of discrete simulation examples to show the usage and the features of the other libraries included in GS DSLibs. In particular it includes several variations of the "harrassed clerk" case study originally proposed by M. Pidd.
An usual criticism of the event-based approach is that modelling complex systems is hard because it is very difficult to manage all possible consequences of an event in a single routine (or method, object-orientedly speaking). The problem is also affecting the good practice of gradually develop and enhance a system model and its corresponding simulator, eventually making the event-based approach unsuitable for practical applications.
GS DSLibs, by proposing a novel modelling and code generation technique, based on UML and object orientations, overcomes this limitation still maintaining the conceptual simplicity of event-based analysis and modelling of systems and the great efficiency of the event-based simulator engine.
GS DSLibs is designed, implemented and maintained by G.A. Cignoni.
Status: sources beta released.
The Harassed Clerk Variations
The variations of the "harrassed clerk" case study are a practical example to show how it is possible to gradually develop and enhance a system model in several steps. Each step produces the simulator code by reusing lot of code of the previous steps and by introducing the necessary changes in new files or in very localized areas of already written code.
HClerk0, the original case study. The Harrassed Clerk is a classical case study for discrete simulation, the problem is formulated as follows:
HClerk1, 1st variation. This first variation of the case study parametrizes the system, gives goals to the simulation, and changes the "functional" behavior of the clerk active entity:
HClerk2a, 2nd variation, 1st implementation. This second variation of the Harassed Clerk case study introduces substantially different behaviors of the clients:
HClerk2b, 2nd variation, 2nd implementation. This is a different implementation of variation 2. Instead of using explicit states to manage the expired waiting time event, it uses the event withdraw feature provided by the GeneSim event engine.
HClerk3, 3rd variation. This third variation adds client generator active objects to generate desk arrivals and phone calls during simulation, without having to insert them in the event agenda before starting the simulation.
HClerk4, 4th variation. This fourth variation shows the usage of GeneSim random variables:
HClerk5, 5th variation. This fifth variation how to implement a simple logger to save data for simulation output analysis:
Copyright © 2006-2009 Giovanni A. Cignoni |