# Description

PERT.MOD models an activity precedence network, which uses graphs showing the activities that must be completed before others can start. The end of each activity is represented by a node and the duration of the activities by the edges. In the figure below, activity B must be finished before activities D and E can be started; therefore, the node, END_B, also represents the simultaneous starting of activities E and D.

The most common approaches to the static analysis of these networks are called PERT (Program Evaluation and Review Technique) and CPM (Critical Path Method). These two similar techniques are discussed in most textbooks on management or industrial engineering. Traditional CPM and PERT assume that the activity durations are either known or, if random, independent of each other. Clearly, in a real project the activity times are random as well as dependent (e.g., bad weather, labor disputes, or competition for resources generally will delay more than one activity). Using simulation, we can "dry-run" a project hundreds or thousands of times to learn what might happen before we submit a bid or commit to a contract.

# State Variables

State Variables in PERT.MOD
Variable Name Variable Description Size Type
I Index for each task 1 Integer
N[i] Number of incomplete predecessors for each task 100 Integer
NT Total number of tasks in project 1 Integer
L Lower limit on task times 100 Integer
U Upper limit on task times 100 Integer
TIME Time to finish the project 1 Real
B1 First Beta distribution parameter for task times 100 Real
B2 Second Beta distribution parameter for task time 100 Real
RUNS Number of replications 100 Integer
LATE Number of times late 100 Integer
PROB Probability of project being late 1 Real

# Vertices

Vertices in PERT.MOD
Vertex Name Vertex Description State Changes
RUN A simulation is started TIME=CLK
INPUT Read in the number of predecessors for each task N[I]=DISK{PERT.DAT;0*NT+I}, L[I]=DISK{PERT.DAT;1*NT+I}, U[I]=DISK{PERT.DAT;2*NT+I}, B1[I]=DISK{PERT.DAT;3*NT+I}, B2[I]=DISK{PERT.DAT;4*NT+I}
START The project is started S=S-1, Q=Q-1
END_A Task 1 is finished I=1, N[I]=N[I]-1
END_B Task 2 is finished I=2, N[I]=N[I]-1
END_C Task 3 is finished I=3, N[I]=N[I]-1
END_D Task 4 is finished I=4, N[I]=N[I]-1
END_E Task 5 is finished I=5, N[I]=N[I]-1
END_F Task 6 is finished I=6, N[I]=N[I]-1

# Initialization Conditions

Initialization Conditions in PERT.MOD
Variable Description
NT Number of tasks in project
N[NT+1] Number of incomplete predecessors for the last task

# English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

```The SIGMA Model, PERT.MOD, is a discrete event simulation.
It models PERT project analysis, Prob(TIME>DEADLINE).
```
```I. STATE VARIABLE DEFINITIONS.
```
```For this simulation, the following state variables are defined:
```
```I: Index for each task   (integer valued)
N: Number of incomplete predecessors for each task   (integer valued)
NT: Total number of tasks in project   (integer valued)
L: Lower limit on task times   (integer valued)
U: Upper limit on task times   (integer valued)
TIME: Time to finish the project  (real valued)
B1: First Beta distribution parameter for task times  (real valued)
B2: Second Beta distribution parameter for task time  (real valued)
RUNS: Number of replications   (integer valued)
LATE: Number of times late   (integer valued)
PROB: Probability of project being late  (real valued)
```
```II. EVENT DEFINITIONS.
```
```Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
```
```1. The RUN(NT,N[NT+1],DEADLINE) event occurs when a simulation run is started.
Initial values for, NT,N[NT+1],DEADLINE, are needed for each run.
This event causes the following state change(s):
TIME=CLK
After every occurrence of the RUN event:
Unconditionally, schedule the Input(I) event to occur without delay...
using the parameter value(s) of 1.
(Time ties are broken by an execution priority of 4.)
If 1, then data has been read and the project can start;
that is, schedule the START() event to occur without delay.
Unconditionally, schedule the next simulation run;
that is, schedule the RUN(NT,N[NT+1],DEADLINE) event to occur in 30 time units...
using the parameter value(s) of 6,2,14.
```
```2. The Input(I) event occurs when read in the number of predecessors for each task.
This event causes the following state change(s):
N[I]=DISK{PERT.DAT;0*NT+I}
L[I]=DISK{PERT.DAT;1*NT+I}
U[I]=DISK{PERT.DAT;2*NT+I}
B1[I]=DISK{PERT.DAT;3*NT+I}
B2[I]=DISK{PERT.DAT;4*NT+I}
After every occurrence of the Input event:
If I<NT, then schedule the Input(I) event to occur without delay...
using the parameter value(s) of I+1.
(Time ties are broken by an execution priority of 4.)
```
```3. The END_A() event occurs when task 1 is finished.
This event causes the following state change(s):
I=1
N[I]=N[I]-1
After every occurrence of the END_A event:
If N[I]<=0, then the next task can start;
that is, schedule the END_B() event to occur in L+(U-L)*BET{B1;B2} time units.
```
```4. The END_B() event occurs when task 2 is finished.
This event causes the following state change(s):
I=2
N[I]=N[I]-1
After every occurrence of the END_B event:
If N[I]<=0, then the next task can start;
that is, schedule the END_D() event to occur in L+(U-L)*BET{B1;B2} time units.
If N[I]<=0, then the next task can start;
that is, schedule the END_E() event to occur in L+(U-L)*BET{B1;B2} time units.
```
```5. The END_C() event occurs when task 3 is finished.
This event causes the following state change(s):
I=3
N[I]=N[I]-1
After every occurrence of the END_C event:
If N[I]<=0, then the next task can start;
that is, schedule the END_D() event to occur in L+(U-L)*BET{B1;B2} time units.
If N[I]<=0, then the next task can start;
that is, schedule the END_F() event to occur in L+(U-L)*BET{B1;B2} time units.
```
```6. The END_D() event occurs when task 4 is finished.
This event causes the following state change(s):
I=4
N[I]=N[I]-1
After every occurrence of the END_D event:
If N[I]<=0, then the next task can start;
that is, schedule the END_E() event to occur in L+(U-L)*BET{B1;B2} time units.
```
```7. The END_E() event occurs when task 5 is finished.
This event causes the following state change(s):
I=5
N[I]=N[I]-1
After every occurrence of the END_E event:
If N[I]<=0, then the next task can start;
that is, schedule the Done() event to occur without delay.
```
```8. The END_F() event occurs when task 1 is finished.
This event causes the following state change(s):
I=6
N[I]=N[I]-1
After every occurrence of the END_F event:
If N[I]<=0, then the next task can start;
that is, schedule the Done() event to occur without delay.
```
```9. The Done() event occurs when the project is finished, now compute time.
This event causes the following state change(s):
I=NT+1
N[I]=N[I]-1
After every occurrence of the Done event:
If N[NT+1]<=0, then schedule the TIME() event to occur without delay.
```
```10. The START() event occurs when the project is started.
After every occurrence of the START event:
If 1, then schedule the END_A() event to occur in L+(U-L)*BET{B1;B2}
time units.
If 1, then the next task can start;
that is, schedule the END_C() event to occur in L+(U-L)*BET{B1;B2} time units.
```
```11. The TIME() event occurs when project is finished, compute time.
This event causes the following state change(s):
TIME=CLK-TIME
RUNS=RUNS+1