Bahan Ajar Minggu 4 Simsis
Bahan Ajar Minggu 4 Simsis
Simulasi Sistem
Discrete-Event Simulation
Tatap
Fakultas Program Studi Kode MK Disusun Oleh
Muka
Fakultas Teknik Teknik Industri 05610001 Dr. Nova Indah Saragih, S.T., M.T.
04
Abstrak Kompetensi
Modul ini membahas pengertian Mahasiswa mampu menjelaskan
simulasi kejadian diskrit beserta konsep simulasi kejadian diskrit.
contoh-contohnya.
1
Discrete-Event Simulation
Example 1
2
Correspondingly, a departure is an event because it causes the server status to
change from busy to idle or the number of customers in the queue to decrease
by 1.
In the above example both types of events actually changed the state of the
system, but in some discrete-event simulation models events are used for purposes
that do not actually effect such a change. For example, an event might be used to
schedule the end of a simulation run at a particular time or to schedule a decision
about a system's operation at a particularn time and might not actually result in a
change in the state of the system. This is why we originally said that an event may
change the state of a system.
1. Time-Advance Mechanisms
Historically, two principal approaches have been suggested for advancing the
simulation clock: next-event time advance and fixed-increment time advance.
Since the first approach is used by all major simulation languages and by most
people coding their model in a general-purpose language, and since the second
is a special case of the first, we shall use the next-event time-advance
approach for all discrete-event simulation models discussed in this book.
3
updated to account for the fact that an event has occurred, and our knowledge
of the times of occurrence of future events is also updated. Then the
simulation clock is advanced to the time of the (new) most imminent event,
tbe state of the system is updated, and future event times are determined, etc.
This process of advancing the simulation clock from one event time to another
is continued until eventually some prespecified stopping condition is satisfied.
Since all state changes occur only at event times for a discrete-event
simulation model, periods of inactivity are skipped over by jumping the clock
from event time to event time. (Fixed-increment time advance does not skip
over these inactive periods, which can eat up a lot of computer time) It should
be noted that the successive jumps of the simulation clock are generally"
variable (or unequal) in size.
Example 2
4
A1 from FA and adding it to 0. The simulation clock is then advanced from eo
to the time of the next (first) event, e1 = t1. Since the customer arriving at time
t1 finds the server idle, she immediately enters server and has a delay in queue
of Dt = 0 and the status of the server is changed from idle to busy. The time,
c1, when the arriving customer will complete service is computed by
generating S1 froni Fs and adding it to t1. Finally, the time of the second
arrival, t2, is computed as t2 = t1 + A2, where A2 is generated from FA . If t2 < c1
as depicted in Fig. 1, the simulation clock is advanced from e1 to the time of
the next event, e2 = t2 (If c1 were less than t2 the clock would be advanced -
from e1 to c1). Since the customer arriving at time t2 finds the server already
busy, the immber of customers in the queue is increased from 0 to 1 and the
time of arrival of this customer is recorded; however, his service time S2 is not
generated at this time. Also, the time of the third arrival, t3 is computed as t3 =
t2 + A3. If c1 < t3, as depicted in the figure, the simulation clock is advanced
from e2 to the time of the next event, e3 = c1, where the customer completing
service departs, the customer in the queue (i.e. the one who arrived at time t2)
begins service and his delay in queue and service-completion time are
computed as D2 = c1 - t2 and c2 = c1 + S2 (S2 is now generated from Fs), and
the number of customers in the queue is decreased from 1 to 0. If t3 < c2 , the
simulation clock is advanced from e3 to the time of the next event, e4 = t3 , etc.
The simulation might eventually be tenninated when, say, the number of
customers whose delays have been observed reaches some specified value.
5
Although simulation has been applied to a great diversity of real-world
systems, discrete-event simulation models all share a number of common
components and there is a logical organization for these components that
promotes the coding, debugging, and future changing of a simulation model's
computer program. In particular, the following components will be found in
most discrete-event simulation models using the next-event time-advance
approach:
6
check for termination and invoke the report generator when the simulation
is over.
1) the system state is updated to account for the fact that an event of type
i has occurred;
2) information about system performance is gathered by updating the
statistical counters; and
3) the times of occurrence of future events are generated and this
information is added to the event list.
7
Before concluding this section, a few additional words about the system state
may be in order. A system is a well-defined collection of entities. Entities are
characterized by data values called attributes, and these attributes are part of
the system state for a discrete-event simulation model. Furthermore, entities
with some common property are often grouped together in lists (or files or
sets). For each entity there is a record in the list consisting of the entity's
attributes, and the order in which the records are placed in the list depends on
some specified rule. For the single-server queueing facility of Examples 1 and
2, the entities are the server and the customers in the facility. The server has
the attribute "server status" (busy or idle), and the custo·mers waiting in queue
have the attribute "time of arrival." . (The number of customers in the queue
might also be considered an attribute of the server.)
8
Figure 2. Flow of control for the next-event time-advance approach
Sumber:
1. Law, A.M. and Kelton, W.D. (1991): Simulation Modeling And Analysis,
McGraw-Hill.