Package org.jacop.constraints.cumulative
Class CumulativeUnary
- java.lang.Object
-
- org.jacop.constraints.DecomposedConstraint<Constraint>
-
- org.jacop.constraints.Constraint
-
- org.jacop.constraints.cumulative.CumulativeBasic
-
- org.jacop.constraints.cumulative.Cumulative
-
- org.jacop.constraints.cumulative.CumulativeUnary
-
public class CumulativeUnary extends Cumulative
CumulativeUnary implements the scheduling constraint for unary resources usingoverload, not-first-not-last and detectable algorithms based on
Petr Vilim, "O(n log n) Filtering Algorithms for Unary Resource Constraints", Proceedings of CP-AI-OR 2004,
- Version:
- 4.8
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
doProfile
private java.util.Comparator<TaskView>
taskIncEctComparator
private java.util.Comparator<TaskView>
taskIncLctComparator
private java.util.Comparator<TaskView>
taskIncLstComparator
private TaskView[]
tvn
Local copies of tasks in normal and reserved viewsprivate TaskView[]
tvr
-
Fields inherited from class org.jacop.constraints.cumulative.Cumulative
taskDecLctComparator, taskIncEstComparator, taskReversed
-
Fields inherited from class org.jacop.constraints.cumulative.CumulativeBasic
cumulativeForConstants, limit, possibleZeroTasks, taskNormal
-
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 CumulativeUnary(java.util.List<? extends IntVar> starts, java.util.List<? extends IntVar> durations, java.util.List<? extends IntVar> resources, IntVar limit)
It creates a cumulative constraint.CumulativeUnary(java.util.List<? extends IntVar> starts, java.util.List<? extends IntVar> durations, java.util.List<? extends IntVar> resources, IntVar limit, boolean doProfile)
It creates a cumulative constraint.CumulativeUnary(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit)
It creates a cumulative constraint.CumulativeUnary(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, boolean doProfile)
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.private void
detectable(Store store, TaskView[] tn, TaskView[] tr)
private void
detectable(Store store, ThetaTree tree, TaskView[] t, TaskView[] q, TaskView[] to)
private void
detectablePhase(Store store, TaskView[] tc)
private void
edgeFind(Store store, TaskView[] tn, TaskView[] tr)
private void
edgeFindPhase(Store store, TaskView[] tc)
private void
notFirstNotLast(Store store, TaskView[] tn, TaskView[] tr)
private void
notFirstNotLastPhase(Store store, TaskView[] tc)
private void
notLast(Store store, ThetaTree tree, TaskView[] t, TaskView[] q, TaskView[] tc)
private void
overload(TaskView[] ts)
java.lang.String
toString()
It produces a string representation of a constraint state.-
Methods inherited from class org.jacop.constraints.cumulative.Cumulative
doQuadraticEdgeFind, filterZeroTasks, getDefaultConsistencyPruningEvent
-
Methods inherited from class org.jacop.constraints.cumulative.CumulativeBasic
profileProp
-
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
-
doProfile
private boolean doProfile
-
tvn
private final TaskView[] tvn
Local copies of tasks in normal and reserved views
-
tvr
private final TaskView[] tvr
-
taskIncLctComparator
private java.util.Comparator<TaskView> taskIncLctComparator
-
taskIncLstComparator
private java.util.Comparator<TaskView> taskIncLstComparator
-
taskIncEctComparator
private java.util.Comparator<TaskView> taskIncEctComparator
-
-
Constructor Detail
-
CumulativeUnary
public CumulativeUnary(IntVar[] starts, IntVar[] durations, 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.
-
CumulativeUnary
public CumulativeUnary(IntVar[] starts, IntVar[] durations, IntVar[] resources, IntVar limit, 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.doProfile
- defines whether to do profile-based propagation (true) or not (false); default is false
-
CumulativeUnary
public CumulativeUnary(java.util.List<? extends IntVar> starts, java.util.List<? extends IntVar> durations, java.util.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.
-
CumulativeUnary
public CumulativeUnary(java.util.List<? extends IntVar> starts, java.util.List<? extends IntVar> durations, java.util.List<? extends IntVar> resources, IntVar limit, 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.doProfile
- defines whether to do profile-based propagation (true) or not (false); default is false
-
-
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.- Overrides:
consistency
in classCumulative
- Parameters:
store
- constraint store within which the constraint consistency is being checked.
-
overload
private void overload(TaskView[] ts)
-
notLast
private void notLast(Store store, ThetaTree tree, TaskView[] t, TaskView[] q, TaskView[] tc)
-
detectable
private void detectable(Store store, ThetaTree tree, TaskView[] t, TaskView[] q, TaskView[] to)
-
toString
public java.lang.String toString()
Description copied from class:Constraint
It produces a string representation of a constraint state.- Overrides:
toString
in classCumulative
-
-