ASKDEMO.MOD

From Support

Jump to: navigation, search

Back to Model Library

See also: How to read .MOD pages

Contents

Description

ASKDEMO.MOD is a simple queueing model that demonstrates the use of the ASK{X} function, which allows you to change the value of the expression, X, during a run. SIGMA will prompt you for the change; you can enter any expression. Pressing the Enter key on your keyboard without inputting an expression results in no changes being made.

In ASKDEMO.MOD, the ASK function can be used to set a value for the variable, QUEUE, from the keyboard whenever a customer enters. The default expression for the state change when a customer enters is QUEUE=QUEUE+1. If you enclose the right-hand side of this equation with the ASK function, i.e., QUEUE=ASK{QUEUE+1}, you can enter any valid expression or number for the new value of QUEUE that you desire. Of course, you do not need to be prompted by the ASK to change a running model in SIGMA. Just double-click on an edge or vertex and enter the changes in the dialog box (see AIRPORT.MOD for another example of this).

Besides allowing interactive simulation (gaming), the ASK function is very useful in debugging a model. You can try various values of variables while your model is running and see when the logic breaks down. For example in ASKDEMO.MOD, if the server is idle and you enter a value of zero when a customer ENTERs, you will have created a "phantom" customer arrival. This will subsequently cause the QUEUE to become negative when this customer (who did not join the QUEUE) later LEAVEs!

Another use of the ASK function is illustrated in FUNCDEMO.MOD.

State Variables

State Variables in ASKDEMO.MOD
Variable Name Abbreviation Variable Description Size Type
QUEUE Q Number of customers in line 1 Integer
SERVERS S Server is available/busy = 1/0 1 Integer

Vertices

Vertices in ASKDEMO.MOD
Vertex Name Vertex Description State Changes
RUN The simulation is started S=1
ENTER Arrival of a customer Q=ASK{Q+1}
START Start of service S=0, Q=Q-1
LEAVE End of Service S=1

Initialization Conditions

Initialization Conditions in ASKDEMO.MOD
Variable Description
QUEUE Initial number of customers in line

Event Relationship Graph

ASKDEMO.MOD
ASKDEMO.MOD

English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

The SIGMA Model, ASKDEMO.MOD, is a discrete event simulation. 
It models QUEUE.MOD WHERE SIZE OF QUEUE IS ASK FOR  .
I. STATE VARIABLE DEFINITIONS.
For this simulation, the following state variables are defined:
QUEUE: NUMBER OF CUSTOMERS IN LINE   (integer valued)
SERVER: SERVER IS AVAIL/BUSY = 1/0   (integer valued)
II. EVENT DEFINITIONS.
Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.  
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships 
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.  
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
1. The RUN(QUEUE) event occurs when INITIALIZATION OF THE QUEUE AND SERVER.
   Initial values for, QUEUE, are needed for each run.
   This event causes the following state change(s):
   SERVER=1
   After every occurrence of the RUN event:
   Unconditionally, INITIATE THE FIRST CUSTOMER ARRIVAL;
   that is, schedule the ENTER() event to occur without delay.
2. The ENTER() event occurs when ARRIVAL OF A CUSTOMER.
   This event causes the following state change(s):
   QUEUE=ASK{QUEUE+1}
   After every occurrence of the ENTER event:
   Unconditionally, SCHEDULE THE NEXT ARRIVAL;
   that is, schedule the ENTER() event to occur in 4*ERL{1} time units.
   (Time ties are broken by an execution priority of 4.)
   If SERVER==1, then START SERVICE WITH THE IDLE SERVER;
   that is, schedule the START() event to occur without delay.
3. The START() event occurs when START OF SERVICE.
   This event causes the following state change(s):
   SERVER=0
   QUEUE=QUEUE-1
   After every occurrence of the START event:
   Unconditionally, THE CUSTOMER WILL BE IN SERVICE FOR 5 MINUTES;
   that is, schedule the LEAVE() event to occur in 1 time units.
4. The LEAVE() event occurs when END OF SERVICE.
   This event causes the following state change(s):
   SERVER=1
   After every occurrence of the LEAVE event:
   If QUEUE>0, then SERVICE THE WAITING CUSTOMER;
   that is, schedule the START() event to occur without delay.
   (Time ties are broken by an execution priority of 4.)

Comments

Back to top

Back to Model Library

Personal tools
Navigation