Package org.jacop.constraints.cumulative
Class CumulativePrimary
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.cumulative.CumulativePrimary
CumulativePrimary implements the cumulative constraint using time tabling
algorithm.
- Version:
- 4.8
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
private static final boolean
private static final boolean
private final int[]
All durations and resources of the constraintprivate Comparator<CumulativePrimary.Event>
private static AtomicInteger
final IntVar
It specifies the limit of the profile of cumulative use of resources.private static final int
private static final int
private static final int
private final int[]
private final IntVar[]
start times of tasksFields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
ConstructorsConstructorDescriptionCumulativePrimary
(List<? extends IntVar> starts, List<? extends Integer> durations, List<? extends Integer> resources, IntVar limit) It creates a cumulative constraint.CumulativePrimary
(IntVar[] starts, int[] durations, int[] resources, IntVar limit) It creates a cumulative constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoid
consistency
(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.int
private void
private void
swap
(int i, int j) (package private) void
sweepPruning
(Store store) toString()
It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, impose, imposeDecomposition, increaseWeight, intArrayToString, numberArgs, queueVariable, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGrounded
Methods 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:
-
eventComparator
-
start
start times of tasks -
dur
private final int[] durAll durations and resources of the constraint -
res
private final int[] res -
activeMap
private int[] activeMap -
activePnt
-
limit
It specifies the limit of the profile of cumulative use of resources. -
profile
private static final int profile- See Also:
-
pruneStart
private static final int pruneStart- See Also:
-
pruneEnd
private static final int pruneEnd- See Also:
-
-
Constructor Details
-
CumulativePrimary
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.
-
CumulativePrimary
public CumulativePrimary(List<? extends IntVar> starts, List<? extends Integer> durations, List<? extends Integer> 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.
-
-
Method Details
-
consistency
Description copied from class:Constraint
It 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:
consistency
in classConstraint
- Parameters:
store
- constraint store within which the constraint consistency is being checked.
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEvent
in classConstraint
-
toString
Description copied from class:Constraint
It produces a string representation of a constraint state.- Overrides:
toString
in classConstraint
-
sweepPruning
-
removeNotUsedProfleTasks
private void removeNotUsedProfleTasks() -
swap
private void swap(int i, int j)
-