Documente Academic
Documente Profesional
Documente Cultură
Disciplina:ProceseStocastice
Raport
lalucrareadelaboratornr1
Tema : Cercetarea sistemelor cu fire de ateptare
prin metoda simulrii manuale
Chiinu 2016
Scopul lucrrii: Obinerea cunotinelor practice legate de sistemele cu fire de ateptare.
Calcularea parametrilor de baz ale acestor sisteme.
Sarcina lucrrii:
Pag. 1
Simularea Nr.1: Sistem de ateptare cu un singur server. Tabel de simulare
Numr Ceas Numar Tip Lungimea Starea Durata Durata Numrul Calendarul evenimentelor
eveniment Sistem client eveniment curent a Serverului Integral de integral de clienilor (Timpul, Num. Clientului, Tipul
S Sosire cozii de 0 Liber utilizare a ateptare n reinui n Evenimentului)"
P Plecare ateptare 1 Ocupat serverului coad coad
i ti j Q(t) B(t) Tocupat T Nq
0 0 - START 0 0 0 0 0 (141,1,s)(-,26,STOP)
1 141 1 s 0 1 0 0 0 (272,1,p)(327,2,s)(-,26,STOP)
2 272 1 p 0 0 131 0 0 (327,2,s)(-,26,STOP)
3 327 2 s 0 1 131 0 0 (616,3,s)(589,2,p)(-,26,STOP)
4 589 2 p 0 0 402 0 0 (616,3,s)(-,26,STOP)
5 616 3 s 0 1 402 0 0 (766,4,s)(756,3,p)(-,26,STOP)
6 756 3 p 0 0 542 0 0 (766,4,s)(-,26,STOP)
7 766 4 s 0 1 542 0 0 (1049,5,s)(957,4,p)(-,26,STOP)
8 957 4 p 0 0 733 0 0 (1049,5,s)(-,26,STOP)
9 1049 5 s 0 1 733 0 0 (1203,6,s)(1196,5,p)(-,26,STOP)
10 1196 5 p 0 0 880 0 0 (1203,6,s)(-,26,STOP)
11 1203 6 s 0 1 880 0 0 (1390,7,s)(1372,6,p)(-,26,STOP)
12 1372 6 p 0 0 1049 0 0 (1390,7,s)(-,26,STOP)
13 1390 7 s 0 1 1049 0 0 (1520,s,8)(1651,p,7)(-,26,STOP)
14 1520 8 s 1 1 1179 0 1 (1642,s,9)(1651,p,7)(-,26,STOP)
15 1642 9 s 2 1 1301 122 2 (1779,s,10)(1651,p,7)(-,26,STOP)
16 1651 7 p 1 1 1310 140 2 (1779,s,10)(1904,p,8)(-,26,STOP)
17 1779 10 s 2 1 1438 268 3 (2039,s,11)(1904,p,8)(-,26,STOP)
18 1904 8 p 1 1 1563 518 3 (2039,s,11)(1983,p,9)(-,26,STOP)
19 1983 9 p 0 1 1642 597 3 (2039,s,11)(2108,p,10)(-,26,STOP)
20 2039 11 s 1 1 1698 597 4 (2281,s,12)(2108,p,10)(-,26,STOP)
21 2108 10 p 0 1 1767 666 4 (2281,s,12)(2271,p,11)(-,26,STOP)
22 2271 11 p 0 0 1767 666 4 (2281,s,12)(-,26,STOP)
23 2281 12 s 0 1 1767 666 4 (2477,s,13)(2465,p,12)(-,26,STOP)
24 2465 12 p 0 0 1951 666 4 (2477,s,13)(-,26,STOP)
25 2477 13 s 0 1 1951 666 4 (2605,s,14)(2745,p,13)(-,26,STOP)
26 2605 14 s 1 1 2079 666 5 (2749,s,15)(2745,p,13)(-,26,STOP)
27 2745 13 p 0 1 2219 806 5 (2749,s,15)(2979,p,14)(-,26,STOP)
28 2749 15 s 1 1 2223 806 6 (2907,s,16)(2979,p,14)(-,26,STOP)
29 2907 16 s 2 1 2381 964 7 (3087,s,17)(2979,p,14)(-,26,STOP)
30 2979 14 p 1 1 2453 1108 7 (3087,s,17)(3228,p,15)(-,26,STOP)
31 3087 17 s 2 1 2561 1216 8 (3240,s,18)(3228,p,15)(-,26,STOP)
32 3228 15 p 1 1 2702 1498 8 (3240,s,18)(3434,p,16)(-,26,STOP)
33 3240 18 s 2 1 2714 1510 9 (3380,s,19)(3434,p,16)(-,26,STOP)
34 3380 19 s 3 1 2854 1790 10 (3813,s,20)(3434,p,16)(-,26,STOP)
35 3434 16 p 2 1 2908 1952 10 (3813,s,20)(3600,p,17)(-,26,STOP)
36 3600 17 p 1 1 3074 2284 10 (3813,s,20)(3762,p,18)(-,26,STOP)
37 3762 18 p 0 1 3236 2446 10 (3813,s,20)(4051,p,19)(-,26,STOP)
38 3813 20 s 1 1 3287 2446 11 (3999,s,21)(4051,p,19)(-,26,STOP)
39 3999 21 s 2 1 3473 2632 12 (4194,s,22)(4051,p,19)(-,26,STOP)
40 4051 19 p 1 1 3525 2736 12 (4194,s,22)(4340,p,20)(-,26,STOP)
41 4194 22 s 2 1 3668 2879 13 (4598,s,23)(4340,p,20)(-,26,STOP)
42 4340 20 p 1 1 3814 3171 13 (4598,s,23)(4660,p,21)(-,26,STOP)
43 4598 23 s 2 1 4072 3429 14 (4766,s,24)(4660,p,21)(-,26,STOP)
44 4660 21 p 1 1 4134 3553 14 (4766,s,24)(4855,p,22)(-,26,STOP)
45 4766 24 s 2 1 4240 3659 15 (4915,s,25)(4855,p,22)(-,26,STOP)
46 4855 22 p 1 1 4329 3837 15 (4915,s,25)(4985,p,23)(-,26,STOP)
47 4915 25 s 2 1 4389 3897 16 (5066,s,26)(4985,p,23)(-,26,STOP)
48 4985 23 p 1 1 4459 4037 16 (5066,s,26)(5225,p,24)(-,26,STOP)
49 5066 26 s 2 1 4540 4118 17 (5229,s,27)(5225,p,24)(-,26,STOP)
50 5225 24 p 1 1 4699 4436 17 (5229,s,27)(5423,p,25)(-,26,STOP)
51 5229 27 s 2 1 4703 4440 18 (5465,s,28)(5423,p,25)(-,26,STOP)
52 5423 25 p 1 1 4897 4828 18 (5465,s,28)(5601,p,26)(-,26,STOP)
53 5423 - STOP 1 1 4897 4828 18 (5465,s,28)(5601,p,26)(-,26,STOP)
Evaluarea indicilor de performan
Serverul
Bazndu-ne pe tabelul de simulare de mai sus reprezentm starea serverului n funcie de timp pe
parcursul simulrii:
1.2
0.8
0.6
B(t)
0.4
0.2
Coada de ateptare
3.5
3
2.5
2
1.5
Q(t)
1
0.5
0
Pag. 5
T 4828
Reinerea n medie a unui client n coada de ateptare T q= = 268.22 . Deci n medie
Nq 18
fiecare client a fost reinut pentru 268 de uniti de timp n coad. Durata medie a oerioadei de
serviciu este aproximativ egal cu 198, deci fiecare client a ateptat n medie pe durata servirii a
1.35 clieni.
Pag. 6
Simularea Nr.2: Sistem de ateptare cu dou servere. Tabel de simulare
Numr Ceas Numar Tip Lungimea Starea Durata Durata Numrul Calendarul evenimentelor
eveniment Sistem client eveniment curent a Serverului Integral de integral de clienilor (Timpul, Num. Clientului, Tipul
S Sosire cozii de 0 Liber utilizare a ateptare n reinui n Evenimentului)"
P Plecare ateptare 1 Ocupat serverului coad coad
i ti j Q(t) B(t) Tocupat T Nq
0 0 - START 0 0 0 0 0 (141,1,s)(-,26,STOP)
1 141 1 s 0 1 0 0 0 (272,1,p)(327,2,s)(-,26,STOP)
2 272 1 p 0 0 131 0 0 (327,2,s)(-,26,STOP)
3 327 2 s 0 1 131 0 0 (616,3,s)(598,2,p)(-,26,STOP)
4 598 2 p 0 0 402 0 0 (616,3,s)(-,26,STOP)
5 616 3 s 0 1 402 0 0 (766,4,s)(756,3,p)(-,26,STOP)
6 756 3 p 0 0 542 0 0 (766,4,s)(-,26,STOP)
7 766 4 s 0 1 542 0 0 (1049,5,s)(957,p,4)(-,26,STOP)
8 957 4 p 0 0 733 0 0 (1049,5,s)(-,26,STOP)
9 1049 5 s 0 1 733 0 0 (1203,6,s)(1196,5,p)(-,26,STOP)
10 1196 5 p 0 0 880 0 0 (1203,6,s)(-,26,STOP)
11 1203 6 s 0 1 880 0 0 (1390,7,s)(1372,6,p)(-,26,STOP)
12 1372 6 p 0 0 1049 0 0 (1390,7,s)(-,26,STOP)
13 1390 7 s 0 1 1049 0 0 (1520,8,s)(1651,7,p)(-,26,STOP)
14 1520 8 s 0 2 1179 0 0 (1642,9,s)(1651,7,p)(1773,8,p)
(-,26,STOP)
15 1642 9 s 1 2 1423 0 1 (1779,10,s)(1651,7,p)(1773,8,p)
(-,26,STOP)
16 1651 7 p 0 2 1441 9 1 (1779,10,s)(1773,8,p)(1830,9,p)
(-,26,STOP)
17 1773 8 p 0 1 1685 9 1 (1779,10,s)(1830,9,p)(-,26,STOP)
18 1779 10 s 0 2 1691 9 1 (2039,11,s)(1830,9,p)(1904,10,p)
(-,26,STOP)
19 1830 9 p 0 1 1793 9 1 (2039,11,s)(1904,10,p)(-,26,STOP)
20 1904 10 p 0 0 1867 9 1 (2039,11,s)(-,26,STOP)
21 2039 11 s 0 1 1867 9 1 (2281,12,s)(2202,11,p)(-,26,STOP)
22 2202 11 p 0 0 2030 9 1 (2281,12,s)(-,26,STOP)
23 2281 12 s 0 1 2030 9 1 (2477,13,s)(2465,12,p)(-,26,STOP)
24 2465 12 p 0 0 2214 9 1 (2477,13,s)(-,26,STOP)
25 2477 13 s 0 1 2214 9 1 (2605,14,s)(2745,13,p)(-,26,STOP)
26 2605 14 s 0 2 2342 9 1 (2749,15,s)(2745,13,p)(2839,14,p)
(-,26,STOP)
27 2745 13 p 0 1 2622 9 1 (2749,15,s)(2839,14,p)(-,26,STOP)
28 2749 15 s 0 2 2626 9 1 (2907,16,s)(2839,14,p)(2998,15,p)
(-,26,STOP)
29 2839 14 p 0 1 2806 9 1 (2907,16,s)(2998,15,p)(-,26,STOP)
30 2907 16 s 0 2 2874 9 1 (3087,17,s)(2998,15,p)(3113,16,p)
(-,26,STOP)
31 2998 15 p 0 1 3056 9 1 (3087,17,s)(3113,16,p)(-,26,STOP)
32 3087 17 s 0 2 3145 9 1 (3240,18,s)(3113,16,p)(3253,17,p)
(-,26,STOP)
33 3113 16 p 0 1 3197 9 1 (3240,18,s)(3253,17,p)(-,26,STOP)
34 3240 18 s 0 2 3324 9 1 (3380,19,s)(3253,17,p)(3402,18,p)
(-,26,STOP)
35 3253 17 p 0 1 3350 9 1 (3380,19,s)(3402,18,p)(-,26,STOP)
36 3380 19 s 0 2 3477 9 1 (3813,20,s)(3402,18,p)(3570,19,p)
(-,26,STOP)
37 3402 18 p 0 1 3521 9 1 (3813,20,s)(3570,19,p)(-,26,STOP)
38 3570 19 p 0 0 3689 9 1 (3813,20,s)(-,26,STOP)
39 3813 20 s 0 1 3689 9 1 (3999,21,s)(4102,20,p)(-,26,STOP)
40 3999 21 s 0 2 3875 9 1 (4194,22,s)(4102,20,p)(4319,21,p)
(-,26,STOP)
41 4102 20 p 0 1 4081 9 1 (4194,22,s)(4319,21,p)(-,26,STOP)
42 4194 22 s 0 2 4173 9 1 (4598,23,s)(4319,21,p)(4484,22,p)
(-,26,STOP)
43 4319 21 p 0 1 4423 9 1 (4598,23,s)(4484,22,p)(-,26,STOP)
44 4484 22 p 0 0 4588 9 1 (4598,23,s)(-,26,STOP)
45 4598 23 s 0 1 4588 9 1 (4766,24,s)(4728,23,p)(-,26,STOP)
46 4728 23 p 0 0 4718 9 1 (4766,24,s)(-,26,STOP)
47 4766 24 s 0 1 4718 9 1 (4915,25,s)(5006,24,p)(-,26,STOP)
48 4915 25 s 0 2 4867 9 1 (5066,26,s)(5006,24,p)(5113,25,p)
(-,26,STOP)
49 5006 24 p 0 1 5049 9 1 (5066,26,s)(5113,25,p)(-,26,STOP)
50 5066 26 s 0 2 5109 9 1 (5229,27,s)(5113,25,p)(5244,26,p)
(-,26,STOP)
51 5113 25 p 0 1 5203 9 1 (5229,27,s)(5244,26,p)(-,26,STOP)
52 5113 - STOP 0 1 5203 9 1 (5229,27,s)(5244,26,p)(-,26,STOP)
Evaluarea indicilor de performan
Serverele
Bazndu-ne pe tabelul de simulare de mai sus reprezentm starea serverului n funcie de timp pe
parcursul simulrii:
2.5
1.5
B(t)
0.5
Pag. 10
Coada de ateptare
1.2
0.8
0.6
Q(t)
0.4
0.2
Durata total de ateptare pentru toi clienii este T =9 , fiind calculat pe parcursul simulrii.
T 9
Lungimea medie a irului de ateptare: Lq= = 0.0017 . Adugarea unui al doilea
T sim 5423
server a eliminat practic necesitatea existenei unui ir de ateptare. Numai clientul cu numrul 8 a
ateptat timp de 8 uniti de timp, ceea ce este o msur minuscul. De aceea i am atras atenia n
cazul lucrului unui singur server la faptul c lungimea medie a irului de ateptare reprezint
aproximativ gradul de utilizare a unui server.
Pag. 11