Download General Purpose Petri Net Simulator
Transcript
16. Using Hourly Clock
So far, we have treated clock as a unitless timer; it will always start at 0 during simulation
start, and will increase afterwards. However, in business modeling applications, it will be
much better to use an hourly clock, a clock that uses and shows time in hours, minutes, and
seconds. The following example explains the issue.
CAUTION! CAUTION!
Time in hourly format must be given
given as a vector with
3 columns (e.g. 1:00 PM as [13,
[13, 0, 0]); you can mix
times in 3 column hourly format with single
numbers; however, these single numbers will be
taken as seconds.
E.g.:
[0 40 0]
'unifrnd(40,40)*60'
'unifrnd(40,40)*60'
180
is equivalent to 40 minutes (or 2400 seconds)
is equivalent to 2400 seconds (40*60)
is equivalent to 180 seconds
16.1 Example-19: Hourly Clock for Lunching Clerks
An office opens at 09:00 AM on every business day. Customers arrive at every 30 minutes.
There are two clerks who will interact with the customers. The clerks take 40 minutes to
service a customer.
The office closes at 01:00 PM, and no customer will be allowed into the office. However,
those customer(s) already reside inside the office will be serviced.
1. Case-A: What time the last customer will leave the office, after finishing his/her
business?
2. Case-B: Suppose, there will only one clerk available from 12:00 Noon, how the
departure time of the last customer will change?
16.1.1 Functions for hourly clock
First of all, we want to start the simulation at 09:00 AM. This can be fed into the model
through the global_info packet.
global_info.STARTING_AT = [9 0 0]; % start 09:00:00 HH:MM:SS
In MSF, to assign firing times to clerk (40 minutes each), and customer arrival (every 30
minutes), we may either use the hourly clock format or times in seconds:
dyn.firing_times = {'tGENNEW', 30*60, 'tCRK1', 'unifrnd(40,40)*60',...
'tCRK2', [0 40 0]};
Note: Because of the use of hourly clock formats, the functions print_statespace and plotp
display time information in hourly formats.
75