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
Approve Plan |
5 |
1 |
2 |
1 |
1 |
1 |
200 |
0 |
Drawings |
10 |
2 |
3 |
1 |
. |
1 |
100 |
0 |
Anal. Market |
5 |
2 |
4 |
. |
1 |
1 |
100 |
0 |
Write Specs |
5 |
2 |
3 |
1 |
. |
1 |
150 |
0 |
Prototype |
15 |
3 |
5 |
1 |
. |
1 |
300 |
0 |
Mkt. Strat. |
10 |
4 |
6 |
. |
1 |
. |
150 |
5 |
Materials |
10 |
5 |
7 |
. |
. |
. |
300 |
5 |
Facility |
10 |
5 |
7 |
. |
. |
1 |
500 |
0 |
Init. Prod. |
10 |
7 |
8 |
. |
. |
. |
250 |
5 |
Evaluate |
10 |
8 |
9 |
1 |
. |
. |
150 |
5 |
Test Market |
15 |
6 |
9 |
. |
1 |
. |
200 |
5 |
Changes |
5 |
9 |
10 |
1 |
. |
1 |
200 |
0 |
Production |
0 |
10 |
11 |
1 |
. |
1 |
600 |
0 |
Marketing |
0 |
6 |
12 |
. |
1 |
. |
. |
5 |
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 $
deseng mktan prodeng money;
format per date7.;
datalines;
. restype 1 1 1 4
01dec03 reslevel 1 . 1 .
;
data holdata;
format hol date7. name $9. ;
input hol & date7. name & ;
datalines;
25dec03 Christmas
01jan04 New Year
;
proc cpm date='01dec03'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
1 |
2 |
5 |
Approve Plan |
0 |
1 |
1 |
1 |
200 |
01DEC03 |
05DEC03 |
01DEC03 |
05DEC03 |
01DEC03 |
05DEC03 |
0 |
0 |
|
mktan |
2 |
3 |
10 |
Drawings |
0 |
1 |
1 |
. |
100 |
08DEC03 |
19DEC03 |
08DEC03 |
19DEC03 |
08DEC03 |
19DEC03 |
0 |
0 |
|
|
2 |
4 |
5 |
Anal. Market |
0 |
. |
1 |
1 |
100 |
14JAN04 |
20JAN04 |
08DEC03 |
12DEC03 |
21JAN04 |
27JAN04 |
30 |
25 |
prodeng |
prodeng |
2 |
3 |
5 |
Write Specs |
0 |
1 |
1 |
. |
150 |
08DEC03 |
12DEC03 |
08DEC03 |
12DEC03 |
15DEC03 |
19DEC03 |
5 |
0 |
|
deseng |
3 |
5 |
15 |
Prototype |
0 |
1 |
1 |
. |
300 |
22DEC03 |
13JAN04 |
22DEC03 |
13JAN04 |
22DEC03 |
13JAN04 |
0 |
0 |
|
|
4 |
6 |
10 |
Mkt. Strat. |
5 |
. |
. |
1 |
150 |
21JAN04 |
03FEB04 |
15DEC03 |
29DEC03 |
28JAN04 |
10FEB04 |
30 |
0 |
|
mktan |
5 |
7 |
10 |
Materials |
5 |
. |
. |
. |
300 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
0 |
0 |
|
|
5 |
7 |
10 |
Facility |
0 |
. |
1 |
. |
500 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
0 |
0 |
|
|
7 |
8 |
10 |
Init. Prod. |
5 |
. |
. |
. |
250 |
28JAN04 |
10FEB04 |
28JAN04 |
10FEB04 |
28JAN04 |
10FEB04 |
0 |
0 |
|
|
8 |
9 |
10 |
Evaluate |
5 |
1 |
. |
. |
150 |
11FEB04 |
24FEB04 |
11FEB04 |
24FEB04 |
18FEB04 |
02MAR04 |
5 |
0 |
|
|
6 |
9 |
15 |
Test Market |
5 |
. |
. |
1 |
200 |
11FEB04 |
02MAR04 |
11FEB04 |
02MAR04 |
11FEB04 |
02MAR04 |
0 |
0 |
|
mktan |
9 |
10 |
5 |
Changes |
0 |
1 |
1 |
. |
200 |
03MAR04 |
09MAR04 |
03MAR04 |
09MAR04 |
03MAR04 |
09MAR04 |
0 |
0 |
|
|
10 |
11 |
0 |
Production |
0 |
1 |
1 |
. |
600 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
0 |
0 |
|
|
6 |
12 |
0 |
Marketing |
5 |
. |
. |
1 |
. |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
10MAR04 |
10MAR04 |
20 |
0 |
|
|
8 |
6 |
0 |
Dummy |
5 |
. |
. |
. |
. |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
0 |
0 |
|
|
|
Output 2.18.3: Resource Usage
01DEC03 |
1 |
0 |
1 |
0 |
1 |
-1 |
0 |
. |
02DEC03 |
1 |
0 |
1 |
0 |
1 |
-1 |
200 |
. |
03DEC03 |
1 |
0 |
1 |
0 |
1 |
-1 |
400 |
. |
04DEC03 |
1 |
0 |
1 |
0 |
1 |
-1 |
600 |
. |
05DEC03 |
1 |
0 |
1 |
0 |
1 |
-1 |
800 |
. |
08DEC03 |
2 |
-1 |
2 |
-1 |
0 |
0 |
1000 |
. |
09DEC03 |
2 |
-1 |
2 |
-1 |
0 |
0 |
1250 |
. |
10DEC03 |
2 |
-1 |
2 |
-1 |
0 |
0 |
1500 |
. |
11DEC03 |
2 |
-1 |
2 |
-1 |
0 |
0 |
1750 |
. |
12DEC03 |
2 |
-1 |
2 |
-1 |
0 |
0 |
2000 |
. |
15DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2250 |
. |
16DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2350 |
. |
17DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2450 |
. |
18DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2550 |
. |
19DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2650 |
. |
22DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
2750 |
. |
23DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
3050 |
. |
24DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
3350 |
. |
26DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
3650 |
. |
29DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
3950 |
. |
30DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
4250 |
. |
31DEC03 |
1 |
0 |
1 |
0 |
0 |
0 |
4550 |
. |
02JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
4850 |
. |
05JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
5150 |
. |
06JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
5450 |
. |
07JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
5750 |
. |
08JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
6050 |
. |
09JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
6350 |
. |
12JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
6650 |
. |
13JAN04 |
1 |
0 |
1 |
0 |
0 |
0 |
6950 |
. |
14JAN04 |
0 |
1 |
2 |
-1 |
1 |
-1 |
7250 |
. |
15JAN04 |
0 |
1 |
2 |
-1 |
1 |
-1 |
8150 |
. |
16JAN04 |
0 |
1 |
2 |
-1 |
1 |
-1 |
9050 |
. |
19JAN04 |
0 |
1 |
2 |
-1 |
1 |
-1 |
9950 |
. |
20JAN04 |
0 |
1 |
2 |
-1 |
1 |
-1 |
10850 |
. |
21JAN04 |
0 |
1 |
1 |
0 |
1 |
-1 |
11750 |
. |
22JAN04 |
0 |
1 |
1 |
0 |
1 |
-1 |
12700 |
. |
23JAN04 |
0 |
1 |
1 |
0 |
1 |
-1 |
13650 |
. |
26JAN04 |
0 |
1 |
1 |
0 |
1 |
-1 |
14600 |
. |
27JAN04 |
0 |
1 |
1 |
0 |
1 |
-1 |
15550 |
. |
28JAN04 |
0 |
1 |
0 |
1 |
1 |
-1 |
16500 |
. |
29JAN04 |
0 |
1 |
0 |
1 |
1 |
-1 |
16900 |
. |
30JAN04 |
0 |
1 |
0 |
1 |
1 |
-1 |
17300 |
. |
02FEB04 |
0 |
1 |
0 |
1 |
1 |
-1 |
17700 |
. |
03FEB04 |
0 |
1 |
0 |
1 |
1 |
-1 |
18100 |
. |
04FEB04 |
0 |
1 |
0 |
1 |
0 |
0 |
18500 |
. |
05FEB04 |
0 |
1 |
0 |
1 |
0 |
0 |
18750 |
. |
06FEB04 |
0 |
1 |
0 |
1 |
0 |
0 |
19000 |
. |
09FEB04 |
0 |
1 |
0 |
1 |
0 |
0 |
19250 |
. |
10FEB04 |
0 |
1 |
0 |
1 |
0 |
0 |
19500 |
. |
11FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
19750 |
. |
12FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
20100 |
. |
13FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
20450 |
. |
16FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
20800 |
. |
17FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
21150 |
. |
18FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
21500 |
. |
19FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
21850 |
. |
20FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
22200 |
. |
23FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
22550 |
. |
24FEB04 |
1 |
0 |
0 |
1 |
1 |
-1 |
22900 |
. |
25FEB04 |
0 |
1 |
0 |
1 |
1 |
-1 |
23250 |
. |
26FEB04 |
0 |
1 |
0 |
1 |
1 |
-1 |
23450 |
. |
27FEB04 |
0 |
1 |
0 |
1 |
1 |
-1 |
23650 |
. |
01MAR04 |
0 |
1 |
0 |
1 |
1 |
-1 |
23850 |
. |
02MAR04 |
0 |
1 |
0 |
1 |
1 |
-1 |
24050 |
. |
03MAR04 |
1 |
0 |
1 |
0 |
0 |
0 |
24250 |
. |
04MAR04 |
1 |
0 |
1 |
0 |
0 |
0 |
24450 |
. |
05MAR04 |
1 |
0 |
1 |
0 |
0 |
0 |
24650 |
. |
08MAR04 |
1 |
0 |
1 |
0 |
0 |
0 |
24850 |
. |
09MAR04 |
1 |
0 |
1 |
0 |
0 |
0 |
25050 |
. |
10MAR04 |
0 |
1 |
0 |
1 |
0 |
0 |
25250 |
. |
|
Note from the Schedule data set that the activity
'Anal. Market' is
scheduled to start on January 14, 2004, even though
(
L_START adelay)=21JAN04. 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 14JAN03. 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 14th and 20th 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
8th of December. The RESOURCEOUT data set indicates that an
extra design engineer and an extra production engineer are needed
from the 8th to the 12th 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. 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.
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='01dec03'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)
1 |
2 |
5 |
Approve Plan |
0 |
1 |
1 |
1 |
200 |
01DEC03 |
05DEC03 |
01DEC03 |
05DEC03 |
01DEC03 |
05DEC03 |
0 |
|
mktan |
01DEC03 |
05DEC03 |
0 |
0 |
2 |
3 |
10 |
Drawings |
0 |
1 |
1 |
. |
100 |
08DEC03 |
19DEC03 |
08DEC03 |
19DEC03 |
08DEC03 |
19DEC03 |
0 |
|
|
08DEC03 |
19DEC03 |
0 |
0 |
2 |
4 |
5 |
Anal. Market |
-30 |
. |
1 |
1 |
100 |
08DEC03 |
12DEC03 |
08DEC03 |
12DEC03 |
21JAN04 |
27JAN04 |
0 |
|
prodeng |
08DEC03 |
12DEC03 |
0 |
0 |
2 |
3 |
5 |
Write Specs |
-5 |
1 |
1 |
. |
150 |
08DEC03 |
12DEC03 |
08DEC03 |
12DEC03 |
15DEC03 |
19DEC03 |
0 |
|
deseng |
08DEC03 |
12DEC03 |
0 |
0 |
3 |
5 |
15 |
Prototype |
0 |
1 |
1 |
. |
300 |
22DEC03 |
13JAN04 |
22DEC03 |
13JAN04 |
22DEC03 |
13JAN04 |
0 |
|
|
22DEC03 |
13JAN04 |
0 |
0 |
4 |
6 |
10 |
Mkt. Strat. |
-30 |
. |
. |
1 |
150 |
15DEC03 |
29DEC03 |
15DEC03 |
29DEC03 |
28JAN04 |
10FEB04 |
0 |
|
mktan |
15DEC03 |
29DEC03 |
0 |
0 |
5 |
7 |
10 |
Materials |
0 |
. |
. |
. |
300 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
0 |
|
|
14JAN04 |
27JAN04 |
0 |
0 |
5 |
7 |
10 |
Facility |
0 |
. |
1 |
. |
500 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
14JAN04 |
27JAN04 |
0 |
|
|
14JAN04 |
27JAN04 |
0 |
0 |
7 |
8 |
10 |
Init. Prod. |
0 |
. |
. |
. |
250 |
28JAN04 |
10FEB04 |
28JAN04 |
10FEB04 |
28JAN04 |
10FEB04 |
0 |
|
|
28JAN04 |
10FEB04 |
0 |
0 |
8 |
9 |
10 |
Evaluate |
-5 |
1 |
. |
. |
150 |
11FEB04 |
24FEB04 |
11FEB04 |
24FEB04 |
18FEB04 |
02MAR04 |
0 |
|
|
11FEB04 |
24FEB04 |
0 |
0 |
6 |
9 |
15 |
Test Market |
0 |
. |
. |
1 |
200 |
11FEB04 |
02MAR04 |
11FEB04 |
02MAR04 |
11FEB04 |
02MAR04 |
0 |
|
mktan |
11FEB04 |
02MAR04 |
0 |
0 |
9 |
10 |
5 |
Changes |
0 |
1 |
1 |
. |
200 |
03MAR04 |
09MAR04 |
03MAR04 |
09MAR04 |
03MAR04 |
09MAR04 |
0 |
|
|
03MAR04 |
09MAR04 |
0 |
0 |
10 |
11 |
0 |
Production |
0 |
1 |
1 |
. |
600 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
10MAR04 |
0 |
|
|
10MAR04 |
10MAR04 |
0 |
0 |
6 |
12 |
0 |
Marketing |
-20 |
. |
. |
1 |
. |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
10MAR04 |
10MAR04 |
0 |
|
|
11FEB04 |
11FEB04 |
0 |
0 |
8 |
6 |
0 |
Dummy |
0 |
. |
. |
. |
. |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
11FEB04 |
0 |
|
|
11FEB04 |
11FEB04 |
0 |
0 |
|