The CPM Procedure

Example 4.25 Resource-Driven Durations and Alternate Resources

Consider the software project defined in Example 4.24 but now the project requires a single resource: a programmer. A network diagram displaying the activities and their precedence relationships is shown in Output 4.24.1, as part of the same example.

Some of the activities in this project have a fixed duration, requiring a fixed length of time from a programmer. Other activities specify the amount of work required in terms of man-days; for these activities, the length of the task will depend on the number of programmers (or rate) that is assigned to the task. The activities in the project, their durations (if fixed) or the total work required (if resource-driven) in days, the precedence constraints, and the resource requirements are displayed in Output 4.25.1.

Suppose that you have only one programmer assigned to the project. You can determine a resource-constrained schedule using PROC CPM by specifying a resource availability data set, resin (also in Output 4.25.1). The Resource data set indicates that the resource Programmer is a driving resource whenever the WORK variable has a valid value.

Output 4.25.1: Project Data

Software Development
Activity Data Set SOFTWARE

Activity act s1 s2 dur mandays Programmer
Plans & Reqts 1 2 3 2 . 1
Product Design 2 4 5 . 3 1
Test Plan 3 6 7 3 . .
Documentation 4 9 . 1 2 1
Code 5 8 . 1 10 1
Test Data 6 8 . 5 . .
Test Routines 7 8 . 5 . .
Test Product 8 9 . 6 . 1
Finish 9 . . 0 . .

Software Development
Resource Availability Data Set

Obs per otype Programmer
1 . resrcdur 1
2 12APR04 reslevel 1



The following statements invoke PROC CPM with a WORK= specification on the RESOURCE statement, which identifies (in number of man-days, in this case) the amount of work required from the resource Programmer for each activity. If the WORK variable has a missing value, the activity in that observation is assumed to have a fixed duration. The project is scheduled to start on April 12, 2004, and the activities are assumed to follow a five-day work week. The resulting schedule is displayed in Output 4.25.2. For each activity in the project, the value of the variable DUR_TYPE indicates whether the resource drives the activity’s duration ('RDRIVEN') or not ('FIXED').

proc cpm data=software
         out=sftout1 resout=rout1
         rsched=rsftout1
         resin=resin
         date='12apr04'd interval=weekday;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer / work=mandays
                    obstype=otype
                    period=per
                    rschedid=Activity;
   id Activity;
   run;

title 'Software Development';
title2 'Resource Constrained Schedule: Single Programmer';
proc print data=rsftout1 heading=h;
   id Activity;
   run;

Output 4.25.2: Resource Schedule

Software Development
Resource Constrained Schedule: Single Programmer

Activity act RESOURCE DUR_TYPE dur mandays R_RATE S_START S_FINISH E_START E_FINISH L_START L_FINISH
Plans & Reqts 1     2 . . 12APR04 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 1 Programmer FIXED 2 . 1 12APR04 13APR04 12APR04 13APR04 12APR04 13APR04
Product Design 2     3 . . 14APR04 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 2 Programmer RDRIVEN 3 3 1 14APR04 16APR04 14APR04 16APR04 14APR04 16APR04
Test Plan 3     3 . . 14APR04 16APR04 14APR04 16APR04 21APR04 23APR04
Documentation 4     1 . . 11MAY04 12MAY04 19APR04 20APR04 07MAY04 10MAY04
Documentation 4 Programmer RDRIVEN 2 2 1 11MAY04 12MAY04 19APR04 20APR04 07MAY04 10MAY04
Code 5     1 . . 19APR04 30APR04 19APR04 30APR04 19APR04 30APR04
Code 5 Programmer RDRIVEN 10 10 1 19APR04 30APR04 19APR04 30APR04 19APR04 30APR04
Test Data 6     5 . . 19APR04 23APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 7     5 . . 19APR04 23APR04 19APR04 23APR04 26APR04 30APR04
Test Product 8     6 . . 03MAY04 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 8 Programmer FIXED 6 . 1 03MAY04 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Finish 9     0 . . 13MAY04 13MAY04 11MAY04 11MAY04 11MAY04 11MAY04



The following statements invoke PROC GANTT to display a Gantt chart of the schedule in Output 4.25.3. The activity, 'Documentation', is delayed until May 11, 2004, because there is only one programmer available to the project.


title h=2.5 'Software Development';
title2 h=1.5 'Resource Constrained Schedule: Single Programmer';
proc gantt graphics data=sftout1;
   id Activity Programmer;
   chart / compress scale=3 increment=4 interval=weekday
           height=2.8 nojobnum nolegend between=5
           act=act succ=(s1 s2)
           cprec=cyan
           caxis=black
           ;
   run;

Output 4.25.3: Resource-Constrained Schedule: Single Programmer

Resource-Constrained Schedule: Single Programmer


Next, suppose that you have two programmers assigned to your project and you can use either one of them for a given task, depending on their availability. To model this scenario, specify Chris and John as alternate resources that can be substituted for the resource Programmer. The Resource data set, resin2, printed in Output 4.25.4, indicates that Chris and John are alternates for Programmer. Specifying an availability of '0' for the resource Programmer ensures that the procedure will assign one of the two programmers, Chris or John, to each task.

The second observation in the data set resin2 indicates two different rates of substitution for the alternate resources. A value less than 1 indicates that the alternate resource is more efficient than the primary resource, while a value greater than 1 indicates that the alternate resource is less efficient. For fixed-duration activities, the use of the alternate resource changes the rate of utilization of the resource, while for a resource-driven activity, it changes the duration of the resource. The data set resin specifies that John is twice as efficient as the primary resource Programmer while Chris takes one and a half times as long as the generic resource to accomplish a task.

Output 4.25.4: Alternate Programmers

Resource Data Set RESIN2

Obs per otype resid Programmer Chris John
1 . resrcdur   1 1.0 1.0
2 . altrate Programmer . 1.5 0.5
3 12APR04 reslevel   . 1.0 1.0



The following statements invoke PROC CPM with the new Resource data set and a modified Activity data set that includes the newly added resource variables, Chris and John. You can see the effects of the alternate resource specifications in the Resource Schedule data set, printed in Output 4.25.5. The activity 'Product Design' that takes 3 days of time from a generic programmer actually takes 4.5 days because the programmer used is Chris, who is substituted at a rate of 1.5. On the other hand, the programmer John efficiently completes the task, 'Documentation', in only 1 day, instead of the planned 2 days for a generic programmer. Note also that the start and finish times are specified as SAS datetime values because the substitution of alternate resources results in some of the resource durations being fractional.

data software2;
  set software;
  Chris = .;
  John = .;
  run;

proc cpm data=software2 out=sftout2 rsched=rsftout2
         resin=resin2
         date='12apr04'd interval=weekday resout=rout2;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer Chris John / work=mandays
                               obstype=otype
                               period=per
                               resid=resid
                               rschedid=Activity;
   id Activity;
   run;

Output 4.25.5: Resource Schedule with Alternate Programmers

Software Development
Resource Constrained Schedule
Alternate Resources at Varying Rates

Activity act RESOURCE DUR_TYPE dur mandays R_RATE S_START S_FINISH E_START E_FINISH
Plans & Reqts 1     2.0 . . 12APR04:00:00:00 13APR04:23:59:59 12APR04:00:00:00 13APR04:23:59:59
Plans & Reqts 1 Programmer FIXED 2.0 . 1.0 . . 12APR04:00:00:00 13APR04:23:59:59
Plans & Reqts 1 John FIXED 2.0 . 0.5 12APR04:00:00:00 13APR04:23:59:59 . .
Product Design 2     3.0 . . 14APR04:00:00:00 20APR04:11:59:59 14APR04:00:00:00 16APR04:23:59:59
Product Design 2 Programmer RDRIVEN 3.0 3.0 1.0 . . 14APR04:00:00:00 16APR04:23:59:59
Product Design 2 Chris RDRIVEN 4.5 4.5 1.0 14APR04:00:00:00 20APR04:11:59:59 . .
Test Plan 3     3.0 . . 14APR04:00:00:00 16APR04:23:59:59 14APR04:00:00:00 16APR04:23:59:59
Documentation 4     1.0 . . 20APR04:12:00:00 21APR04:11:59:59 19APR04:00:00:00 20APR04:23:59:59
Documentation 4 Programmer RDRIVEN 2.0 2.0 1.0 . . 19APR04:00:00:00 20APR04:23:59:59
Documentation 4 John RDRIVEN 1.0 1.0 1.0 20APR04:12:00:00 21APR04:11:59:59 . .
Code 5     1.0 . . 20APR04:12:00:00 11MAY04:11:59:59 19APR04:00:00:00 30APR04:23:59:59
Code 5 Programmer RDRIVEN 10.0 10.0 1.0 . . 19APR04:00:00:00 30APR04:23:59:59
Code 5 Chris RDRIVEN 15.0 15.0 1.0 20APR04:12:00:00 11MAY04:11:59:59 . .
Test Data 6     5.0 . . 19APR04:00:00:00 23APR04:23:59:59 19APR04:00:00:00 23APR04:23:59:59
Test Routines 7     5.0 . . 19APR04:00:00:00 23APR04:23:59:59 19APR04:00:00:00 23APR04:23:59:59
Test Product 8     6.0 . . 11MAY04:12:00:00 19MAY04:11:59:59 03MAY04:00:00:00 10MAY04:23:59:59
Test Product 8 Programmer FIXED 6.0 . 1.0 . . 03MAY04:00:00:00 10MAY04:23:59:59
Test Product 8 John FIXED 6.0 . 0.5 11MAY04:12:00:00 19MAY04:11:59:59 . .
Finish 9     0.0 . . 19MAY04:12:00:00 19MAY04:12:00:00 11MAY04:00:00:00 11MAY04:00:00:00