Simulator of Closed Queueing Networks
Saving & loading
This interactive simulator supports simulation based analysis of closed queueing
networks made of interconnected service stations.
does not support graphics (at least in a feasible way). That's why the simulator does not
visualize the network topology automatically, but you can display a file with network block diagram.
There can be a lot of data
for each service station. So the simulator always shows one
service station and global simulation results. For the selected service station the
simulator displays both distributions (see later), parameters, and simulation results.
There is a selection list in the Control panel, so it is very easy to switch among service stations. Optional report in a separate browser window contains
summary of all results. The first version of the simulator is based on these assumptions:
- There is only one class of customers. Initial numbers of customers in the
service stations are known. After each service a customer randomly enters another service station
including the one where the service just ended.
- Simulation starts in time 0 by starting first services of customers present
initially in the stations (according to the number of these customers and the
number of parallel channels).
- Service stations can have limited capacity. Customer entering a full station is lost.
- Service stations are made of a possibly limited queue and any number of parallel
identical channels. Service duration is random, state independent. Queue discipline is either
FIFO or LIFO. Load among channels is distributed evenly (no results are available for
- Routing of customers is represented by random destination that exists for each
service station. Destination is the service station number.
- Simulation experiment takes a certain time entered by the user.
All typical simulation results are supplied. Tables of user defined
random distributions, service stations, and the whole network
can be saved to cookies and loaded within one year. Next chapters describe the details.
- Prepare a chart with service stations numbered increasingly starting from 1 together with their
interconnection. This is not necessary, but useful for bigger networks. You can also
create a file (like net.gif), store it in your computer and display it in the help
window. To do this, press the Show button in the Network group in the
Control panel. (In some browsers
it is necessary to re-enter the file location in the Location Toolbar of the
- Create the service stations. These objects are created by simply
entering the required number in the Control panel. After (re)loadig the simulator,
2 stations are created automatically. Increasing the number adds more objects, decreasing
the number has to be confirmed because data can be lost. Objects are generated with these
default properties: unlimited FIFO queue, one service channel with exponential service
time with mean 1, all customers directed from station 1 to station 2 and from
station 2 back to station 1.
- Modify all objects that includes random routing after service. So the only
global parameter except simulation control is the number of
servers. Save longer user defined distribution tables or alternatively whole
stations. The whole network can also be saved.
- Set simulation control. Start with a shorter experiment length. Do not generate reports until all works well.
Speed of simulation depends on your computer and your browser. Typical PCs can simulate even
medium complexity networks with reasonable speed. For longer experiments uncheck the
status in the Control panel (updating the status bar takes a lot of time).
- Create reports for selected experiments. Generated documents can be saved, but
Copy-Paste to other documents with subsequent editing is probably the fastest way to use
the simulation results.
The window is divided into two panels. The Control panel
is used for simulation control, the Network panel displays properties of network
objects and all results. The Control panel contains the following inputs
organized into groups. For more details read the corresponding paragraphs.
- Button Run starts a simulation experiment. To start simulation all user defined distribution
tables must be confirmed.
- Button Help displays this text.
- Selection Server is used to select the service station displayed in the network panel.
After increasing/decreasing the number of stations the selection list is updated.
- Input Duration is used to enter the experiment length. Time is expressed in abstract
units interpreted by the user.
- Check the box Report if you want a summary report in a separate browser window.
- Uncheck the box Status to turn off updating of the status bar (experiments will run much faster).
- Button Randomize initializes the seeds of all random generators.
- Button Record stores the current values of seeds in RAM.
- Button Restore restores the seeds from the values recorded in
- Button Show prompts for the network diagram file location and displays it in this
help window. To display local files in some browsers, the file location has to be entered
- Button Save saves the whole network in a cookie.
- Button Load loads the network from a cookie.
- Input Servers is used to enter the total number of service stations. New objects are
created with default properties, deleting has to be confirmed.
- Button Show displays the content of a cookie.
- Button Delete removes a cookie.
Servers have these parameters:
Server results are accompanied by Note buttons displaying a detailed explanation.
- Distribution of Service Duration is the distribution of random service times.
Select either a theoretical distribution with appropriate parameters or enter a table
of an empirical (user defined) distribution. Help on entering a table is available. Table can also
be loaded. Note that all channels of a service station have the same service
time distribution .
- Routing of Departures is a user defined distribution with discrete generation. The
values are numbers of target service stations (rounded and checked for range).
- Number of channels is the number of equal parallel servers.
- Initial number of customers is the number of customers waiting
initially in the queue.
- Select unlimited or limited queue length with maximum length for the
second case. Note that maximum queue can be zero. Note also that system
capacity is interpreted as the maximum queue plus the number of
- Queue organization can be selected (FIFO or LIFO).
System (global) results are displayed at the end of each simulation experiment.
For closed networks global results are limited to just the total numbers of
initially present and lost customers. Check Report in the Control panel to generate a summary of all results in a separate browser window.
Saving & loading
You can save tables of user defined distributions, individual
service stations and the whole network. The Save buttons save the objects to a
cookie. All saved objects are given unique names. Confirm this default name
or enter any other. So for example you can save a long table
both under the default name and another short name. Then it can be fast loaded for all
tables with the same distribution. Loading also offers the default name that can be
modified. Table status and generation mode (continuous/discrete)
are also saved. If possible, save confirmed consistent tables.
The cookie expiration is one year, then the cookie will be deleted by the browser.
Check (save and immediately load) whether your browser does not disable cookies.
Unfortunately browsers limit the cookie size (4KB) and the number of cookies per server
or domain (maximum 20). So it can happen that some cookies are deleted during a session
(if more than 20 cookies are saved) or truncated during one saving operation (when saving
a large network). Distribution tables and service stations are saved in distinct
cookies. The whole network is also saved in one cookie. If the network name is "n1", the
cookie is called "n1s". To check whether
the network has been saved:
- save the network
- modify slightly the last service station
- load the network and check whether the last station has been restored.
Note that sometimes browsers behave strange with respect to processing cookies.
In the Control panel there is a section Cookies where you can view and delete
cookies of this document. Ignore the values of cookies, just note the names that are
followed by "=". Deleting is implemented by setting expiration time to
yesterday - cookie is then deleted by the browser.
There are two separate underlying random generators for each
service station, one for service times and one for output routing. The seeds are
initialized (randomized) at document loading and after entering the number of
servers (even the same number as the current one). You can also randomize the
seeds manually. The current values of the two
seeds are saved with the station, all seeds are saved with the network. Loading
of course includes the seeds. So after loading a network you obtain identical
results as with the experiment performed just after saving the network. When
starting the experiments the seeds are not updated. So if the seeds are neither
restored nor randomized, each experiment starts
with the seeds left by the previous one.
You can also
record the seeds in RAM. The values are first recorded at document loading and after entering the number of
servers (even the same number as the current one). Then you can record and
restore the seeds at any time. Use this facility especially if there are
problems with cookies.
So unless the seeds are restored,
repeated experiments provide various results. Reduce the
variance by increasing the experiment duration.
Note that the native JSSim generator is the so-called Linear
Congruential Generator (LCG) known by the name MINSTD (Minimum Standard) that
passed all usual tests. See the code for the values of the constants. You can change the
values assigned in the head code of jssim.js if you prefer another