change_constraint_hardness

Set the constraint hardness for all activities.

The four constraint hardness modes are as follows:
  • Hard constraint mode: All activity constraints as well as precedence relations between activities need to be respected at all times.
  • Moderate constraint mode: All activity constraints need to be respected at all times. Precedence relations might be violated.
  • Soft constraint mode: All precedence relations between activities need to be satisfied at all times. Activity constraints are satisfied as good as possible. A weight can be given to each activity constraint to prioritize these violations using the change_activity_constraint_weight function.
  • Forward constraint mode: All precedence relations between activities need to be satisfied at all times. Activity constraints are treated as forward constraints, i.e. ready times will always be respected, locked times will be treated as ready times and due dates will possibly be violated in case of constraint conflicts.
The function starts with the current start times of the activities. Switching to the hard constraints can be successful or not. A third option is that the hard constraint cannot be set, but returning to an earliest start schedule (ESS) would lead to a successful constraint change.
 
Parameters: 
I/O Type Name Description
input integer hardness 0 (forward), 1 (soft), 2 (moderate) or 3 (hard)
output integer success 0 (failed (hard)), 1 (success) or -1 (failed (hard only), but ESS would be successful)
Learn More: 

Step inside PMKC.

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