add_relation

Add a relation between two activities and reschedule the project. 

A precedence relation between two activities ID1 and ID2 is characterized by:

  • Lag type: the type of the relation can be one of the following types
    • Start-Start (SS) relation: activity ID2 can only start after the start of activity ID1
    • Start-Finish (SF) relation: activity ID2 can only finish after the start of activity ID1
    • Finish-Start (FS) relation: activity ID2 can only start after the finish of activity ID1
    • Finish-Finish (FF) relation: activity ID2 can only finish after the finish of activity ID1
  • Lag value: the time-lag between two activities can be positive, zero or negative.

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 ID1 ID of the first activity
input integer ID2 ID of the second activity
input integer lagtype 1 (SS), 2 (SF), 3 (FS), 4 (FF) or -127 (no relation)
input integer lagvalue lag value, < 0, 0 or > 0
output integer success 0 (failure) or 1 (successful)
Learn More: 

Step inside PMKC.

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