Professional Documents
Culture Documents
01
1. Calling Population: In the single-channel queue, the calling population is infinite; that is, if a
Unit leaves the calling population and joins the waiting line or enters service; there is no change in the
arrival rate of other units that may need service.
2. The Arrival process: Arrivals for service occur one at a time in a random fashion; once they join
the Waiting line, they are eventually served.
3. The Service Mechanism: The service times are of some random length according to a
probability distribution which does not change over time.
4. The system capacity: The system capacity has no limit, meaning that any number of units can
wait in line.
5. Queueing Discipline: units are served in the order of their arrival (often called FIFO: first in, first
out) by a single server or channel.
Arrivals and services are defined by the distribution of the time between arrivals and the
distribution of service times, respectively. For any simple single or multi-channel queue, the overall
effective arrival rate must be less than the total service rate, or the waiting line will grow without bound.
When queues grow without bound, they are termed as explosive or unstable.
Prior to introducing several simulations of queueing systems, it is neces- sary to understand the concepts
of system state, events, and simulation clock.
1. System state: The collection of variables describes the system at any time.The state of the system is
no.of units in the system and the status of the server, busy or idle.
2. Event: An event is a set of circumstances that cause an instantaneous change in the state of the
system.
In a single-channel queueing system there are only two possible events that can affect the state of the
system.
-They are the entry of a unit into the system (the arrival event).
-The completion of service on a unit (the departure event).
The queueing system includes the server, the unit being serviced (if one is being serviced), and units in
the queue (if any are waiting). The simulation clock is used to track simulated time.
If a unit has just completed service, the simulation proceeds in the manner
shown in the diagram of Figure 2.2. Note that the server has only two
possible states: it is either busy or idle.
The arrival event occurs when a unit enters the system. The diagram For the arrival event is shown in
Figure 2.3.
Problem Statement:
Single-Channel Queue
A small grocery store has only one checkout counter. Customers arrive at this checkout counter at
random from 1 to 8 minutes apart. Each possible value of interarrival time has the same probability of
occurrence, as shown in Table.1.
The service times vary from 1 to 6 minutes with the probabilities shown in Table 2. The problem is to
analyze the system by simulating the arrival and service of 20 customers.
EXPERIMENT NO. 02
Step2.If Able is idle; customer K begins service with Able at the current time Tnow.
Able’s service completion time, Tfin, A is given by Tfin, A=Tnow+Tsvc, A where Tsvc, A is
the service time generated from Able’s Service time distribution.
Customer’s K’s time in system, Tsys is given by Tsys=Tfin, A-Tk.
Because Able was idle, Caller K’s delay, Twait, is given by Twait=0.
If Able is busy, but Baker is idle, Customer K begin service with Baker at the
current time Tnow. Baker’s Service completion time, Tfin, B is given by Tfin,
B=Tnow+Tsrc, B where Tsrc, B is the service time generated from Baker’s Service time
distribution.
Customer’s K’s time in system, Tsys is given by Tsys=Tfin, B-Tk.
Because Baker was idle, Customer K’s delay, Twait, is given by T=0.
Step3. If Able & Baker are both busy, then calculate the time at which the first one
become available, as follows:
Tbeg=Min (Tfin, A, Tfin, B).
Customer K begins service at Tbeg.when service for caller K begins, set Tnow=Tbeg.
Then compute Tfin, A and Tfin, B as in step2.
Customer K’s time in sytem, Tsys, is given by Tsys=Tfin, A-Tk or Tsys=Tfin,B-Tk as
appropriate.
Problem Statement:
The Able Baker Carhop Problem
This example illustrates the simulation procedure when there is more than one service channel.
Consider a drive-in restaurant where carhops take orders and bring food to the car. Cars arrive in the
manner shown in Table.1
There are two carhops.Able and Baker. Able is better able to do the job and works a bit faster than Baker.
EXPERIMENT NO. 03
Notice that in the second cycle, the amount in inventory drops below zero, indicating a shortage.
In Figure, these units are backordered; when the order arrives, the demand for the backordered
items is satisfied first. To avoid shortages, a buffer, or safety, stock would need to be carried.
Carrying stock in inventory has an associated cost attributed to the interest paid on the
funds borrowed to buy the items (this also could be considered as the loss from not having the
funds available for other investment purposes).
Other costs can be placed in the carrying or holding cost column: renting of storage space,
hiring guards, and so on.
An alternative to carrying high inventory is to make more frequent reviews, and consequently,
more frequent purchases or replenishments. This has an associated cost: the ordering cost.
Also, there is a cost in being short. Customers may get angry, with a subsequent loss of good
will. Larger inventories decrease the possibilities of shortages. These costs must be traded off in
order to minimize the total cost of an inventory system.
The total cost (or total profit) of an inventory system is the measure of Performance.
In M-N inventory system, the events that may occur are:
1. The demand for items in the inventory
2. The review of the inventory position
3. The receipt of an order at the end of each review period.
When the lead time is zero, as in Figure, the last two events occur simultaneously.
Problem Statement:
Problem Statement:
A large milling machine has three different bearings that fail in service. The cumulative
distribution function of the life of each bearing is identical, as shown in Table 1.
When a bearing fails, the mill stops, a repairperson is called, and a new bearing is installed.
The delay time of the repairperson's arriving at the milling machine is also a random
variable, with the distribution given in Table 2.
Downtime for the mill is estimated at $5 per minute. The direct on-site cost of the
repairperson is $15 per hour. It takes 20 minutes to change one bearing, 30 minutes to
change two bearings, and 40 minutes to change three bearings. The bearings cost $16
each. A proposal has been made to replace all three bearings whenever a bearing fails.
Management needs an evaluation of this proposal. The total cost per 10000 bearing-hours
use as the measure of performance.
Simulate the problem for life of machine is upto 20000 hours under the current and
proposed method.
EXPERIMENT NO. 06
Problem Statement:
Lead Time Demand:
A firm sells bulk rolls of newsprint. The daily demand is given by the following probability
distribution:
EXPERIMENT No. 07
Title: Study of Project Simulation (An activity network).
Theory & concept:
Any project that requires the completion of a number of activities, some activities must
be carried out sequentially; others can be done in parallel. The project can be represented by
network of activities, as shown in figure below:
U(2,4) B
A
U(2,4)
U(2,4)
Start Finish
U(3,6) C U(3,6)
U(6,12)
There are three paths through the network, each path representing a sequence of activities that
must be completed in order. The activities on two different paths can be carried out in parallel.
In the activity network the arcs represent activities and the nodes represent the start and
end of an activity.The time to complete all activities on a path is the sum of the activity times
along the path. To complete the entire project, all activities must be completd; therefore, project
completion time is the maximum over all path completion times.
The Time to accomplish each of the activities in project is variable and can be represented
by a uniform distribution between a lower and upper limit as shown in the figure.
The activity times are shown on the arcs of the activity network, the activity time from start
A is assumed to be uniformly distributed between 2 and 4 minutes.that means that all times
between 2 and 4 are equally likely to occur. The Expected value or mean time for this activity is
the midpoint, three minutes.
Applying that logic, the expected value along the topmost path is 9 minutes which is
determined by adding the three expected values (3+3+3). The shortest possible completion
time, which is determined by adding the smallest values, is 6 minute (2+2+2). The largest
possible time along the top path is 12 minute (4+4+4).
Activity times are to have some random variability; the times through the path are not
constant.project analyzed with simulation independent replications of the activity time. For a
uniform distribution, a simulated activity time is given by
Simulated activity time= lower limit + (Upper limit-Lower limit) * random number.
The critical path is the path that takes the longest time; that is; its time is the project completion
time.
EXPERIMENT NO. 08
Title: Write a program to perform the K-S Test
N
As N become larger, SN(x) should become approximate to F(x), provided that the null
hypothesis is true.
The K-S Test is based on the largest absolute deviation between F(x) and SN(x) over the
range of the random variable i.e. it is based on the statistic
D = max F (x)-SN(x)
The sampling distribution of D is known, for testing against the uniform CDF, the test
procedure follows these steps:
Step 1. Rank the data from smallest to largest. Let R(i) denote the ith smallest
observation, so that R(1)<=R(2)<=……<=R(N)
Step 2. Compute {
D+=MAX (i/N)-R(i) }
1<=i<=N
{
D-=MAX R(i)-(i-1)/N }
1<=i<=N
Step 3. Compute D=max (D+, D-)
Step 4. Locate the critical value, Da for the specified significance of level a and the given
sample size N.
Step 5. If the sample statistic D is greater than the critical value, Da, the null hypothesis
that the data are a sample from a uniform distribution is rejected. If D<=Da, conclude that no
difference has been detected between the true distribution of {R1, R2, … RN} and the
uniform distribution.
Problem Statement:
For the given five numbers 0.44, 0.81, 0.14, 0.05, 0.93. Determine whether the number are
uniformly distributed or not with the level of significance alpha=0.05 by using K-S test.
[Dα=0.565]
EXPERIMENT No. 09
Where O is the observed number in the ith class, E is the expected number in the ith class and
n is the number of classes. For the uniform distribution, E, the expected number in each class is
given by
Ei=N/n
For equally spaced classes, where N is the total number of observations. It can be shown that
the sampling distribution of Chi-square is approximately the chi-square distribution with n-1
degree of freedom.
Problem Statement:
For the given 100 numbers determine whether the numbers are uniformly
distributed or not with the level of significance =0.05 .
Given:
n (Number of classes)=10
N (Total Number of observations) =100
0.34 0.90 0.25 0.18 0.89 0.87 0.44 0.12 0.21 0.46
0.67 0.83 0.76 0.79 0.64 0.70 0.81 0.94 0.74 0.22
0.74 0.96 0.99 0.77 0.67 0.56 0.41 0.52 0.73 0.99
0.02 0.47 0.30 0.17 0.82 0.56 0.05 0.45 0.31 0.78
0.05 0.79 0.71 0.23 0.19 0.82 0.93 0.65 0.37 0.39
0.42 0.99 0.17 0.99 0.46 0.05 0.66 0.10 0.42 0.18
0.49 0.37 0.51 0.54 0.01 0.81 0.28 0.69 0.72 0.30
0.73 0.84 0.40 0.78 0.34 0.43 0.94 0.05 0.24 0.19
0.29 0.75 0.56 0.96 0.06 0.40 0.79 0.11 0.49 0.97
0.58 0.39 0.64 0.62 0.60 0.47 0.64 0.88 0.97 0.26
EXPERIMENT No. 10
GPSS World is sequence of model statements. A Model Statement may be a GPSS Statement
or a PLUS Procedure definition. A GPSS Statement is either a Command or a Block Statement.
PLUS is an acronym for the Programming Language under Simulation, GPSS World’s
embedded programming language. PLUS Experiments are a kind of Procedure.
GPSS statement:
Operands
Statements usually have one or more operands which you must fill in. Most operands have
several different forms which are valid. In the descriptions which follow, a valid class of operands
may be described by an italicized word. You must choose a member of the class and type it into
the Operand field. For example, if one of the valid forms of an operand is given as PosInteger,
you could type:
21
Windows
A wide variety of windows are available for you to observe the effects of Commands on
your simulations. In general, windows are specialized by the entity type.