You are on page 1of 92

Simulation Software

Simulation and Modeling


Dr. Mohamed Sobh
Reference: Chapter 4, Discrete-Event System Simulation, 4
th
Edition , Jerry Banks + Lecture
Classification of Simulation Software
Low-Level Programming Languages: General purpose programming
language like (C, C++, Java, C#, VB) are used to build the
simulation environment form scratch or based on some
programming libraries like SIMLIB.
Mid-Level Programming Language: Specific simulation languages
like (GPSS, SIMAN, ).
High-Level Programming Language (Simulation Environments):
Graphical based environment like (Arena, Automod, Vensim).
Selection of Simulation Software
Model building feature
Runtime environment
Animation of layout features
Output features
Vendor support and product documentation
Model Building Feature
Modeling world-view
Input data analysis capability
Graphical model building
Conditional routing
Simulation programming
Syntax
Input flexibility
Randomness
Specialized components and templates
User-built objects
Interface with general programming language
Runtime Environment
Execution Speed
Model size; number of variables and attributes
Interactive debugger
Model status and statistics
Animation of Layout Features
Type of animation
Import drawing and objects file
Dimension
Movement
Quality of motion
Libraries of common objects
Navigation
Views
Display step
Selectable objects
Hardware requirements
Output Features
Optimization
Standardized Report
Statistical Analysis
Business Graphic
Export Formats (Files, Databases)
Vendor Support and Product Documentation
Training
Documentation
Help system
Tutorials
Support
Upgrades, maintenance
Track report
Low-Level Programming (C/C++)
EX1: Single-Queue Single-Server
G
e
n
e
r
a
l

P
r
o
g
r
a
m

S
t
r
u
c
t
u
r
e

Main Program
1. Set CLOCK = 0
2. Initialize Simulation Statistics
3. Initialize System State
4. Generate Initial Event in FEL
5. Generate End Event in FEL (If Exist)
1. Pick Head Event From FEL
2. Set CLOCK to Event Time
3. Get Event Type
1. Call Appropriate Event Handler
Is End Event
No
1. Compute Final Statistics
2. Print Report
1. Gather Input Parameter (If Exist)
Process Event 1
Process Event 2
Process Event 3
End Flag == 1 or FEL Length == 0
True
False
End
Yes
Single-Queue Single-Server
Queue
Server
Customer
Entities Customer, Queue, Server
Attributes Probability distribution of Inter-arrival Time Uniform(35)
Probability distribution of Service Time Uniform(46)
Events Arrival, Departure
State Variables Queue Length, Server Status
Statistics Server Utilization, Average and Maximum Queue Length
P
r
o
g
r
a
m

S
t
r
u
c
t
u
r
e

Main Program
1. Set CLOCK = 0
CLOCK = 0
2. Initialize Simulation Statistics
TotalCustomers = 0
MaximumQueuLength = 0
SSArea = 0
QLArea = 0
PreviousEventTime = 0
3. Initialize System State
ServerStatus = 0
Initialize Queue List
4. Generate Initial Event in FEL
Add Event (ARRIVE, Generate IAT)
5. Generate End Event in FEL (If Exist)
Add Event (3, 1000)
1. Pick Head Event From FEL
2. Set CLOCK to Event Time
3. Get Event Type
1. Call Appropriate Event Handler
2. PreviousEventTime = CLOCK
Is End Event
No
1. Compute Final Statistics
2. Print Report
Print Number of Customers = , TotalCustomers
Print Maximum Queue Length = , MaximumQueuLength
Print Service Utilization = , SSArea / CLOCK
Print Average Queue Length = , QLArea / CLOCK
Process Arrive
Process Depart
End Flag = 1 or FEL Length = 0
True
False
End
Yes
Average Queue Length = QLArea / Total Time
Time
Queue
Length
Average Service Time = SSArea / Total Time
Time
Server
Status
while status Server
le length whi Queue
1) i (i, Evenets Two Between Duration
i i
i i
i
i i
i i
T SS
T QL
T
SS T SSArea
QL T QLArea
A =
A =
+ = A
A =
A =

Time Average Statistics


Average Queue Length = QLArea / Total Time
Time
Queue
Length
Average Service Time = SSArea / Total Time
Time
Server
Status
( )
( )( )
T
t t t L
dt t L
T
L
n
i
i i i Q T
Q Q

}
=

.

= =
0
1
0
.
1
( )
( )( )
T
t t t L
dt t L
T
L
n
i
i i i S T
S S

}
=

.

= =
0
1
0
.
1
Arrival Event
Arrival Event
ServerStatus = 1 ServerStatus == 1 No
QueueLength = QueueLength + 1
Yes
ST = Generate Service Time
Add Departure Event (DEPART, CLOCK + ST)
IAT = Generate Interarrival Time
Add Arrival Event (ARRIVE, CLOCK + IAT)
End
QLArea = QLArea + QueueLength * (CLOCK PreviousEventTime)
SSArea = SSArea + ServerStatus * (CLOCK PreviousEventTime)
MaximumQueueLength = max(MaximumQueueLength, QueueLength)
Departure Event
Departure Event
ServerStatus = 0
Is QueueLength = 0
No
QueueLength = QueueLength - 1 Yes
ST = Generate Service Time
Add Departure Event (DEPART, CLOCK + ST)
QLArea = QLArea + QueueLength * (CLOCK PreviousEventTime)
SSArea = SSArea + ServerStatus * (CLOCK PreviousEventTime)
TotalCustomers++;
End
MaximumQueueLength = max(MaximumQueueLength, QueueLength)
C
o
d
e
:

P
r
o
t
o
t
y
p
e
s

&

G
l
o
b
a
l

//Prototypes
class SEvent;

void AddEventToList(SEvent* pNewEvent);
SEvent* PickHeadEventFromList();
void FreeEventList();

double GenerateUniformRandomVariable(double Start, double End);

void ProcessArriveEvent();
void ProcessDepartEvent();
void main();

//Global Variables
SEvent* pHeadEvent;
double CLOCK;
long TotalCustomers;
long MaximumQueueLength;
double SSArea;
double QLArea;
double PreviousEventTime;
int ServerStatus;
int QueuLength;
bool EndSimulationFlag;
float MinST, MaxST, MinIAT, MaxIAT, SimulationTime;
C
o
d
e
:

E
v
e
n
t

L
i
s
t

&

R
N
G

class SEvent
{
public:
enum Types { ARRIVE, DEPART, ENDSIM };

long Type;
double Time;
SEvent* pNextEvent;

SEvent(long Type_, double Time_)
{
Type = Type_; Time = Time_; pNextEvent = NULL;
};
};

C
o
d
e
:

E
v
e
n
t

L
i
s
t

&

R
N
G

void AddEventToList(SEvent* pNewEvent)
{
if(pHeadEvent == NULL) //Event List Is Empty
{
pHeadEvent = pNewEvent;
return;
}
else if(pNewEvent->Time < pHeadEvent->Time) //Before First Event
{
pNewEvent->pNextEvent = pHeadEvent;
pHeadEvent = pNewEvent;
return;
}

SEvent* pEvent = pHeadEvent;
while(1)
{ //After Last Event
if(pEvent->pNextEvent==NULL && pNewEvent->Time >= pEvent->Time)
{
pNewEvent->pNextEvent = NULL;
pEvent->pNextEvent = pNewEvent;
return;
}
else if( pEvent->pNextEvent->Time > pNewEvent->Time ) //Between Two Events
{
pNewEvent->pNextEvent = pEvent->pNextEvent;
pEvent->pNextEvent = pNewEvent;
return;
}

pEvent = pEvent->pNextEvent;
}
}
C
o
d
e
:

E
v
e
n
t

L
i
s
t

&

R
N
G

SEvent* PickHeadEventFromList()
{
if(pHeadEvent==NULL)return NULL;

SEvent* pEvent = pHeadEvent;
pHeadEvent = pHeadEvent->pNextEvent;

return pEvent;
}

void FreeEventList()
{
while(pHeadEvent)
{
SEvent* pEvent = pHeadEvent->pNextEvent;
delete pHeadEvent;
pHeadEvent = pEvent;
}
}

double GenerateUniformRandomVariable(double Start, double End)
{
return ((rand()%1000)/1000.0) * (End-Start) + Start;
}
C
o
d
e
:

M
a
i
n

#include "stdio.h"
#include "conio.h
//Prototypes

//Global Variables

//Class Definitions

//Function Implementations

void main()
{
//Get Inputs

//Initialization

//Schedule Initial Events

//Main Simulation Loop

//Report Generation

//Finalization

_getch();
}
Code: Get Inputs, Initialization,
Schedule Initial Events
//Get Inputs
printf("==========Single Queue Single Server Simulation=========\r\n\r\n");
printf("Enter Service Time Range (MIN MAX):"); scanf("%f %f",&MinST,&MaxST);
printf("Enter Inter-Arrival Time Range (MIN MAX):"); scanf("%f %f",&MinIAT,&MaxIAT);
printf("Enter Required Simulation Time:"); scanf("%f",&SimulationTime);

//Initialization
pHeadEvent = NULL;
CLOCK = 0;
TotalCustomers = 0;
MaximumQueueLength = 0;
SSArea = 0;
QLArea = 0;
PreviousEventTime = 0;
ServerStatus = 0;
QueuLength = 0;
EndSimulationFlag = false;

//Schedule Initial Events
AddEventToList(new SEvent(SEvent::ARRIVE, GenerateUniformRandomVariable(MinIAT,MaxIAT)));
AddEventToList(new SEvent(SEvent::ENDSIM, SimulationTime));
C
o
d
e
:

M
a
i
n

S
i
m
u
l
a
t
i
o
n

L
o
o
p

while(!EndSimulationFlag)
{
SEvent* pCurrentEvent = PickHeadEventFromList();
if(pCurrentEvent==NULL)break;

CLOCK = pCurrentEvent->Time;
switch(pCurrentEvent->Type)
{
case SEvent::ARRIVE: ProcessArriveEvent(); break;
case SEvent::DEPART: ProcessDepartEvent(); break;
case SEvent::ENDSIM: EndSimulationFlag = true; break;
}

PreviousEventTime = CLOCK;

delete pCurrentEvent;
}
Code: Reporting & Finalization
//Report Generation
printf("\r\n\r\n==========Simulation Report=========\r\n\r\n");
printf("Number of Customers: %d\r\n", TotalCustomers);
printf("Maximum Queue Length: %d\r\n", MaximumQueueLength);
printf("Server Utilization: %5.4f\r\n", SSArea / CLOCK);
printf("Average Queue Length: %5.4f\r\n", QLArea / CLOCK);

//Finalization
FreeEventList();
Code: Arrive Event
void ProcessArriveEvent()
{
QLArea += QueuLength * (CLOCK - PreviousEventTime);
SSArea += ServerStatus * (CLOCK - PreviousEventTime);

if(ServerStatus == 1)
{
QueuLength++;
}
else
{
ServerStatus = 1;
AddEventToList(
new SEvent(SEvent::DEPART, CLOCK + GenerateUniformRandomVariable(MinST,MaxST)));
}

AddEventToList(
new SEvent(SEvent::ARRIVE, CLOCK + GenerateUniformRandomVariable(MinIAT,MaxIAT)));
MaximumQueueLength = max(MaximumQueueLength, QueuLength);
}
Code: Depart Event
void ProcessDepartEvent()
{
QLArea += QueuLength * (CLOCK - PreviousEventTime);
SSArea += ServerStatus * (CLOCK - PreviousEventTime);
TotalCustomers++;

if(QueuLength>0)
{
QueuLength--;
AddEventToList(
new SEvent(SEvent::DEPART, CLOCK + GenerateUniformRandomVariable(MinST,MaxST)));
}
else
{
ServerStatus = 0;
}


}
Simulation Program Output
Mid-Level Programming (GPSS)
GPSS - General Purpose System Simulation
Specific Language for Discrete Event Systems (DES)
Assumes that DES systems is consisting of:
Generators : Generate one token every time period
Facilities: Service for certain time period
Other utilities and statistics element
Gives the ability to specify deterministic or stochastic
timing behaviors
EX2: Empty Deterministic System
GENERATE 100 ;Generate one token every 100 time-units

TERMINATE 1 ;Destroy token and decrement start-counter by 1
;When start-counter reaches zero the simulation stopped

START 50 ;Start the simulation and set start-counter to 50
Simulation
Report
GPSS: GENERATE A, B, C, D, E
Description: Generate D Tokens Every AB
with priority value E
A: Default value of A = 0
B: Default value of B = 0
D: Default value of D =
E: Default value of E = 1
EX3: Empty Stochastic System
GENERATE 18,6 ;Generate one token every 18 +/- 6 time-units
TERMINATE ;Destroy token only

GENERATE 10000 ;Generate one token every 10000 time-units
TERMINATE 1
START 1
Simulation
Report
GPSS: ADVANCE A, B
Delay Tokens for AB
A, B:
A can be constant or random function
Default value of A = 0
Default value of B = 0
Represents a service or a delay
EX4: Supermarket
GENERATE 5,2 ;Generate one token every 5 +/- 2 time-unit
ADVANCE 20,10 ;Spent a time 20 +/- 10 in the facility (supermarket)
TERMINATE ;Destroy token only

;Simulate for 5000 time units

GENERATE 5000
TERMINATE 1
START 1
Simulation
Report
GPSS: STORAGE, ENTER, LEAVE
A STORAGE N
Define a facility A with storage capacity N
ENTER A, B:
Enter a facility A and use B storage items
LEAVE A, B:
Leave a facility A and releases B storage items
Current facility level (Number of items) = S$A
EX5: Single Queue Single Server
Server Storage 1;Define a restricted facility can accept 1 token at a time

GENERATE 18,6
ENTER Server ;Enter the restricted facility
ADVANCE 25,5
LEAVE Server ;Depart from the restricted facility
TERMINATE

GENERATE 5000
TERMINATE 1
START 1
Simulation Result
GPSS: (QUEUE A) (DEPART A)
Calculate statistics for A between Queue and
Depart
A: Queue Name
Statistics:
Average number of tokens
Average spent time
Current queue length = Q$A
Measure Queuing Statistics
Parper Storage 1

GENERATE 24,12
QUEUE ParperQueue ;Queue Statistics Start Here
ENTER Parper
DEPART ParperQueue ;Queue Statistics End Here
ADVANCE 25,5
LEAVE Parper
TERMINATE

GENERATE 5000
TERMINATE 1
START 1
Simulation Result
E
X
6
:

M
u
l
t
i
-
S
e
r
v
i
c
e

M
u
l
t
i
-
S
e
r
v
e
r
s

Step1 Storage 1
Step2 Storage 2
Step3 Storage 1

GENERATE 18,6

QUEUE Step1Queue
ENTER Step1
DEPART Step1Queue
ADVANCE 20,5
LEAVE Step1

QUEUE Step2Queue
ENTER Step2
DEPART Step2Queue
ADVANCE 40,8
LEAVE Step2

QUEUE Step3Queue
ENTER Step3
DEPART Step3Queue
ADVANCE 25,3
LEAVE Step3

TERMINATE

GENERATE 5000
TERMINATE 1
START 1
Simulation Results
E
X
6
:

M
u
l
t
i
-
S
e
r
v
i
c
e

S
i
n
g
l
e
-
S
e
r
v
e
r
s

Server1 Storage 1

GENERATE 18,6

QUEUE Server1Queue
ENTER Server1
DEPART Server1Queue
ADVANCE 8,5
LEAVE Server1

TERMINATE

GENERATE 20,5

QUEUE Server1Queue
ENTER Server1
DEPART Server1Queue
ADVANCE 10,5
LEAVE Server1

TERMINATE

GENERATE 5000
TERMINATE 1
START 1
Simulation Results
EX7: Different Random Distributions
Interarrival Time Probability Cumulative
Probability
5 0.10 0.10
10 0.20 0.30
15 0.30 0.60
20 0.25 0.85
25 0.10 0.95
30 0.05 1.00
Service Time for Server 1: Exponential with mean = 10.0
Service Time for Server 2: Weibull with mean = 15.0 and Shape = 1
Service Time for Server 3: Gamma with mean = 12.0 and Shape = 2
Service Time for Server 4: Normal with mean = 19.0 and Standard Deviation = 2

E
X
7
:

D
i
f
f
e
r
e
n
t

R
a
n
d
o
m

D
i
s
t
r
i
b
u
t
i
o
n
s

Server1 Storage 1
Server2 Storage 1
Server3 Storage 1
Server4 Storage 1

IAT function RN1,D6
.1,5 / .3,10 / .6,15 / .85,20 / .95,25 / 1,30

GENERATE FN$IAT
ENTER Server1
ADVANCE (Exponential(2,0,10.0)); Stream, 0, Mean
LEAVE Server1

ENTER Server2
ADVANCE (Weibull(3,0,15.0,1)); Stream, 0, Mean, Shape
LEAVE Server2

ENTER Server3
ADVANCE (Gamma(4,0,12.0,2)); Stream, 0, Mean, Shape
LEAVE Server3

ENTER Server4
ADVANCE (Normal(5,19.0,2.0)); Stream, Mean, Std
LEAVE Server4
TERMINATE

GENERATE 10000
TERMINATE 1
START 1
Simulation Results
GPSS: TRANSFER A, B
Unconditional jump to location B with
probability (1-A)
B: Location
A: Probability of jump = 1-A
Unconditional Jump
Server Storage 1
GENERATE ,,,1
;Generate one token at start

Again ADVANCE 30,5
ENTER Server
ADVANCE 8,2
LEAVE Server
TRANSFER ,Again
;100% Go to Again
TERMINATE

GENERATE 600
TERMINATE 1
START 1
Server Storage 1
GENERATE 18,6
;Generate one token at start

Again ADVANCE 30,5
ENTER Server
ADVANCE 8,2
LEAVE Server
TRANSFER 0.8,Again
;20% Go to Again
TERMINATE

GENERATE 600
TERMINATE 1
START 1
GPSS: TEST S A,B,C
Conditional jump to location C if A (S) B where
S: Conditional operator
L: <
G: >
E: =
LE:
GE:
C: Location, If not specified the token will wait until the
condition is satisfied
A: Left hand value
B: Right hand value
Conditional Jump
Service1 Storage 1
GENERATE 6,6

TEST L Q$Service1Queue, 4, S2Start
;If Service 1 queue length less than 4 continue otherwise go to S2Start

QUEUE Service1Queue
ENTER Service1
DEPART Service1Queue
ADVANCE 25,5
LEAVE Service1
S2Start ADVANCE 25,5
TERMINATE

GENERATE 600
TERMINATE 1

START 1
Wait-If
Service1 Storage 1
GENERATE 6,6

TEST L Q$Service1Queue,4
;If Service 1 queue length less than 4 continue otherwise wait

QUEUE Service1Queue
ENTER Service1
DEPART Service1Queue
ADVANCE 25,5
LEAVE Service1
TERMINATE

GENERATE 600
TERMINATE 1

START 1
GPSS: PRIORITY A
Gives the passed tokens a priority value equals
A
Default priority value for any generated token
is 1 unless specified by E parameter of
generate statement
Priority
GAME STORAGE 4
GENERATE 10,2,,,1
PLAYAGAIN QUEUE GAMEQUEUE
ENTER GAME
DEPART GAMEQUEUE
ADVANCE 30
LEAVE GAME
PRIORITY 0
TRANSFER .1,PLAYAGAIN
TERMINATE

GENERATE 600
TERMINATE 1
START 1


GPSS: SPLIT A, B
Create A copies of the token and through
them to B
Original token complete the original path
New tokens jump to B
If B is not specified original and copies will
complete the original path
GPSS: ASSEMBLE A
Assemble A tokens in one token
All token must have the same origin (comes
from the same SPLIT statement)
Gathered tokens must contain the original one
E
X
8
:

S
p
l
i
t

a
n
d

A
s
s
e
m
b
l
e

Manufacturing1 Storage 1
Manufacturing2 Storage 1
Manufacturing3 Storage 1
Assembling Storage 1

GENERATE 5
SPLIT 1,Machine2
SPLIT 1,Machine3
Machine1 ENTER Manufacturing1
ADVANCE 55,5
LEAVE Manufacturing1
TRANSFER ,Build
Machine2 ENTER Manufacturing2
ADVANCE 45,10
LEAVE Manufacturing2
TRANSFER ,Build
Machine3 ENTER Manufacturing3
ADVANCE 35,15
LEAVE Manufacturing3
TRANSFER ,Build
Build ASSEMBLE 3
ENTER Assembling
ADVANCE 65,30
LEAVE Assembling
TERMINATE

GENERATE 1000
Terminate 1
START 1
Simulation Results
High Level Simulation Software
Petri-Nets
What is Petri-Nets?
Graphical and Mathematical language provides a
Uniform environment for Modeling, Formal
Analysis, Design and Simulation of both
Discrete-Event and Discrete-Time Systems.
Language Construction
Place
Transition
Arcs (In, Out)
Transition
Place
In-Arc
Out-Arc
Place
ON/OFF
States
Empty/Occupied
States
Discrete
0
1.23
1.23 M
Empty/Occupied
States
Continuous
Place
Tokens
Place
1. Circle contains a number of tokens describing local
system state
2. Number of tokens is called "Marking
3. Number of tokens is integer 0 Discrete Petri-Nets
4. Number of tokens is real 0 Continuous Petri-Nets
5. Example:
1. Number of busy servers
2. Number of customers in queue
3. Number of items in a store
4. Liquid tank level
Transition
Bar or Rectangle
Describes the events that may modify the
system state
Transition event called firing
Example:
Customer Arrival, Departure
Demand, Order Evaluation, Order Arrival
Continuous Filling of Tank

Token States
Unavailable
01: 45 02:50
Available
Reserved
01:23
1. When token arrives it becomes available after the place
delay
2.Whenever firing is triggered actual firing is scheduled after
transition delay
In-Arcs
Line from place to
transition
In-Arc is identified by the
weight
In-Arc is called "Enabled
if the number of
"Available" tokens in the
connected place is the
weigh value
Place
In-Arc
Inhibited-Arcs
Inhibited-Arcs is a
special type of In-Arcs
labeled by a ball in the
end
Inhibited-Arcs will be
"Enabled" only if the
connected place is
"Empty

Inhibited-Arc
Out-Arc
Line from transition to place
Also, Identified by the weight
Weight represents the
number of tokens which will
be supplied to the connected
place if the connected
transition is fired
Transition
Out-Arc
Firing Event
W=1
W=2
W=4 W=2
W=1
W=2
Firing conditions
is satisfied

Firing Event is
triggered
W=2
W=4
T=2 sec
W=1
W=2
W=2
W=4
After 2 sec
W=1
W=2
W=2
W=4
3 sec later
T=3 sec
T=5 sec
W=1
W=2
W=2
W=4
After 2 sec

Capacity Limitation

W=1
W=2
W=4 W=2
T=2 sec
T=3 sec
T=5 sec
Capacity = 2
A
B
C D
Firing conditions is not satisfied
because the number of tokens in place
C + the connected Arc weight is
greater than the Capacity value.
Conflict
W=2
A
W=3
B
Which transition is will fire?
Resolving Conflict

W=1
Priority Level = 1
Priority Weight = 20
W=2
Priority Level = 1
Priority Weight =50

W=2
Priority Level = 2
Priority Weight = 0.4
W=3
Priority Level = 2
Priority Weight = 0.3

A

B

C

D

Number of Servers
W=1
Transition Delay = 10 sec
What happens after 10 seconds?
1. Single Server
2. Multiple Servers
3. Infinites Servers
Single Server
W=1


W=1 W=1
W=1 W=1
After 10 sec
After 10 sec
After 10 sec
One simultaneous firing
Mutable Servers
W=1
Transition Delay = 10 sec
Symantec Type = Multiple Server (2)
W=1 W=1
After 10 sec
After 10 sec
N simultaneous firings
Infinite Servers
W=1
W=1
After 10 sec
Transition Delay = 10 sec
Symantec Type = Infinite Server
Infinite simultaneous firings
Continuous Firing
3.2
3.2 L
0.5 L
?????
3.2
3.2 L
0.5 L
Velocity = 1
Weight = 1
Weight = 1
Transition is described by the "Velocity" = 1 / Transition Delay
Continues Firing Example Time = 0
30.5
50.1
3.2
0
3.2
3
1.2
1
4
1.5
2
V = 1.5
V = 2
2
1
Sampling Time = 1 sec
Continues Firing Example Time = 2
29
42.3
9.2
2.25 7.2
3
1.2
1
4
1.5
2
V = 1.5
0
Sampling Time = 1 sec
Continues Firing Example Time = 2
27.5
34.5
15.2
4.5
7.2
3
1.2
1
4
1.5
2
V = 1.5
V = 2
0
Sampling Time = 1 sec
Marking Update
If Transition Delay >0 for all transitions

M(K+1) = M(K)
+ [ (W
IT1
*U
IT1
+ W
IT2
*U
IT2
++ W
ITM
*U
ITM
)
(W
OT1
*U
OT1
+ W
OT2
*U
OT2
++ W
OTN
*U
OTN
)] * T

Where
U = V * min (1, M
IP1
, M
IP2
U
IPM
)
V Basic transition velocity = 1 / Transition Delay
M
IPi
are the marking of the input continuous place i

Marking Update
If Transition Delay =0 for at least one transition

M(K+1) = M(K) + [ (F
IT1
+F
IT2
++F
ITM
) - (F
OT1
+F
OT2
++F
OTN
)]

Where
F
ITi
are the firing quantity of the input continuous transitions i
F
OTj
are the firing quantity of the output continuous transitions j
Petri-Nets Types
Autonomous
Transition Delay and Place Delay = 0
T-Timed
Transition Delay >=0 and Place Delay = 0
P-Timed
Transition Delay =0 and Place Delay >= 0
Timed Petri Nets
Transition Delay >=0 and Place Delay >= 0

Petri-Nets Types
Deterministic
Parameters have constant values.
Stochastic
Parameters have random values with certain distribution
Petri-Nets Types
Discrete
Discrete firing
Continuous
Continuous firing
Example 1: 2 States Petri-Nets
Example 2: 2 Timed State Petri Nets
Example 3:
User access
to single
resource
E
x
a
m
p
l
e

4
:

2

U
s
e
r
s

A
c
c
e
s
s
i
n
g

S
i
n
g
l
e

R
e
s
o
u
r
c
e

Example 5:
n Users
Accessing
m Resources
Example 6:
Kanban System
Example 7: Reader Writer (Classical Problem)
Example 6: Hybrid System

You might also like