Repository navigation
Expand file tree
/
Copy pathmodel1.c
More file actions
executable file
·64 lines (51 loc) · 1.46 KB
/
Copy pathmodel1.c
File metadata and controls
executable file
·64 lines (51 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/******************************************************************************
* File: model1.c *
* *
* Provides the queuing netork description and stochastic specification. *
*******************************************************************************/
#include "qnet.h"
enum {External, S1, S2, S3}; /* node names */
static double Expo0(void)
{
return(Exponential(1.0/30.0));
}
static double Expo1(void)
{
return(Exponential(1.0/90.0));
}
static double Expo2(void)
{
return(Exponential(1.0/7.0));
}
static double Expo3(void)
{
return(Exponential(1.0/5.0));
}
void Network(void)
/******************************************************************************
define the queuing network
*******************************************************************************/
{
/* declare 3 service nodes */
Nodes(3);
/* specify the connections */
Connect(External,S1,1.0);
Connect(S1,External,0.7);
Connect(S1,S2,0.2);
Connect(S1,S3,0.1);
Connect(S2,External,1.0);
Connect(S3,External,0.9);
Connect(S3,S1,0.1);
/* specify a Poisson arrival */
Arrival(Expo0, 30.0); /* mean arrival rate 30 */
/* specify service distributions */
Service(S1,Expo1,90.0); /* mean service rates */
Service(S2,Expo2,7.0);
Service(S3,Expo3,5.0);
}
void InitialState(void)
/*
* the network starts empty
*/
{
}