Download General Purpose Petri Net Simulator

Transcript
8.
Stochastic Firing Times
So far, the firing times for transitions are assumed to be deterministic; thus, the simulations
presented so far are deterministic. However, in real life systems all the firing times are
stochastic. GPenSIM provides a limited facility for stochastic firing times.
We can use any of the MATLAB-standard probability distribution functions for stochastic
firing times. The following are the most used:
1) Guassian (normal) random function,
2) Binormial random function,
3) Poission random function, and
4) Uniform random function.
8.1
Example-07: Stochastic firing times
We refer to the CNC production system shown in figure 9; we no longer assume that the
firing times are deterministic:
1) Robot-1 takes random time Binaomially distributed with seed 10 and factor 0.9
milliseconds. (‘binornd(10,0.9)’)
2) Robot-2 takes random time normally distributed with mean 1 and standard deviation
0.1 milliseconds. (‘normrnd(1,0.1)’)
3) Robot-3 takes random time uniformly distributed with min 8 and max 10
milliseconds. (‘unifrnd(8,10)’)
Thus, the Petri net definition file is to be changed accordingly:
% Example-07: TDF example with stochastic timing
% the main simulation file
png = petrinetgraph('tdf_example_def');
dynamics.initial_markings = {'pFrom_CNC', 20}; % initial tokens
% here comes the STOCHASTIC TIMING
dynamics.firing_times = {'tRobot_1', 'binornd(10,0.9)',...
'tRobot_2', 'normrnd(1,0.1)', 'tRobot_3', 'unifrnd(8,10)'};
Results = gpensim(png, dynamics);
print_statespace(Results);
plotp(Results, {'pFrom_CNC', 'pBuffer_1', 'pBuffer_2', 'pBuffer_3'});
Note: Due to stochastic timing, up to three different outcomes are possible!!
35