Package com.artelys.kalis
Class KCumulativeResourceConstraint
- java.lang.Object
-
- com.artelys.kalis.KConstraint
-
- com.artelys.kalis.KCumulativeResourceConstraint
-
public class KCumulativeResourceConstraint extends KConstraint
This constraint states that some tasks requiring a resource do not exceed the
resource capacity. The primary use of this constraint is to express resource
constraints.
Resources (machines, raw material etc) can be of two different types:
- Disjunctive when the resource can process only one task at a time (represented by the class KUnaryResource).
- Cumulative when the resource can process several tasks at the same time (represented by the class KDiscreteResource).
Traditional examples of disjunctive resources are Jobshop problems,
cumulative resources are heavily used for the Resource-Constrained Project
Scheduling Problem (RCPSP). Note that a disjunctive resource is semantically
equivalent to a cumulative resource with maximal capacity one and unit
resource usage for each task using this resource but this equivalence does
not hold in terms of constraint propagation. The size of a task is its duration by its
usage: use_i * dur_i = size_i.
The following schema shows an example with three tasks A,B and C executing on
a disjunctive resource and on a cumulative resource with resource usage 3 for
task A, 1 for task B and 1 for task C :
- Since:
- 2016.1
-
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KCumulativeResourceConstraint(long cPtr, boolean cMemoryOwn)
KCumulativeResourceConstraint(KCumulativeResourceConstraint toCopy)
Copy constructorKCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntArray prodsidx, KIntVarArray prods, KIntVarArray sizesp, KIntArray consosidx, KIntVarArray consos, KIntVarArray sizesc, int C)
Constructor
KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntArray prodsidx, KIntVarArray prods, KIntVarArray sizesp, KIntArray consosidx, KIntVarArray consos, KIntVarArray sizesc, int C, int propagation)
Constructor
KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntVarArray uses, KIntVarArray sizes, int C)
Constructor
KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntVarArray uses, KIntVarArray sizes, int C, int propagation)
Constructor
KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, com.artelys.kalis.SWIGTYPE_p_KResource_I r)
Constructor for internal use onlyKCumulativeResourceConstraint(KProblem p, KIntVarArray starts, com.artelys.kalis.SWIGTYPE_p_KResource_I r, int propagation)
Constructor for internal use only
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTask(com.artelys.kalis.SWIGTYPE_p_KTask_I task)
void
delete()
protected void
finalize()
protected static long
getCPtr(KCumulativeResourceConstraint obj)
-
Methods inherited from class com.artelys.kalis.KConstraint
askIfEntailed, getArity, getCopyPtr, getCPtr, getInstance, getInstanceCopyPtr, getLinearRelaxation, getLinearRelaxation, getName, getPriority, getProblem, getTag, getTypeInfo, isGetLinearRelaxationImplemented, print, print, setName, setPriority, setTag
-
-
-
-
Constructor Detail
-
KCumulativeResourceConstraint
protected KCumulativeResourceConstraint(long cPtr, boolean cMemoryOwn)
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, com.artelys.kalis.SWIGTYPE_p_KResource_I r, int propagation)
Constructor for internal use only
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, com.artelys.kalis.SWIGTYPE_p_KResource_I r)
Constructor for internal use only
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntVarArray uses, KIntVarArray sizes, int C, int propagation)
Constructor
- Parameters:
p
- the problemstarts
- the array of variables representing the starts of the tasksends
- the array of variables representing the ends of the tasksdurs
- the array of variables representing the durations of the tasksuses
- the array of variables representing the consumptions of the taskssizes
- the array of variables representing the sizes of the tasksC
- initial resource stock capacitypropagation
- propagation scheme @see KDiscreteResource#PropagationHint
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntVarArray uses, KIntVarArray sizes, int C)
Constructor
- Parameters:
p
- the problemstarts
- the array of variables representing the starts of the tasksends
- the array of variables representing the ends of the tasksdurs
- the array of variables representing the durations of the tasksuses
- the array of variables representing the consumptions of the taskssizes
- the array of variables representing the sizes of the tasksC
- initial resource stock capacity- See Also:
KDiscreteResource#PropagationHint
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntArray prodsidx, KIntVarArray prods, KIntVarArray sizesp, KIntArray consosidx, KIntVarArray consos, KIntVarArray sizesc, int C, int propagation)
Constructor
- Parameters:
p
- the problemstarts
- the array of variables representing the starts of the tasksends
- the array of variables representing the ends of the tasksdurs
- the array of variables representing the durations of the tasks
C
- initial resource stock capacitypropagation
- propagation scheme @see KDiscreteResource#PropagationHint
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KProblem p, KIntVarArray starts, KIntVarArray ends, KIntVarArray durs, KIntArray prodsidx, KIntVarArray prods, KIntVarArray sizesp, KIntArray consosidx, KIntVarArray consos, KIntVarArray sizesc, int C)
Constructor
- Parameters:
p
- the problemstarts
- the array of variables representing the starts of the tasksends
- the array of variables representing the ends of the tasksdurs
- the array of variables representing the durations of the tasks
C
- initial resource stock capacity- See Also:
KDiscreteResource#PropagationHint
-
KCumulativeResourceConstraint
public KCumulativeResourceConstraint(KCumulativeResourceConstraint toCopy)
Copy constructor
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KCumulativeResourceConstraint obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
addTask
public void addTask(com.artelys.kalis.SWIGTYPE_p_KTask_I task)
-
-