Appendix
introduction
model
software
example
hypermedia
conclusions
references
appendix
Alternative 1:
First, the client, of class agent is created together with a histogram to collect information about the lifetime of the generated objects. It will generate objects (requests) because generate has been specified in the script. The client will will generate requests (of class data) according to a poisson distribution with means 60, as has been set by the -duration switch.
histogram agenthist #create histogram
agent client generate emphist #create agent called ``client''
client -duration 60 1 poisson #specify duration
The first datahandler to receive data from the client is the transport,
t1. Again, the duration is set by the switch -duration
transport t1 #create transport called ``t1''
t1 -duration 20 #specify duraion
The second datahandler to receive data from the client is the waitqueue,
wq1. The two histograms collect information about the length of the
queue and the waiting times. The waitqueue holds the data that it receives
until the first operation, receive, is ready to process it. Whether operation
receive is ready
depends on the availability of an employee to execute the operation. When {\em
receive} finishes it will pass its data on to choice choosepath.
histogram wq1ahist #create histograms
histogram wq1bhist
queue wq1 wq1ahist wq1bhist #create queue called ``wq1''
histogram clerkhist
employee clerk clerkhist 3 #create employee called ``clerk'' with #capacity 3
operation receive clerk #create operation called ``receive''
#which requires the employee ``clerk''
receive -duration 20.0 1 poisson #specify duration
The choice is created with the values 2 and 3 representing the chance that the loan will be less than 1000 dollars.
choice choosepath 2 3 #create choice called ``choosepath''
choosepath -duration 10 1 poisson #specify duration
histogram wq2ahist wid #create histograms for second queue
histogram wq2bhist wid
queue wq2 wq2ahist wq2bhist #create ``wq2''
histogram wq3ahist wid #create histograms for third queue
histogram wq3bhist wid
queue wq3 wq3ahist wq3bhist #create ``wq3''
histogram bosshist wid #create histograms for emp ``boss''
employee boss bosshist 1 #create ``boss'', capacity 1
operation largeloan boss #create operation ``largeloan''
#which requires employee ``boss''
large_loan -duration 20.0 #specify duration
operation smallloan clerk #create operation ``largeloan''
#which requires employee ``boss''
small_loan -duration 20.0 #specify duration
transport t2 #create transport ``t2''
t2 -duration 20 1 poisson #specify duration
transport t3 #create transport ``t3''
t3 -duration 20 1 poisson #specify duration
histogram wq4ahist wid #create histograms for forth queue
histogram wq4bhist wid
queue wq4 wq4ahist wq4b_hist #create ``wq3''
operation finalise clerk #create operation ``finalise''
#which requires employee ``clerk''
finalise -duration 20.0 #specify duration
transport t4 #create transport ``t2''
t4 -duration 20 #specify duration
Now, the process structure can be specified by means of the -next switch.
client -next t1
t1 -next wq1
wq1 -next receive
receive -next choosepath
choosepath -next wq1 wq2
wq1 -next largeloan
wq2 -next smallloan
largeloan -next wq3
smallloan -next wq3
wq3 -next finalise
finalise -next t4
t4 -next client
The simulation is then run for 10000 generated data objects and the results are displayed by the histogram widgets.
sim run 10000
Alternative 2:
histogram agenthist wid
agent client generate emphist
client -duration 60 1 poisson
transport t1
t1 -duration 20
histogram wq1ahist wid
histogram wq1bhist wid
queue wq1 wq1ahist wq1bhist
histogram clerkhist wid
employee clerk clerkhist 3
operation receive clerk
receive -duration 20.0 1 poisson
means computer 3
transport t2
t2 -duration 20
histogram wq2ahist wid
histogram wq2bhist wid
queue wq2 wq2ahist wq2bhist
histogram clerk2hist wid
employee clerk2 clerk2hist 1
operation approve clerk2
approve -duration 20.0 1 poisson
transport t3
t3 -duration 20
client -next t1
t1 -next wq1
wq1 -next receive
receive -next t2
t2 -next wq2
wq2 -next approve
approve -next t3
t3 -next client
Some results
After we run the program, we get the following results.
introduction
model
software
example
hypermedia
conclusions
references
appendix