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.

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:

  • one clerk, many clients, clients ask services at the clerk desk or by phone;
  • clerk always gives priority to desk clients;
  • clients are characterized by arrival time and service time.
In this first implementation clients are predefined and their arrivals are scheduled before starting the simulation.

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:

  • improved service policy, priority is given to the desk clients until the waiting phone calls are more than the desk clients plus a given threshold;
  • simulation keeps count of total service times of desk and phone clients;
  • simulation keeps count of the clerk total idle time.

HClerk2a, 2nd variation, 1st implementation. This second variation of the Harassed Clerk case study introduces substantially different behaviors of the clients:

  • clients are characterized also by the time they intend to wait;
  • phone clients hang up when their waiting time expires;
  • desk clients, when their waiting time expires, decide to leave by evaluating their position in the queue;
  • simulation keeps count of clients that are leave or hang up, and of clients that, with respect to their wishes, are served timely or late.
In this implementation of variation an explicit state is used to manage the expired waiting time event when the client is happily served.

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:

  • the simulator uses defined distributions to generate clients attributes like service time, waiting time and perceived good position in the queue (for desk clients only)
  • the simulator uses customizable distributions to generate arrivals of desk clients and calls of phone clients.

HClerk5, 5th variation. This fifth variation how to implement a simple logger to save data for simulation output analysis:

  • the simulator collects data about lenght of queues and about clerk idle time;
  • data are logged at defined time intervals.

 


Creative commons By-Nc-Sa 2.5 It Copyright © 2006-2009 Giovanni A. Cignoni