Resources

Negative Resource Requirements (cpme29)

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPME29                                              */
 /*   TITLE: Negative Resource Requirements (cpme29)             */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Example 29 from the CPM Chapter (PM User's Guide)   */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

/* Create boxed cards and ship them */
data OneOrder;
   input Activity $ 1-12 succ $ 14-25 Duration
         Mach1 numboxes trucks;
   datalines;
First Order  .           6  1  -5000  .
Sched truck1 Delivery 1  0  .  10000  .
Sched truck2 Delivery 2  0  .  10000  .
Sched truck3 Delivery 3  0  .  10000  .
Delivery 1   .           2  .  .      1
Delivery 2   .           2  .  .      1
Delivery 3   .           2  .  .      1
;

data OneMachine;
   input per date7. obstype $ Mach1 numboxes trucks;
   format per date7.;
   datalines;
.        restype  1  2  1
15aug04  reslevel 1  .  1
;


title 'Negative Resource Requirements';
title2 'Activity Data Set OneOrder';
proc print data=OneOrder;
   run;

title2 'Resource Data Set OneMachine';
proc print data=OneMachine;
   run;


proc cpm data=OneOrder resin=OneMachine
     out=OneSched rsched=OneRsch resout=OneRout
     date='15aug04'd;
   act      activity;
   succ     succ;
   duration duration;
   resource Mach1 numboxes trucks / period=per
                                    obstype=obstype
                                    milestoneresource;
   run;

proc sort data=OneSched;
   by s_start;
   run;


pattern1 c=green v=s;     /* duration of a non-critical activity   */
pattern2 c=green v=e;     /* slack time for a noncrit. activity    */
pattern3 c=red   v=s;     /* duration of a critical activity       */
pattern4 c=magenta v=e;   /* slack time for a supercrit. activity  */
pattern5 c=magenta v=s;   /* duration of a supercrit. activity     */
pattern6 c=cyan v=s;      /* actual duration of an activity        */
pattern7 c=black v=e;     /* break due to a holiday                */
pattern8 c=blue v=s;      /* resource schedule of activity         */
pattern9 c=brown v=s;     /* baseline schedule of activity         */


title  h=2 'Negative Resource Requirements';
title2 h=1.5   'Truck Schedule';
proc gantt data=OneSched (drop=e_: l_:) ;
   chart / act=activity succ=succ duration=duration
           cmile=red
           cprec=blue height=1.8
           nolegend nojobnum;
   id activity duration;
   run;


title2 'Resource Usage Data Set';
proc print data=OneRout;
   id _time_;
   run;