1 5. m onte c arlo b ased cpm objective: to understand how to apply the monte carlo based cpm method...

34
1 5. MONTE CARLO BASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject to uncertainty: Summary: Part I: General Principles 5.1 Introduction 5.2 Monte Carlo Sampling 5.3 Application to a Construction Problem

Upload: barnard-price

Post on 16-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

1

5. MONTE CARLO BASED CPM

Objective: To understand how to apply the Monte Carlo based

CPM method to planning construction projects that are subject to uncertainty:

Summary:Part I: General Principles

5.1 Introduction5.2 Monte Carlo Sampling5.3 Application to a Construction Problem

Page 2: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

2

Part II: P3 Monte Carlo Related Issues

5.4 The Use of Lead and Lag Times

5.5 Total Float Calculations

5.6 Probabilistic & Conditional Activity Branches

5.7 Duration Distribution Types

5.8 Correlated Activity Durations

Page 3: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

3

Part I: General Principles

5.1 INTRODUCTION• Monte Carlo is a statistical method that allows a sample of

possible project outcomes to be made.• The probability of sampling an outcome is equal to the

probability of it occurring in the actual project.• Some characteristics:

– its accuracy increases with the number of samples made;– it is computationally expensive, but well within the capabilities

of today’s desktop computers;– the method is very flexible, allowing many real-world factors to

be included in the analysis.

Page 4: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

4

• It is used in similar situations to PERT:– when there is a lot of uncertainty about activity durations;– when there is a lot to be lost by finishing late (or by missing out on large bonuses for early completion).

• Its advantages over PERT are:– much more accurate;– much more flexible:

• measures variance on floats (as well as project duration);• measures probability of alternative paths becoming critical;• can be extended to take account of correlation between the durations of different activities;• can be extended to allow for exclusive activity branching.

Page 5: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

5Fig. 5-1: Observed Frequency Distribution

Observed Frequencyon Site

Activity duration20 2120 22 23 24 25 26 27 28 29 30 31 32 33 3401234567

5.2 MONTE CARLO SAMPLING• For each cycle through a Monte Carlo analysis, we

need to randomly select a duration for every activity.

• The probability of selecting a duration should match the likelihood of its occurrence on site:

most likelyduration T = 27 days

Observations from similarpast activities can be plotted

on a frequency chart

Observations from similarpast activities can be plotted

on a frequency chart

Page 6: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

6Fig. 5-2: Converting a Frequency Distribution to a PDF

FrequencyDistribution

Activity duration20 2120 22 23 24 25 26 27 28 29 30 31 32 33 3401234567

• The frequency distribution can be converted (automatically by the computer) into a probability density function (to give a continuous distribution):

– not necessary, but can give more accurate results for larger numbers of observations.

For example, if the distributionapproximates a Normal distribution,then can calculate:

sample mean: sample standarddeviation:

For example, if the distributionapproximates a Normal distribution,then can calculate:

sample mean: sample standarddeviation:

n

dX

1or

2

nn

dXS

Probability DensityFunction (pdf)

Page 7: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

7Fig. 5-3: Converting to the Cumulative Distribution(a) frequency to cumulative frequency distribution

A good method of sampling from a frequency distribution, or a probability density function, is the inverse transform method (ITM) (automatic by computer).

STEP 1: convert the frequency distribution to its cumulative frequency distribution:

FrequencyDistribution

Activity duration23 24 25 26 27 28 29

01234567

89

Activity duration

Cumulative FrequencyDistribution

23 24 25 26 27 28 290123456789 Total = 8 observations

FDCFD

Page 8: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

8

Fig. 5-3: Converting to the Cumulative Distribution(b) probability density to cumulative probability function

Activity duration

ProbabilityDensity Function

23 24 25 26 27 28 290.00.10.20.30.40.50.60.70.80.9

Probability ofcompleting within26 days = shadedarea = 0.65

If dealing with a probability density function then convert it to its cumulative probability function:

PDFCPF

Activity duration

Cumulative ProbabilityFunction

23 24 25 26 27 28 290

0.5

1.0

Probability ofcompleting within26 days = height= 0.65

Page 9: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

9

STEP 2: • generate a uniformly distributed random number between 0.0 and 1.0;

Fig. 5-4: Selecting a Duration from the Cumulative Distribution

Activity duration

Cumulative FrequencyDistribution

23 24 25 26 27 28 290123456789

0.0 1.0

PDF

Uniform Distribution

*

r = 0.81

• multiply it by the number of observations;

• go to the multiplied number on the vertical axis;

• read across until you hit a cumulative distribution bar and select the corresponding duration

R = 0.81 * 8 = 6.48Selected ActivityDuration = 27 days

Page 10: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

10

It can be seen that the probability of selecting a duration in this way is proportional to the length of the left-side exposed face of its bar. Eg:

Fig. 5-5: Probability of Selecting an Activity DurationActivity duration

Cumulative FrequencyDistribution

23 24 25 26 27 28 290123456789

2 exposed blocksfor 25 days

3 exposed blocks for 26 days

0 exposed blocks for 28 days

– the bar for a duration of 26 days has 3 blocks exposed;

– the bar for 28 days has 0 blocks exposed;

and the number of exposed blocks corresponds to the number of site observations made at that duration (see the left side of Fig 5-3 (a)).

– the bar for a duration of 25 days has 2 blocks exposed;

Page 11: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

11

5.3 APPLICATION TO A CONSTRUCTION PROBLEM

The following will perform 6 Monte Carlo cycles on a very simple project:

Page 12: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

12Fig. 5-6: Example of Monte Carlo CPM Process

21

cf

d

act ‘A’

5 8

21

cf

d

act ‘B’

9 11 13

34

21

cf

d

act ‘C’

5 10 15

34

9

8

19

181 1

1

10

act ‘C’

8

8

19

190 0

0

11

act ‘B’

0

0

8

80 0

0

8 act ‘A’ dummy

19

19

Cycle 1:

ES EF LS LF TF FF IFd

cycle n ES EF LS LF TF FF IFd ES EF LS LF TF FF IFd

Activity ‘A’ Activity ‘B’ Activity ‘C’

Mean TF = 0 Mean FF = 0 Mean IF = 0 Critical Index = 1.0

Mean TF = 1.33 Mean FF = 1.33Mean IF = 1.33 Critical Index = 0.67

Mean TF = 3.17 Mean FF = 3.17 Mean IF = 3.17 Critical Index = 0.33

81 0 8 0 8 0 0 0 11 8 19 8 19 0 0 0 10 8 18 9 19 1 1 1

52 0 5 0 5 0 0 0 13 5 18 7 20 2 2 2 15 5 20 5 20 0 0 0

53 0 5 0 5 0 0 0 11 5 16 5 16 0 0 0 5 5 10 11 16 6 6 6

84 0 8 0 8 0 0 0 9 8 17 14 23 6 6 6 15 8 23 8 23 0 0 0

55 0 5 0 5 0 0 0 11 5 16 5 16 0 0 0 5 5 10 11 16 6 6 6

86 0 8 0 8 0 0 0 11 8 19 8 19 0 0 0 5 8 13 14 19 6 6 6

Page 13: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

13

Fig. 5-7: Analysis of Results from Monte Carlo CPM

Project duration

Sampled FrequencyDistribution

17 18 19 20 21 22 23012

16

n

dX Mean Project Duration = = 18.8 days

1

2

n

dXSStandard Deviation on Duration = = 2.64 days

Need More Samples(cycles)

Variance on Duration = 6.98 days

2. What is the probability of completing within the deterministic duration (17.75 days)?

3. What is the probability of activity ‘B’ having <=5 days float?

A: 6.50 (act A) + 11.25 (act C) = 17.75 days (note, this is less than the mean project duration according to the Monte Carlo analysis)

4.0

98.6

8.1875.17

z A: p = 34.5 % (much less than 50%)

Questions:

1. What is the deterministic project duration?

(use the observed frequencies as not a Normal distribution) A: p = 5/6 = 83.3%

Page 14: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

14

Part II: P3 Monte Carlo Related Issues

5.4 THE USE OF LEAD AND LAG TIMES

• P3 Monte Carlo interprets negative delays on links (negative lags in P3 terminology) as zero lag:

– so how can we represent situations requiring negative delays?

– first of all, we will review what we mean by negative delays, then we will explore possible solutions.

Page 15: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

15Fig. 5-8: Dealing with Delays

(b) negative delay

(a) simple delay

PRECEDENCE DIAGRAM BAR CHART

act AdA

act BdB

+5 days

act BdB

act A

dA

5 days

act AdA

act BdB

-5 days act BdB

act A

dA

-5 days

Earliest B can start is5 days after end of A

Note: negative delay

Earliest B can start is5 days before end of A

Example:delay is for

cure concrete.

Example:Until the last 5 days of

A, both activitiesneed same space.

Page 16: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

16

• Can we get around the problem by:– reversing the direction of the activity link, and then

using a positive delay?

Page 17: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

17Fig. 5-9: Reversing the Direction of the Activity Link

PRECEDENCE DIAGRAM BAR CHART

act AdA

act BdB

- 5 daysact B

dB

act A

dA

-5 days

Earliest B can start is5 days before end of A

act AdA

act BdB

+ 5 days

Are these equivalent ?

act BdB

act A

dA

-5 days

Latest B can start is5 days before end of A

Example:A is dry walling and B

is inspection ofto be hidden columns.NO !

Page 18: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

18

• Can we get around the problem by:– using a positive delay from the start of the

activity?

Page 19: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

19Fig. 5-10: Measuring the Delay from the Start of the Activity Link

PRECEDENCE DIAGRAM BAR CHART

act AdA

act BdB

- 5 daysact B

dB

act A

dA

-5 days

Earliest B can start is5 days before end of A

Are these equivalent ?

Only ifdA is fixed !

act BdB

Earliest B can start is5 days before end of A

act AdA

act BdB

(dA-5) days

UsingMonte CarlodA changes !

act A

dA

(dA-5) days

Page 20: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

20

• For example, if dA is expected to last 14 days:

– then the delay from start of activity A to start of B = 14 - 5 = 9 days;

– this must be specified before all the Monte Carlo cycles start (it cannot change from cycle to cycle).

• but in Monte Carlo, the duration is variable from cycle to cycle:– thus, if in one Monte Carlo analysis, activity A

was 12 days, then the 9 day delay would allow B to start just 3 days before the end of A !!!

act AdA

act BdB

(dA-5) days

Page 21: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

21Fig. 5-11: Introducing a Dummy Activity with F-F and S-S Links

PRECEDENCE DIAGRAM BAR CHART

act AdA

act BdB

- 5 daysact B

dB

act A

dA

-5 days

Earliest B can start is5 days before end of A

Are these equivalent ?

act BdB

Earliest B can start is5 days before end of A

act A

dA

act AdA

act BdB

dummy 5

Yes! as long asdummy cannot be

delayeddummy: 5

Page 22: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

22

5.5 TOTAL FLOAT CALCULATIONS• P3 Monte Carlo provides several choices for calculating Total Float:

– Finish Total Float;– Start Total Float;– Critical Total Float; and– Interruptible Total Float.

• For most activities, these different types of Total Float will have the same value.

• Differences occur when there are links from the start of an activity, or to the finish of an activity.

• What do the different types of Total Float represent, and when should we use each one?

Page 23: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

23Fig. 5-12: Graphical Interpretation of Different Types of Total Float

BAR CHART

0

0

22

10

10 act ‘A’

0

0

22

10

5 act ‘B’

20

20

30

30

10 act ‘C’

0

0

8

20

PRECEDENCE DIAGRAM

act ‘A’

act ‘C’

P3: Start TF =0 - 0 = 0

P3: Start TF =0 - 0 = 0

P3: Finish TF =22 - 10 = 12

P3: Finish TF =22 - 10 = 12

Note, activity B mustbe interrupted 5 days.

It cannot start after 0, andcannot finish before 10,

yet it only has 5 days of work

Note, activity B mustbe interrupted 5 days.

It cannot start after 0, andcannot finish before 10,

yet it only has 5 days of work

P3: Start TF = 0P3: Start TF = 0

P3: Finish TF = 12P3: Finish TF = 12

Standard TF includesnecessary interruptions to

the activity (and Finish TF) = 17

Standard TF includesnecessary interruptions to

the activity (and Finish TF) = 17

act ‘B’

Standard TF =22 - 0 - 5 = 17

Standard TF =22 - 0 - 5 = 17

Page 24: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

24

• Critical Total Float is defined as:smallest of Start Total Float and Finish Total Float– use Start TF when concerned about allowable delays to the start of the activity;– use Finish TF when concerned about allowable delays to the finish of the activity;– use Critical TF when concerned about the worst case for the activity;

• Interruptible Total Float is defined as:Finish Total Float with:

late start time = early start time + Total Float.

• The Standard Total Float is not available in P3 MC, but it tells us:– the sum of all allowable delays on the activity, including those resulting from forced

interruptions (necessary to ensure the logic of the network).

Page 25: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

25

5.6 PROBABILISTIC AND CONDITIONAL

ACTIVITY BRANCHES

• P3 Monte Carlo provides decision branches:– points in a network where alternative sequences of

activities can be performed;– two types:

• probabilistic - where the choice of branch is random;

• conditional - where the choice of branch is dependent on whether a task has started (or finished).

Page 26: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

26Fig. 5-13: Decision Branches in a Network

(a) probabilistic (random)

(b) conditional

failor pass

?

inspect HVACequipment

pass: p = 95%next task…

make-good installation

fail: p = 5%

act ‘X’finished

?

position steelin found exc.

yes

use craneto convey

conc to found

use concretepumps

no

activity ‘X’ (uses crane)

Page 27: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

27

Fig. 5-14: Decision Branch Rules

(a) decision node must be only predecessor (b) no actual start times for branch activities

(b) no SS and SF links from branch activities

act ‘B’ xnot allowed

decisionnode

outcome ‘b’

outcome ‘a’act ‘A’

act ‘B’

decisionnode

outcome ‘b’

outcome ‘a’act ‘A’

act ‘B’

A specified actualstart time.

A specified actualstart time.xnot allowed

xnot allowed

decisionnode

outcome ‘b’

outcome ‘a’act ‘A’

act ‘B’

Page 28: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

28

Fig. 5-15: Multiple Decisions (Trees)

pass/fail

?

inspect HVACequipment

act ‘B’pass: p = 80%

fail: p = 20%

major/minor

?

act ‘B’minor problems: p = 75%

act ‘B’major problems: p = 25%

combined probabilityof major installation

problems is:20% x 25% = 5%

combined probabilityof major installation

problems is:20% x 25% = 5%

Page 29: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

29

5.7 DISTRIBUTION TYPES

• P3 Monte Carlo provides 4 basic types of activity duration distribution:– Triangular;– Modified Triangular;– Poisson;– Custom.

Page 30: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

30Fig. 5-16: Activity Distribution Types in P3 MC

(a) Triangular Distribution

act duration

probability

pessimistic

most likely

optimistic

(b) Modified Triangular Distribution

act duration

probability

pessimistic

most likely

optimistic

Anything sampled withinthe end X & Y percentiles are

read as the limit (thuscreating a spike at each end).

Anything sampled withinthe end X & Y percentiles are

read as the limit (thuscreating a spike at each end).

Y%

(c) Poisson Distribution

act duration

probability

S = ?P = ?

(d) Custom

act duration

probabilityA discretedistribution

A discretedistribution

Define the durations thatcan occur and their

respective probabilities

Define the durations thatcan occur and their

respective probabilities

X%

Page 31: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

31

5.8 CORRELATED ACTIVITY DURATIONS

• P3 Monte Carlo allows activity durations to be either completely correlated or completely uncorrelated:

– Uncorrelated:• the duration of activity ’A’ has no relationship to the duration of

activity ‘B’;

– Correlated:• the duration of activity ’A’ is either dependent on the duration of

activity ‘B’ or is dependent on something else that ‘B’ is also dependent on.

Page 32: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

32Fig. 5-17: Types of Correlation Between Two Activity Durations

(a) Linear Perfect Correlation

duration A

duration B

x

y duration ofA is a linearfunction of

duration of B

duration ofA is a linearfunction of

duration of B

(b) Non-Linear Perfect Correlation

duration A

duration B

x

y

duration ofA is a nonlinear

function ofduration of B

duration ofA is a nonlinear

function ofduration of B

(c) Linear Perfect Negative Correlation

duration A

duration B

x

y

as duration ofA increases,duration of B

decreases

as duration ofA increases,duration of B

decreases

(d) Partially Correlated

duration A

duration B

x

duration ofA is partiallycorrelated toduration of B

duration ofA is partiallycorrelated toduration of B

rangeof possiblevalues of y

for a given x

Page 33: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

33Fig. 5-18: Types of Correlation Between Two Activity Durations

cum

ulat

ive

pdf

activity ‘A’ d

uration

• P3 Monte Carlo correlates two activity durations by using the same random number to generate their durations:

Same randomnumber for

both activities

Same randomnumber for

both activities

cum

ulat

ive

pdf

activity ‘B’ d

uration

Page 34: 1 5. M ONTE C ARLO B ASED CPM Objective: To understand how to apply the Monte Carlo based CPM method to planning construction projects that are subject

34Fig. 5-19: Impact of Correlated Activity Durations on Project Duration

(a) sequential, correlated activities

act A act B

10+20=30

prob

10 20duration A

Correlated

20+30=50

(b) sequential, uncorrelated activities

act A act B

10+20=30

prob

10 20duration A

Un-Correlated

10+30=40

20+20=40

prob

20 30duration B

prob

20 30duration B

20+30=50

30project duration

prob

30 50project duration

prob

p=0.5 p=0.5

50 40