06-Simulasi Singgle Server

Preview:

DESCRIPTION

simulasi single server

Citation preview

SIMULASI SISTEM ANTRIAN SINGLE SERVER

• Sistem antrian merupakan keadaan dari satu atau lebih pelayanan yang memberikan servis kepada beberapa pelanggan yang datang.

• Sistem antrian memiliki tiga karakteristik, yaitu :1. arrival process 2. inter arrival time3. arrival rate

Simbol-simbol.

a departing costumer

server

costumer in service

costumer in queue

an arriving custumer

• Contoh sistem antrian yaitu di bank, rumah sakit , line manufaktur.

• Aturan antri diantaranya adalah :1. FIFO : costumer yang datang pertama adalah yang dilayani pertama.2. LIFO : costumer yang datang terakhir adalah yang dilayani pertama.3. priority : costumer dilayani berdasarkan atas prioritas kepentingan atau keperluan

Definisi Masalah

• Sistem antrian satu server dengan:

A1, A2, waktu antara kedatangan customer; merupakan variabel independen dan terdistribusi identik.

• Cara pelayanan: FIFO (first in, first out); jika customer datang dan server sedang idle, langsung dilayani.

S1, S2, waktu yang diperlukan server untuk melayani customer (tidak termasuk waktu tunggu customer di antrian). Variabel ini acak dan independen terhadap A.

Pengukuran kinerja

1.Delay rata-rata ekspektasi di antrian yang dialami n customer d(n).

2.Jumlah customer rata-rata ekspektasi pada antrian (tidak termasuk yang sedang dilayani) q(n).

3.Utilisasi server ekspektasi u(n)

Delay rata-rata ekspektasi

• Kata “ekspektasi” di atas berarti: pada waktu jalannya simulasi, delay rata-rata yang sebenarnya bergantung pada waktu antara datangnya customer (interarrival time) dan waktu pelayanan (service time) yang keduanya merupakan variabel acak. Dengan demkian, delay rata-rata juga merupakan variabel acak. Yang ingin diestimasi adalah nilai ekspektasi dari variabel acak ini.

• Jika ada n customer dengan delay D1, D2, , Dn,

n

Di

i=1

d(n) =

n

Tidak tertutup kemungkinan adanya customer yang mengalami delay 0 karena langsung dilayani.

Jumlah customer rata-rata ekspektasi

Pengukuran ini dilakukan dalam waktu kontinu dan bukan diskrit seperti delay di atas.Besaran-besaran yang dipakai:q(n) = jumlah rata-rata customer di antrian.Q(t) = jumlah customer di antrian pada waktu t; t 0. (Tidak termasuk customer yang sedang dilayani).T(n) = waktu untuk meneliti n delay.pi = proporsi (antara 0 dan 1) Q(t) = i.

q(n) = i pi

i=0pi = proporsi waktu yang terobservasi pada waktu simulasi di mana ada i customer di antrian.

q(n) dari simulasi:

q(n) = i pi

i=0Ti = waktu total simulasi di mana panjang antrian

adalah i. i Tii=0

q(n) =T(n)

Gambar berikut ini mengilustrasikan jalur waktu, atau realisasi dari Q(t) untuk sistem ini dengan n = 6.

Customer datang pada waktu 1.6, 2.1, 3.8, 4.0, 5.6, 5.8, dan 7.2.

Waktu pergi customer (pelayanan selesai) adalah 2.4, 3.1, 3.3, 4.9, dan 8.6, dan simulasi berakhir pada waktu T(6) = 8.6.

Untuk menghitung q(n), harus dihitung dulu Ti yang dapat dibaca dari grafik pada interval di mana Q(t) ama dengan 0, 1, dst:T0 = (1.6-0.0) + (4.0-3.1) + (5.6-4.9) = 3.2T1 = (2.1-1.6) + (3.1-2.4) + (4.9-4.0) + (5.8-5.6) = 2.3T2 = (2.4-2.1) + (7.2-5.8) = 1.7T3 = (8.6-7.2) = 1.4 i Ti = (0x3.2) + (1x2.3) + (2x1.7) + (3x1.4) = 9.9i=0

dengan demikian estimasi dari jumlah di antrian rata-rata waktu pada simulasi ini adalah

q(6) = 9.9/8.6 = 1.15

Utilisasi server ekspektasi

• Besaran ini merupakan pengukuran seberapa sibuknya server. Utilisasi ekspektai server adalah proporsi waktu simulasi (dari waktu 0 sampai T(n)) di mana server bekerja (tidak idle), sehingga merupakan angka antara 0 dan 1.

Didefinisikan “busy function” (fungsi sibuk):

B(t) = 1 jika server sibuk pada waktu t

= 0 jika server idle (menganggur) pada saat t

(3.3 - 0.4) + (8.6 - 3.8) 7.7

u(n) = = = 0.90

8.6 8.6

17

Cth 1: Simulasi antrian dengan 1 pelayan

Pejabat kantor pos menyediakan satu counter untuk pelanggan yang berurusan dg membayar tagihan, membeli perangko, dsbnya. Terdapat seorang staf bertugas melayani pelanggan.

Katakan :• waktu antara kedatangan pelanggan : acak (1-

6 menit).• Waktu pelayanan pelanggan :(1-4 minit).• Dibangkitkan RN sbg berikut :

18

Rentang antar Kedatangan pelanggan

Waktu antara kedatangan

Prob Prob. Kumulatif Range Bil Random

123456

0.150.200.350.150.100.05

0.150.350.700.850.951.00

01-1516-3536-7071-8586-9596-00

19

• Cth: Bila RN = 91 maka waktu keadatangan : 5 min• Beriktu akan disajikan contoh penggunaan RN utk, waktu

antar kedatangan dan waktu pelayanan.

Waktu pelayanan

Prob Prob Kumulatif Nombor rawak

1234

0.250.250.250.25

0.250.500.751.00

01-2526-5051-7576-00

Rentang Pelayanan pelanggan

20

• Waktu antar kedatangan – Pelanggan pertama pada t=0

Pelanggan 1 2 3 4 5 6 7 8 9 10 11….

RN - 91 67 56 63 16 35 30 12 58 82…

Waktu antar kedatangan

- 5 3 3 3 2 2 2 1 3 4…..

21

• Waktu pelayanan

Pelanggan 1 2 3 4 5 6 7 8 9 10 11….

No.Rawak 94 59 63 66 30 69 37 01 51 92 36…

Waktu pelayanan

4 3 3 3 2 3 2 1 3 4 2…..

22

• Simulasi antrian dgn 1 pelayan

Pelanggan

a

Waktu antar kedatangan

b

Waktu kedatangan

c

Waktu pelayanan

d

Waktu mulai

pelayanan

E

Waktu menunggu

f

Akhir pelayan

an

G =d+e

Waktu pelanggan

dalam sistem

H=d+f

Waktu pelayan bekerja

i

1 - 0 4 0 0 4 4(4+0) 0

2 5 5 3 5 0 8 3 1(5-4)

3 3 8 3 8 0 11 3 0

4 3 11 3 11 0 14 3 0

5 3 14 2 14 0 16 2 0

6 2 16 3 16 0 19 3 0

7 2 18 2 19 1(19-18) 21 3(2+1) 0

8 2 20 1 21 1(21-20) 22 2(1+1) 0

23

System

Clock

B(t)

Q(t)

Arrival times of custs. in queue

Event calendar

Number of completed waiting times in queue

Total of waiting times in queue

Area under Q(t)

Area under B(t)

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: Setup

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

24

System

Clock 0.00

B(t) 0

Q(t) 0

Arrival times of custs. in queue

<empty>

Event calendar [1, 0.00, Arr] [–, 20.00, End]

Number of completed waiting times in queue 0

Total of waiting times in queue 0.00

Area under Q(t) 0.00

Area under B(t) 0.00

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand:t = 0.00, Initialize

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

25

System

Clock 0.00

B(t) 1

Q(t) 0

Arrival times of custs. in queue

<empty>

Event calendar [2, 1.73, Arr] [1, 2.90, Dep] [–, 20.00, End]

Number of completed waiting times in queue 1

Total of waiting times in queue 0.00

Area under Q(t) 0.00

Area under B(t) 0.00

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 0.00, Arrival of Part 1

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

1

26

System

Clock 1.73

B(t) 1

Q(t) 1

Arrival times of custs. in queue

(1.73)

Event calendar [1, 2.90, Dep] [3, 3.08, Arr] [–, 20.00, End]

Number of completed waiting times in queue 1

Total of waiting times in queue 0.00

Area under Q(t) 0.00

Area under B(t) 1.73

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 1.73, Arrival of Part 2

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

12

27

System

Clock 2.90

B(t) 1

Q(t) 0

Arrival times of custs. in queue

<empty>

Event calendar [3, 3.08, Arr] [2, 4.66, Dep] [–, 20.00, End]

Number of completed waiting times in queue 2

Total of waiting times in queue 1.17

Area under Q(t) 1.17

Area under B(t) 2.90

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 2.90, Departure of Part 1

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

2

28

System

Clock 3.08

B(t) 1

Q(t) 1

Arrival times of custs. in queue

(3.08)

Event calendar [4, 3.79, Arr] [2, 4.66, Dep] [–, 20.00, End]

Number of completed waiting times in queue 2

Total of waiting times in queue 1.17

Area under Q(t) 1.17

Area under B(t) 3.08

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 3.08, Arrival of Part 3

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

23

29

System

Clock 3.79

B(t) 1

Q(t) 2

Arrival times of custs. in queue

(3.79, 3.08)

Event calendar [5, 4.41, Arr] [2, 4.66, Dep] [–, 20.00, End]

Number of completed waiting times in queue 2

Total of waiting times in queue 1.17

Area under Q(t) 1.88

Area under B(t) 3.79

Q(t) graph B(t) graph

Time (Minutes) Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 3.79, Arrival of Part 4

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

234

30

System

Clock 4.41

B(t) 1

Q(t) 3

Arrival times of custs. in queue

(4.41, 3.79, 3.08)

Event calendar [2, 4.66, Dep] [6, 18.69, Arr] [–, 20.00, End]

Number of completed waiting times in queue 2

Total of waiting times in queue 1.17

Area under Q(t) 3.12

Area under B(t) 4.41

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 4.41, Arrival of Part 5

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

2345

31

System

Clock 4.66

B(t) 1

Q(t) 2

Arrival times of custs. in queue

(4.41, 3.79)

Event calendar [3, 8.05, Dep] [6, 18.69, Arr] [–, 20.00, End]

Number of completed waiting times in queue 3

Total of waiting times in queue 2.75

Area under Q(t) 3.87

Area under B(t) 4.66

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 4.66, Departure of Part 2

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

345

32

System

Clock 8.05

B(t) 1

Q(t) 1

Arrival times of custs. in queue

(4.41)

Event calendar [4, 12.57, Dep] [6, 18.69, Arr] [–, 20.00, End]

Number of completed waiting times in queue 4

Total of waiting times in queue 7.01

Area under Q(t) 10.65

Area under B(t) 8.05

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 8.05, Departure of Part 3

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

45

33

System

Clock 12.57

B(t) 1

Q(t) 0

Arrival times of custs. in queue

()

Event calendar [5, 17.03, Dep] [6, 18.69, Arr] [–, 20.00, End]

Number of completed waiting times in queue 5

Total of waiting times in queue 15.17

Area under Q(t) 15.17

Area under B(t) 12.57

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 12.57, Departure of Part 4

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

5

34

System

Clock 17.03

B(t) 0

Q(t) 0

Arrival times of custs. in queue ()

Event calendar [6, 18.69, Arr] [–, 20.00, End]

Number of completed waiting times in queue 5

Total of waiting times in queue 15.17

Area under Q(t) 15.17

Area under B(t) 17.03

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 17.03, Departure of Part 5

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

35

System

Clock 18.69

B(t) 1

Q(t) 0

Arrival times of custs. in queue ()

Event calendar [7, 19.39, Arr] [–, 20.00, End] [6, 23.05, Dep]

Number of completed waiting times in queue 6

Total of waiting times in queue 15.17

Area under Q(t) 15.17

Area under B(t) 17.03

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 18.69, Arrival of Part 6

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

6

36

System

Clock 19.39

B(t) 1

Q(t) 1

Arrival times of custs. in queue

(19.39)

Event calendar [–, 20.00, End] [6, 23.05, Dep] [8, 34.91, Arr]

Number of completed waiting times in queue 6

Total of waiting times in queue 15.17

Area under Q(t) 15.17

Area under B(t) 17.73

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

Simulation by Hand: t = 19.39, Arrival of Part 7

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

67

37

Simulation by Hand: t = 20.00, The End

0

1

2

3

4

0 5 10 15 20

012

0 5 10 15 20

67

System

Clock 20.00

B(t) 1

Q(t) 1

Arrival times of custs. in queue

(19.39)

Event calendar [6, 23.05, Dep] [8, 34.91, Arr]

Number of completed waiting times in queue 6

Total of waiting times in queue 15.17

Area under Q(t) 15.78

Area under B(t) 18.34

Q(t) graph B(t) graph

Time (Minutes)

Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...

Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...

38

Simulation by Hand:Finishing Up

• Average waiting time in queue:

• Utilization of drill press(Kadar kemanfaatan mesin):

part per minutes 53261715

queue in times of No.queue in times of Total

..

less)(dimension 92020

3418value clock Final

curve under Area.

.)( tB

39

Complete Record of the Hand Simulation

KESIMPULAN• Delay rata-rata di antrian merupakan contoh dari statistik

waktu diskrit.- Jumlah rata-rata waktu di antrian dan proporsi waktu di

mana server sibuk adalah contoh statistik waktu kontinu.- Event untuk sistem ini adalah datangnya customer dan

pergi (selesai) -nya customer.- Variabel status yang diperlukan untuk meng-estimasi

d(n), q(n), dan u(n) adalah:1. status server (0 untuk idle; 1 untuk sibuk)2. jumlah customer di antrian3. waktu datang setiap customer yang antri4. waktu event yang paling akhir.

Recommended