change_constraint_value

Change activity constraint and reschedule the project. 

Activity constraints can be imposed when there is a need to control the start or finish of an activity, as follows:

  • Constraint type (ctype):
    • Schedule direction: Although this is not a real activity constraint, the schedule direction of the activity can be set to as-soon-as-possible (ASAP) or as-late-as-possible (ALAP).
    • Activity constraints can be set to limit the scheduling degrees of freedom and restrict them to certain time windows, as follows:
      • Ready dates imply earliest start or finish times on activities and hence force the activity to start/finish no earlier than the defined time instance.
      • Due dates imply latest start/finish times on activities and force activities to start/finish no later than a predefined time instance.
      • Locked dates imply a fixed time instance and force the activity to start/finish on a predefined time instance.
  • Constraint start/finish (csf): The ready times, due dates and locked times can be set to start or finish constraints.

Remark: Only of of the three activity constraints can be set at the same time. Changing a constraint automatically removes the previously set constraint. The existence of an activity constraint can be checked using the P2Schedule:get_readytime, P2Schedule:get_duedate and P2Schedule:get_lockedtime functions. The schedule direction can be obtained by calling the P2Schedule:get_asap_alap function.

Rescheduling the project can lead to conflicts due to activity constraints. This function returns 0/1 if the reschedule was a failure/successful. The rescheduling function can be put off by the P2Schedule:put_batch_calculator_on function.

Parameters: 
I/O Type Name Description
input integer ID activity ID
input integer ctype 1 (schedule direction),

2 (ready time), 3 (due date) or 4 (locked time)

input integer csf 0 (start) or 1 (finish) (only for ctype = 2, 3 or 4)
input integer newValue 0 (ASAP) or 1 (ALAP)

time point (for ctype = 2, 3 or 4)

output integer success 0 (failure) or 1 (successful)

 

Learn More: 

Step inside PMKC.

Example: 
function ()
        io.write('\n')
end
Class: 
P2Schedule