Originally posted by: SystemAdmin
[oussedik said:]
Hi,
The model you're mentioning house3.mod is a constraint programming scheduling example (not a MIP) that was included in OPL version 3.7 and some earlier versions. The actual version is OPL 5.5, a new constraint programming engine (CP Optimizer) is provided with it.
Regarding your question,
- The objective function is (minimize max(w inWorkers) durationWorkers[w]) as the objective is to be fair among workers and this is achieved by minimizing the maximum work duration for any worker.
- Regarding how durationWorkers[w] is instanciated, among the variables,
var int durationWorkers[Workers] in 0..totalDuration; is the variable that is used in the objective
Activity attendance[w in Workers](durationWorkers[w]); is also a variable, an activity is defined by its start time, end time and duration (duration =end time - start time), all can be variable or fixed. In this case durationWorkers is a variable and is instanciated by the constraints
forall(t in Tasks)
forall(w in Workers)
activityHasSelectedResource(task[t], s, worker[w]) => attendance[w].start <= task[t].start & attendance[w].end >= task[t].end;
durationWorkers[w] is then automatically (attendance[w].end - attendance[w].start)
Hope this helps,
Sofiane
#DecisionOptimization#OPLusingCPOptimizer