Package org.jacop.constraints.cumulative
Class CumulativePrimary
- java.lang.Object
-
- org.jacop.constraints.DecomposedConstraint<Constraint>
-
- org.jacop.constraints.Constraint
-
- org.jacop.constraints.cumulative.CumulativePrimary
-
class CumulativePrimary extends Constraint
CumulativePrimary implements the cumulative constraint using time tabling algorithm.- Version:
- 4.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CumulativePrimary.Event
-
Field Summary
Fields Modifier and Type Field Description private int[]
activeMap
private TimeStamp<java.lang.Integer>
activePnt
private static boolean
debug
private static boolean
debugNarr
private int[]
dur
All durations and resources of the constraintprivate java.util.Comparator<CumulativePrimary.Event>
eventComparator
private static java.util.concurrent.atomic.AtomicInteger
idNumber
IntVar
limit
It specifies the limit of the profile of cumulative use of resources.private static int
profile
private static int
pruneEnd
private static int
pruneStart
private int[]
res
private IntVar[]
start
start times of tasks-
Fields 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
Constructors Constructor Description CumulativePrimary(java.util.List<? extends IntVar> starts, java.util.List<? extends java.lang.Integer> durations, java.util.List<? extends java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the values from variables domains.int
getDefaultConsistencyPruningEvent()
private void
removeNotUsedProfleTasks()
private void
swap(int i, int j)
(package private) void
sweepPruning(Store store)
java.lang.String
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 Detail
-
idNumber
private static java.util.concurrent.atomic.AtomicInteger idNumber
-
debug
private static final boolean debug
- See Also:
- Constant Field Values
-
debugNarr
private static final boolean debugNarr
- See Also:
- Constant Field Values
-
eventComparator
private java.util.Comparator<CumulativePrimary.Event> eventComparator
-
start
private final IntVar[] start
start times of tasks
-
dur
private final int[] dur
All durations and resources of the constraint
-
res
private final int[] res
-
activeMap
private int[] activeMap
-
activePnt
private TimeStamp<java.lang.Integer> activePnt
-
limit
public final IntVar limit
It specifies the limit of the profile of cumulative use of resources.
-
profile
private static final int profile
- See Also:
- Constant Field Values
-
pruneStart
private static final int pruneStart
- See Also:
- Constant Field Values
-
pruneEnd
private static final int pruneEnd
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CumulativePrimary
public CumulativePrimary(IntVar[] starts, int[] durations, int[] 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.
-
CumulativePrimary
public CumulativePrimary(java.util.List<? extends IntVar> starts, java.util.List<? extends java.lang.Integer> durations, java.util.List<? extends java.lang.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 Detail
-
consistency
public void consistency(Store store)
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
public java.lang.String toString()
Description copied from class:Constraint
It produces a string representation of a constraint state.- Overrides:
toString
in classConstraint
-
sweepPruning
void sweepPruning(Store store)
-
removeNotUsedProfleTasks
private void removeNotUsedProfleTasks()
-
swap
private void swap(int i, int j)
-
-