1.8 Overview of the Java Simulation Library
The JSL (a Java Simulation Library) is a simulation library for Java. The JSL’s current version has packages that support random number generation, statistical collection, basic reporting, and discrete-event simulation modeling.
The purpose of the JSL is to support education and research within simulation. Current simulation languages hide the implementation details of the workings of a simulation. As such, students exposed to a simulation language such as (ProModel, Arena, and AutoMod, etc.) are able to learn the practice of simulation without having a detailed understanding of the fundamental mechanisms that enable the technology. This has both advantages and disadvantages. The advantage is that more engineers are capable of using and applying simulation technology to improve systems. The disadvantage is that their modeling abilities depend heavily on a particular software package and simulation modeling has the potential to become a black-box technology. I’ve seen many users who can build complicated models, but have limited or no understanding of how the simulation actually works.
When teaching simulation, especially at the undergraduate level, simulation languages enable students with introductory programming skills to model systems and perform experiments. Within a typical introductory semester course on simulation it is possible to cover the basics of simulation (random numbers, modeling, and statistical analysis) along with the coverage of a tool (Arena, ProModel, AutoMod, etc.) It is difficult to teach students how simulation works based on a general purpose programming language due to the reduced emphasis on more advanced programming skills especially for non-computer science majors. The JSL assists in bridging this gap by providing a standard library in Java for simulation modeling. One of the fundamental design goals of the JSL is to clearly demonstrate how one can implement the fundamental mechanisms that enable simulation technology. By studying the implementation details students will gain a deeper understanding of how simulation works. They will become better simulation modelers, practitioners, and users of commercial simulation languages.
The JSL also supports research within simulation. Naturally, the JSL can be used as a modeling tool to simulate complex systems. Simulators, such as a Supply Chain Simulator, can be built based on the JSL framework. In addition, the design of the JSL provides a framework for the testing of simulation artifacts through a well-defined class and interface hierarchy. The structure of the JSL permits the easy switching of various components within a simulation, the event calendar, random number generator, statistics, etc. For example, the efficiency of different event calendars can be easily tested by simply providing an event calendar to the JSL that implements the interface CalendarIfc. Different algorithms can be “plugged into” the framework for testing.
This document presents an overview of a simulation library for Java (JSL). The library is divided into Java packages (calendar, examples, exceptions, modeling, observers, testing, and utilities). As necessary, these packages may contain sub-packages, which implement various aspects of the library. The JSL is organized as three open source projects: JSLCore, JSLExamples, and JSLExtensions. Each of these projects is further organized into java packages.
JSLCore - jsl is the main package that holds all sub-packages
- calendar - The calendar package implements classes that provide event calendar processing
- simulation - The simulation package implements the main classes involved in constructing and running simulation.
- modeling - The modeling package is the heart of the JSL. In the modeling package, supporting model elements such as queues, resources, variables, commands, etc. are implemented. This package will be discussed in detail in this document.
- observers - The observers package provides support classes for observing model elements during the simulation run. The JSL is designed to allow each model element to have observers attached to it thereby implementing the classic Observer pattern. Observers can be used to collect statistics, write output to files, display model element state, etc. Proper understanding of the observer pattern is essential in maximizing the use of the JSL.
- utilities - The utilities package provides support classes that are used by the JSL. The random, statistics, reporting, and database related sub-packages will be discussed in this document.
JSLExtensions - jslx is the main package that holds all sub-packages
- dbutilities - The dbutilities package provides support for using databases with the JSL. It also includes some functionality related to csv and Excel files
- fxutilities - The fxutilities provides some simple support for javaFx
- statistics - The statistics package provide additional statistical functionality that leverages the additional classes available within the jslx package.
JSLExamples - examples is the main package that holds all sub-packages
- entity - examples related to modeling entity flow and process description
- hospitalward - an example of modeling a hospital ward
- inventoy - some simple inventory policy models
- jobshop - models the classic job shop example from Law and Kelton’s textbook
- jockeying - models queues with jockeying of customers
- modelelement - examples related to the use of model elements
- models - many example models
- montecarlo - examples focused on using random numbers and Monte Carlo methods
- queueing - examples related to systems involving queues
- resource - examples that illustrate resource constructs
- spatial - examples related to the spatial package in JSLCore
- station - examples illustrating the station package in JSLCore
- utilities - miscellaneous examples of using constructs in the utilities
- variables - examples of using variables within models
The purpose of the JSL is to provide support for the development of discrete-event simulation programs within Java. This document provides and overview of the functionality and use of the classes found within the JSL. Additional information is available through the JavaDoc API. We begin our discussion with the utilities package within the JSLCore. These support packages can be used independently of building discrete-event simulation models.