Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The CPM Procedure

Example 2.18: Variable Activity Delay

In Example 2.17, the DELAY= option is used to specify a maximum amount of delay that is allowed for all activities in the project. In some situations it may be reasonable to set the delay for each activity based on some characteristic pertaining to the activity. For example, consider the data in Example 2.17 with a slightly different scenario. Suppose that no delay is allowed in activities that require a production engineer. Data set WIDGR18, displayed in Output 2.18.1, is obtained from WIDGR17 using the following simple DATA step.
   data widgr18;
      set widgr17;
      if prodeng ^= . then adelay = 0;
      else                 adelay = 5;
      run;

   title 'Variable Activity Delay';
   title2 'Data Set WIDGR18';
   proc print;
      run;

Output 2.18.1: Activity Data Set WIDGR18

Variable Activity Delay
Data Set WIDGR18

Obs task days tail head deseng mktan prodeng money adelay
1 Approve Plan 5 1 2 1 1 1 200 0
2 Drawings 10 2 3 1 . 1 100 0
3 Anal. Market 5 2 4 . 1 1 100 0
4 Write Specs 5 2 3 1 . 1 150 0
5 Prototype 15 3 5 1 . 1 300 0
6 Mkt. Strat. 10 4 6 . 1 . 150 5
7 Materials 10 5 7 . . . 300 5
8 Facility 10 5 7 . . 1 500 0
9 Init. Prod. 10 7 8 . . . 250 5
10 Evaluate 10 8 9 1 . . 150 5
11 Test Market 15 6 9 . 1 . 200 5
12 Changes 5 9 10 1 . 1 200 0
13 Production 0 10 11 1 . 1 600 0
14 Marketing 0 6 12 . 1 . . 5
15 Dummy 0 8 6 . . . . 5


PROC CPM is invoked with the ACTDELAY=ADELAY option in the RESOURCE statement. The INFEASDIAGNOSTIC option is also used to enable the procedure to schedule activities even if resources are insufficient. The output data sets are displayed in Output 2.18.2 and Output 2.18.3.

   data resin17;
      input per date7. otype $ 11-18
            deseng mktan prodeng money;
      format per date7.;
      datalines;
   .         restype  1  1 1 2
   02dec91   reslevel 1  . 1 .
   ;

   data holdata;
      format hol date7.;
      input hol date7. name $ 10-18;
      datalines;
   25dec91  Christmas
   01jan92  New Year
   ;

   proc cpm date='02dec91'd
            interval=weekday
            data=widgr18
            holidata=holdata
            resin=resin17
            out=widgo18
            resout=widgro18;
      tailnode tail;
      duration days;
      headnode head;
      holiday hol;
      resource deseng prodeng mktan money / period=per
                                            obstype=otype
                                            delayanalysis
                                            actdelay=adelay
                                            infeasdiagnostic
                                            rcs avl t_float
                                            cumusage;
      id task;
      run;

Output 2.18.2: Resource-Constrained Schedule: Variable Activity Delay

Variable Activity Delay
Resource Constrained Schedule

Obs tail head days task adelay deseng prodeng mktan money S_START S_FINISH E_START E_FINISH L_START L_FINISH T_FLOAT R_DELAY DELAY_R SUPPL_R
1 1 2 5 Approve Plan 0 1 1 1 200 02DEC91 06DEC91 02DEC91 06DEC91 02DEC91 06DEC91 0 0   mktan
2 2 3 10 Drawings 0 1 1 . 100 09DEC91 20DEC91 09DEC91 20DEC91 09DEC91 20DEC91 0 0   money
3 2 4 5 Anal. Market 0 . 1 1 100 15JAN92 21JAN92 09DEC91 13DEC91 22JAN92 28JAN92 30 25 prodeng prodeng
4 2 3 5 Write Specs 0 1 1 . 150 09DEC91 13DEC91 09DEC91 13DEC91 16DEC91 20DEC91 5 0   deseng
5 3 5 15 Prototype 0 1 1 . 300 23DEC91 14JAN92 23DEC91 14JAN92 23DEC91 14JAN92 0 0   money
6 4 6 10 Mkt. Strat. 5 . . 1 150 22JAN92 04FEB92 16DEC91 30DEC91 29JAN92 11FEB92 30 0   mktan
7 5 7 10 Materials 5 . . . 300 15JAN92 28JAN92 15JAN92 28JAN92 15JAN92 28JAN92 0 0   money
8 5 7 10 Facility 0 . 1 . 500 15JAN92 28JAN92 15JAN92 28JAN92 15JAN92 28JAN92 0 0   money
9 7 8 10 Init. Prod. 5 . . . 250 29JAN92 11FEB92 29JAN92 11FEB92 29JAN92 11FEB92 0 0   money
10 8 9 10 Evaluate 5 1 . . 150 12FEB92 25FEB92 12FEB92 25FEB92 19FEB92 03MAR92 5 0   money
11 6 9 15 Test Market 5 . . 1 200 12FEB92 03MAR92 12FEB92 03MAR92 12FEB92 03MAR92 0 0   mktan
12 9 10 5 Changes 0 1 1 . 200 04MAR92 10MAR92 04MAR92 10MAR92 04MAR92 10MAR92 0 0   money
13 10 11 0 Production 0 1 1 . 600 11MAR92 11MAR92 11MAR92 11MAR92 11MAR92 11MAR92 0 0    
14 6 12 0 Marketing 5 . . 1 . 12FEB92 12FEB92 12FEB92 12FEB92 11MAR92 11MAR92 20 0    
15 8 6 0 Dummy 5 . . . . 12FEB92 12FEB92 12FEB92 12FEB92 12FEB92 12FEB92 0 0    

Output 2.18.3: Resource Usage

Variable Activity Delay
Usage Profile

Obs _TIME_ Rdeseng Adeseng Rprodeng Aprodeng Rmktan Amktan Rmoney Amoney
1 02DEC91 1 0 1 0 1 -1 0 0
2 03DEC91 1 0 1 0 1 -1 200 -200
3 04DEC91 1 0 1 0 1 -1 400 -400
4 05DEC91 1 0 1 0 1 -1 600 -600
5 06DEC91 1 0 1 0 1 -1 800 -800
6 09DEC91 2 -1 2 -1 0 0 1000 -1000
7 10DEC91 2 -1 2 -1 0 0 1250 -1250
8 11DEC91 2 -1 2 -1 0 0 1500 -1500
9 12DEC91 2 -1 2 -1 0 0 1750 -1750
10 13DEC91 2 -1 2 -1 0 0 2000 -2000
11 16DEC91 1 0 1 0 0 0 2250 -2250
12 17DEC91 1 0 1 0 0 0 2350 -2350
13 18DEC91 1 0 1 0 0 0 2450 -2450
14 19DEC91 1 0 1 0 0 0 2550 -2550
15 20DEC91 1 0 1 0 0 0 2650 -2650
16 23DEC91 1 0 1 0 0 0 2750 -2750
17 24DEC91 1 0 1 0 0 0 3050 -3050
18 26DEC91 1 0 1 0 0 0 3350 -3350
19 27DEC91 1 0 1 0 0 0 3650 -3650
20 30DEC91 1 0 1 0 0 0 3950 -3950
21 31DEC91 1 0 1 0 0 0 4250 -4250
22 02JAN92 1 0 1 0 0 0 4550 -4550
23 03JAN92 1 0 1 0 0 0 4850 -4850
24 06JAN92 1 0 1 0 0 0 5150 -5150
25 07JAN92 1 0 1 0 0 0 5450 -5450
26 08JAN92 1 0 1 0 0 0 5750 -5750
27 09JAN92 1 0 1 0 0 0 6050 -6050
28 10JAN92 1 0 1 0 0 0 6350 -6350
29 13JAN92 1 0 1 0 0 0 6650 -6650
30 14JAN92 1 0 1 0 0 0 6950 -6950
31 15JAN92 0 1 2 -1 1 -1 7250 -7250
32 16JAN92 0 1 2 -1 1 -1 8150 -8150
33 17JAN92 0 1 2 -1 1 -1 9050 -9050
34 20JAN92 0 1 2 -1 1 -1 9950 -9950
35 21JAN92 0 1 2 -1 1 -1 10850 -10850
36 22JAN92 0 1 1 0 1 -1 11750 -11750
37 23JAN92 0 1 1 0 1 -1 12700 -12700
38 24JAN92 0 1 1 0 1 -1 13650 -13650
39 27JAN92 0 1 1 0 1 -1 14600 -14600
40 28JAN92 0 1 1 0 1 -1 15550 -15550
41 29JAN92 0 1 0 1 1 -1 16500 -16500
42 30JAN92 0 1 0 1 1 -1 16900 -16900
43 31JAN92 0 1 0 1 1 -1 17300 -17300
44 03FEB92 0 1 0 1 1 -1 17700 -17700
45 04FEB92 0 1 0 1 1 -1 18100 -18100
46 05FEB92 0 1 0 1 0 0 18500 -18500
47 06FEB92 0 1 0 1 0 0 18750 -18750
48 07FEB92 0 1 0 1 0 0 19000 -19000
49 10FEB92 0 1 0 1 0 0 19250 -19250
50 11FEB92 0 1 0 1 0 0 19500 -19500
51 12FEB92 1 0 0 1 1 -1 19750 -19750
52 13FEB92 1 0 0 1 1 -1 20100 -20100
53 14FEB92 1 0 0 1 1 -1 20450 -20450
54 17FEB92 1 0 0 1 1 -1 20800 -20800
55 18FEB92 1 0 0 1 1 -1 21150 -21150
56 19FEB92 1 0 0 1 1 -1 21500 -21500
57 20FEB92 1 0 0 1 1 -1 21850 -21850
58 21FEB92 1 0 0 1 1 -1 22200 -22200
59 24FEB92 1 0 0 1 1 -1 22550 -22550
60 25FEB92 1 0 0 1 1 -1 22900 -22900
61 26FEB92 0 1 0 1 1 -1 23250 -23250
62 27FEB92 0 1 0 1 1 -1 23450 -23450
63 28FEB92 0 1 0 1 1 -1 23650 -23650
64 02MAR92 0 1 0 1 1 -1 23850 -23850
65 03MAR92 0 1 0 1 1 -1 24050 -24050
66 04MAR92 1 0 1 0 0 0 24250 -24250
67 05MAR92 1 0 1 0 0 0 24450 -24450
68 06MAR92 1 0 1 0 0 0 24650 -24650
69 09MAR92 1 0 1 0 0 0 24850 -24850
70 10MAR92 1 0 1 0 0 0 25050 -25050
71 11MAR92 0 1 0 1 0 0 25250 -25250


Note from the Schedule data set that the activity `Anal. Market' is scheduled to start on January 15, 1992, even though (L_START + adelay)=22JAN92. This is due to the fact that at every time interval, the scheduling algorithm looks ahead in time to detect any increase in the primary level of the resource; if the future resource profile indicates that the procedure will need to use supplementary levels anyway, the activity will not be forced to wait until (L_START + DELAY). (To force the activity to wait until its latest allowed start time, use the AWAITDELAY option). The DELAYANALYSIS variables indicate that a supplementary level of the resource prodeng is needed to schedule the activity on 15JAN92. Note that the variable SUPPL_R identifies only one supplementary resource that is needed for the activity. In fact, examination of the resource requirements for the activity and the RESOURCEOUT data set shows that an extra market analyst is also needed between the 15th and 21st of January to schedule this activity. Likewise, the activities `Write Specs' and `Drawings' require a design engineer and a production engineer; both these activities start on the 9th of December. The RESOURCEOUT data set indicates that an extra design engineer and an extra production engineer are needed from the 9th to the 13th of December.

The next invocation of PROC CPM illustrates the use of the ACTDELAY variable to force the resource-constrained schedule to coincide with the early start schedule. The following DATA step uses the Schedule data set WIDGO18 to set an activity delay variable (actdel) to be equal to -T_FLOAT. PROC CPM is then invoked with the ACTDELAY variable equal to actdel and the INFEASDIAGNOSTIC option. This forces all activities to be scheduled on or before (L_START + actdel), which happens to be equal to E_START; thus all activities are scheduled to start at their early start time. The resulting Schedule data set is displayed in Output 2.18.4. Though this is an extreme case, a similar technique could be used selectively to set the delay value for each activity (or some of the activities) to depend on the unconstrained schedule or the T_FLOAT value. Note that if both the DELAY= and ACTDELAY= options are specified, the DELAY= value is used to set the activity delay values for activities that have missing values for the ACTDELAY variable.

Note also that in this invocation of PROC CPM, the BASELINE statement is used to compare the early start schedule and the resource constrained schedule. Note that the S_VAR and F_VAR variables are 0 for all the activities, as is to be expected (since all activities are forced to start as per the early start schedule.)

   data negdelay;
      set widgo18;
      actdel=-t_float;
      run;

   proc cpm date='02dec91'd
            interval=weekday
            data=negdelay
            holidata=holdata
            resin=resin17
            out=widgo18n;
      tailnode tail;
      duration days;
      headnode head;
      holiday hol;
      resource deseng prodeng mktan money / period=per
                                            obstype=otype
                                            delayanalysis
                                            actdelay=actdel
                                            infeasdiagnostic;
      baseline / set=early compare=resource;
      id task;
      run;

Output 2.18.4: Resource-Constrained Schedule: Activity Delay = - (T_FLOAT)

Variable Activity Delay
Resource Constrained Schedule
Activity Delay = - (T_FLOAT)

Obs tail head days task actdel deseng prodeng mktan money S_START S_FINISH E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R B_START B_FINISH S_VAR F_VAR
1 1 2 5 Approve Plan 0 1 1 1 200 02DEC91 06DEC91 02DEC91 06DEC91 02DEC91 06DEC91 0   mktan 02DEC91 06DEC91 0 0
2 2 3 10 Drawings 0 1 1 . 100 09DEC91 20DEC91 09DEC91 20DEC91 09DEC91 20DEC91 0   money 09DEC91 20DEC91 0 0
3 2 4 5 Anal. Market -30 . 1 1 100 09DEC91 13DEC91 09DEC91 13DEC91 22JAN92 28JAN92 0   prodeng 09DEC91 13DEC91 0 0
4 2 3 5 Write Specs -5 1 1 . 150 09DEC91 13DEC91 09DEC91 13DEC91 16DEC91 20DEC91 0   deseng 09DEC91 13DEC91 0 0
5 3 5 15 Prototype 0 1 1 . 300 23DEC91 14JAN92 23DEC91 14JAN92 23DEC91 14JAN92 0   money 23DEC91 14JAN92 0 0
6 4 6 10 Mkt. Strat. -30 . . 1 150 16DEC91 30DEC91 16DEC91 30DEC91 29JAN92 11FEB92 0   mktan 16DEC91 30DEC91 0 0
7 5 7 10 Materials 0 . . . 300 15JAN92 28JAN92 15JAN92 28JAN92 15JAN92 28JAN92 0   money 15JAN92 28JAN92 0 0
8 5 7 10 Facility 0 . 1 . 500 15JAN92 28JAN92 15JAN92 28JAN92 15JAN92 28JAN92 0   money 15JAN92 28JAN92 0 0
9 7 8 10 Init. Prod. 0 . . . 250 29JAN92 11FEB92 29JAN92 11FEB92 29JAN92 11FEB92 0   money 29JAN92 11FEB92 0 0
10 8 9 10 Evaluate -5 1 . . 150 12FEB92 25FEB92 12FEB92 25FEB92 19FEB92 03MAR92 0   money 12FEB92 25FEB92 0 0
11 6 9 15 Test Market 0 . . 1 200 12FEB92 03MAR92 12FEB92 03MAR92 12FEB92 03MAR92 0   mktan 12FEB92 03MAR92 0 0
12 9 10 5 Changes 0 1 1 . 200 04MAR92 10MAR92 04MAR92 10MAR92 04MAR92 10MAR92 0   money 04MAR92 10MAR92 0 0
13 10 11 0 Production 0 1 1 . 600 11MAR92 11MAR92 11MAR92 11MAR92 11MAR92 11MAR92 0     11MAR92 11MAR92 0 0
14 6 12 0 Marketing -20 . . 1 . 12FEB92 12FEB92 12FEB92 12FEB92 11MAR92 11MAR92 0     12FEB92 12FEB92 0 0
15 8 6 0 Dummy 0 . . . . 12FEB92 12FEB92 12FEB92 12FEB92 12FEB92 12FEB92 0     12FEB92 12FEB92 0 0

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.