Package org.jacop.constraints
Class Cumulative
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.Cumulative
- All Implemented Interfaces:
SatisfiedPresent
Cumulative implements the cumulative/4 constraint using edge-finding
algorithm and profile information on the resource use.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CumulativeProfilesprivate static final booleanprivate static final booleanprotected booleanIt specifies if the edge finding algorithm should be used.private Comparator<IntDomain> private Comparator<IntDomain> protected booleanIt specifies if the profiles should be computed to propagate onto limit variable.IntVar[]It specifies/stores duration variables for each corresponding task.(package private) static AtomicIntegerIt specifies the limit of the profile of cumulative use of resources.private ProfileIt contains information about maximal profile contributed by tasks.private ProfileIt contains information about minimal profile contributed by regions for certain occupied by tasks.IntVar[]It specifies/stores resource variable for each corresponding task.protected booleanIt specifies if the data from profiles should be used to propagate onto limit variable.IntVar[]It specifies/stores start variables for each corresponding task.private Comparator<Task> private Comparator<Task> private Task[]Fields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace, watchedVariableGroundedFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsConstructorDescriptionCumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit) It creates a cumulative constraint.Cumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit, boolean edgeFinding) It creates a cumulative constraint.Cumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit, boolean edgeFinding, boolean profile) It creates a cumulative constraint.Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit) It creates a cumulative constraint.Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean edgeFinding) It creates a cumulative constraint.Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean doEdgeFinding, boolean doProfile) It creates a cumulative constraint.Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean doEdgeFinding, boolean doProfile, boolean setLimit) It creates a cumulative constraint. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanprivate boolean(package private) booleanvoidconsistency(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.private voidedgeFindingDown(Store store) private voidedgeFindingUp(Store store) private intprivate booleanfitTasksAfter(List<Task> s, int est0) private booleanfitTasksBefore(List<Task> s, int lct0) int(package private) Task[]getTasks()private booleanintervalOverlap(int min1, int max1, int min2, int max2) private intprivate intprivate longminOverlap(Task t, int est, int lct) private voidprivate voidprivate voidprofileCheckInterval(Store store, IntVar Start, IntVar Duration, Interval i, IntVar Resources, int mustUseMin, int mustUseMax) private voidprofileCheckTasks(Store store) private voidremoveFromS_Est(List<Task> s) private voidremoveFromS_Lct(List<Task> s) booleanIt checks if the constraint is satisfied.toString()It produces a string representation of a constraint state.private voidupdateTasksRes(Store store) Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, queueVariable, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
idNumber
-
debug
private static final boolean debug- See Also:
-
debugNarr
private static final boolean debugNarr- See Also:
-
maxProfile
It contains information about maximal profile contributed by tasks. -
minProfile
It contains information about minimal profile contributed by regions for certain occupied by tasks. -
cumulativeProfiles
-
Ts
-
doEdgeFinding
protected boolean doEdgeFindingIt specifies if the edge finding algorithm should be used. -
doProfile
protected boolean doProfileIt specifies if the profiles should be computed to propagate onto limit variable. -
setLimit
protected boolean setLimitIt specifies if the data from profiles should be used to propagate onto limit variable. -
limit
It specifies the limit of the profile of cumulative use of resources. -
starts
It specifies/stores start variables for each corresponding task. -
durations
It specifies/stores duration variables for each corresponding task. -
resources
It specifies/stores resource variable for each corresponding task. -
domainMaxComparator
-
domainMinComparator
-
taskAscEctComparator
-
taskDescLstComparator
-
-
Constructor Details
-
Cumulative
public Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean doEdgeFinding, boolean doProfile) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.doEdgeFinding- true if edge finding algorithm should be used.doProfile- specifies if the profiles should be computed in order to reduce limit variable.
-
Cumulative
public Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean doEdgeFinding, boolean doProfile, boolean setLimit) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.doEdgeFinding- true if edge finding algorithm should be used.doProfile- specifies if the profiles should be computed in order to reduce limit variable.setLimit- specifies if limit variable will be prunded.
-
Cumulative
public Cumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.
-
Cumulative
public Cumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit, boolean edgeFinding) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.edgeFinding- true if edge finding algorithm should be used.
-
Cumulative
public Cumulative(List<? extends IntVar> starts, List<? extends IntVar> durations, List<? extends IntVar> resources, IntVar limit, boolean edgeFinding, boolean profile) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.edgeFinding- true if edge finding algorithm should be used.profile- specifies if the profiles should be computed in order to reduce limit variable.
-
Cumulative
It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.
-
Cumulative
public Cumulative(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean edgeFinding) It creates a cumulative constraint.- Parameters:
starts- variables denoting starts of the tasks.durations- variables denoting durations of the tasks.resources- variables denoting resource usage of the tasks.limit- the overall limit of resources which has to be used.edgeFinding- true if edge finding algorithm should be used.
-
-
Method Details
-
after
-
before
-
between
-
consistency
Description copied from class:ConstraintIt is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.- Specified by:
consistencyin classConstraint- Parameters:
store- constraint store within which the constraint consistency is being checked.
-
edgeFindingDown
-
edgeFindingUp
-
est
-
fitTasksAfter
-
fitTasksBefore
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEventin classConstraint
-
getTasks
Task[] getTasks() -
intervalOverlap
private boolean intervalOverlap(int min1, int max1, int min2, int max2) -
lct
-
maxArea
-
minOverlap
-
notFirst
-
notLast
-
profileCheckInterval
-
profileCheckTasks
-
removeFromS_Est
-
removeFromS_Lct
-
satisfied
public boolean satisfied()Description copied from interface:SatisfiedPresentIt checks if the constraint is satisfied. It can return false even if constraint is satisfied but not all variables in its scope are grounded. It needs to return true if all variables in its scope are grounded and constraint is satisfied.Implementations of this interface for constraints that are not PrimitiveConstraint may require constraint imposition and consistency check as a requirement to work correctly.
- Specified by:
satisfiedin interfaceSatisfiedPresent- Returns:
- true if constraint is possible to verify that it is satisfied.
-
toString
Description copied from class:ConstraintIt produces a string representation of a constraint state.- Overrides:
toStringin classConstraint
-
updateTasksRes
-