To describe the general setup of a simulation in jasima we will use the example of a single server queue model.
In this model there is a single server processing incoming jobs/service requests. The server can process at most one job at a time, if it is busy, incoming requests have to wait in a queue (of unlimited capacity) until they can be served. Service times and also the arrival process of new jobs are characterized by an exponential distribution.
Exponential distributions are characterized by a single parameter, hence our model is characterized by the two parameters μ for the service time and λ for the interarrival times, i.e., the time between the arrival of two consecutive jobs.
To explain the most important aspects of creating a simulation in jasima we use this M/M/1 model as an example. In the project_template_standalone there are two versions of this model. A first version in the package examples.simulation.events
uses a purely event-based approach. Process-oriented simulation features are used in the example available in the package examples.simulation.process
. Both modelling styles are supported in jasima and can be freely mixed, i.e., certain simulated components can use event-oriented, others process-oriented modelling. The two styles can even be mixed in a certain component: an event-oriented SimComponent
can activate its own SimProcess
es if it wants to and still react to plain simulation events.
Both versions of the model do the same thing, both have two parameters. One is the number of jobs to be created, defining the simulation length. After the last job was created, the simulation is stopped. The second parameter is the so-called traffic intensity. We don’t parameterize the model using μ and λ. Instead we fix μ at 1 and use the traffic intensity to specify λ. The traffic intensity is a value in the interval (0, 1). A traffic intensity of say 0.85 will lead to a server that is utilized 85% of the time in the long run. For shorter simulation runs server utilization can deviate considerably from this value due to the random influences in the model.
The following topics are demonstrated in the examples and further explained on separate pages:
basic elements and features of event-based models and simulation components
basic elements and features of process-oriented models and components
random number handling, i.e., creating and using random number streams usually derived from jasima.core.random.continuous.DblSequence
Additional concepts not used in the simple M/M/1 example but frequently used in simulation models are explained on separate pages:
waiting on certain conditions, also known as state-base events
collecting statistics with jasima.core.statistics.SummaryStat
and jasima.core.statistics.TimeWeightedSummaryStat
Besides simulations, experiments are usually an important component in a jasima project. An experiment is basically a function: it has parameters, gets executed and produces results. Experiments can be used independently of simulations; there is a SimulationExperiment
, but this is just one particular type of experiment.
The most important types and uses of Experiment
s are explained in Running Experiments. Creating custom experiments is also explained using the example of a very simple Monte-carlo simulation.