public class Disjunctive extends AbstractConstraint
Constructor and Description |
---|
Disjunctive(IntVar[] start,
int[] duration)
Creates a disjunctive constraint that enforces
that for any two pair i,j of activities we have
start[i]+duration[i] <= start[j] or start[j]+duration[j] <= start[i] . |
Modifier and Type | Method and Description |
---|---|
void |
post()
Initializes the constraint when it is posted to the solver.
|
void |
propagate()
Propagates the constraint.
|
getSolver, isActive, isScheduled, setActive, setScheduled
public Disjunctive(IntVar[] start, int[] duration)
start[i]+duration[i] <= start[j] or start[j]+duration[j] <= start[i]
.start
- the start times of the activitiesduration
- the durations of the activitiespublic void post()
Constraint
post
in interface Constraint
post
in class AbstractConstraint
public void propagate()
Constraint
propagate
in interface Constraint
propagate
in class AbstractConstraint
Copyright © 2018 Laurent Michel, Pierre Schaus, Pascal Van Hentenryck. All rights reserved.