|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.variables.scheduling.AbstractTask
choco.kernel.solver.variables.scheduling.TaskVar<C>
public final class TaskVar<C extends AbstractSConstraint & TaskPropagator>
Field Summary | |
---|---|
protected APartiallyStoredCstrList<C> |
constraints
The list of constraints (listeners) observing the variable. |
protected IntDomainVar |
duration
|
protected IntDomainVar |
end
|
protected VarEvent<? extends Var> |
event
|
protected IntDomainVar |
start
|
Fields inherited from interface choco.kernel.solver.variables.Var |
---|
LOGGER |
Constructor Summary | |
---|---|
TaskVar(Solver solver,
int id,
String name,
IntDomainVar start,
IntDomainVar end,
IntDomainVar duration)
Initializes a new variable. |
Method Summary | |
---|---|
int |
addConstraint(SConstraint c,
int varIdx,
boolean dynamicAddition)
Adds a new constraints on the stack of constraints the addition can be dynamic (undone upon backtracking) or not. |
void |
addExtension(int extensionNumber)
Adds a new extension. |
boolean |
detectOrPostConsistencyConstraint(Solver solver)
|
IntDomainVar |
duration()
|
IntDomainVar |
end()
|
void |
eraseConstraint(SConstraint<? extends Var> c)
Removes (permanently) a constraint from the list of constraints connected to the variable. |
DisposableIterator<Couple<C>> |
getActiveConstraints(C cstrCause)
|
SConstraint |
getConstraint(int i)
Retrieve the constraint i involving the variable. |
DisposableIterator<SConstraint> |
getConstraintsIterator()
This methods should be used if one want to access the different constraints currently posted on this variable. |
PartiallyStoredVector<C> |
getConstraintVector()
Access the data structure storing constraints involving a given variable. |
int |
getECT()
Gets the Earliest Completion Time (ECT). |
int |
getEST()
Gets the Earliest Starting Time (EST). |
VarEvent<? extends Var> |
getEvent()
Returns the variable event. |
Extension |
getExtension(int extensionNumber)
Returns the queried extension |
int |
getID()
Gets the ID of the task. |
long |
getIndex()
Unique index of an object in the master object (Different from hashCode, can change from one execution to another one) |
PartiallyStoredIntVector |
getIndexVector()
Access the data structure storing indices associated to constraints involving a given variable. |
int |
getLCT()
Gets the Latest Completion Time (LCT). |
int |
getLST()
Gets the Latest Starting Time (LST). |
int |
getMaxDuration()
Gets the maximum duration. |
int |
getMinDuration()
Gets the minimum duration. |
String |
getName()
Gets the name of the task. |
int |
getNbConstraints()
Returns the number of constraints involving the variable. |
int |
getPriority()
Return the priority of this according to the related constraints (minimum over all constraints priority) |
int |
getVarIndex(int constraintIndex)
Returns the index of the variable in its constraint i. |
boolean |
hasConstantDuration()
Checks for if the duration is constant. |
boolean |
isInstantiated()
Public user API: Domains : testing whether a variable is instantiated or not. |
boolean |
isPreemptionAllowed()
Checks whether the preemption is allowed. |
boolean |
isScheduled()
Checks if the task is scheduled. |
void |
postConsistencyConstraint(Solver solver)
|
void |
postHorizonConstraint(Solver solver,
int horizon)
|
IntDomainVar |
start()
|
void |
updateCompulsoryPart(SConstraint cause)
|
void |
updateHypotheticalDomain(int idx,
SConstraint constraint,
boolean forceAwake)
Call awake on TaskVar. |
Methods inherited from class choco.kernel.solver.variables.scheduling.AbstractTask |
---|
getTimePeriodList, isInterrupted, isPartiallyScheduled, pretty, toDotty, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.IPretty |
---|
pretty |
Field Detail |
---|
protected final IntDomainVar start
protected final IntDomainVar end
protected final IntDomainVar duration
protected APartiallyStoredCstrList<C extends AbstractSConstraint & TaskPropagator> constraints
protected final VarEvent<? extends Var> event
Constructor Detail |
---|
public TaskVar(Solver solver, int id, String name, IntDomainVar start, IntDomainVar end, IntDomainVar duration)
solver
- The model this variable belongs toname
- The name of the variableMethod Detail |
---|
public final boolean isPreemptionAllowed()
ITask
isPreemptionAllowed
in interface ITask
public final int getID()
ITask
getID
in interface ITask
public final String getName()
ITask
getName
in interface ITask
getName
in interface Var
getName
in class AbstractTask
public long getIndex()
getIndex
in interface IIndex
public int getPriority()
Var
this
according to the related constraints (minimum over all constraints priority)
getPriority
in interface Var
public final IntDomainVar start()
start
in interface ITaskVariable<IntDomainVar>
public final IntDomainVar end()
end
in interface ITaskVariable<IntDomainVar>
public final IntDomainVar duration()
duration
in interface ITaskVariable<IntDomainVar>
public int getECT()
ITask
getECT
in interface ITask
getECT
in class AbstractTask
public int getEST()
ITask
getEST
in interface ITask
public int getLCT()
ITask
getLCT
in interface ITask
public int getLST()
ITask
getLST
in interface ITask
getLST
in class AbstractTask
public int getMaxDuration()
ITask
getMaxDuration
in interface ITask
public int getMinDuration()
ITask
getMinDuration
in interface ITask
public boolean hasConstantDuration()
ITask
hasConstantDuration
in interface ITask
hasConstantDuration
in class AbstractTask
public boolean isScheduled()
ITask
isScheduled
in interface ITask
isScheduled
in class AbstractTask
public VarEvent<? extends Var> getEvent()
getEvent
in interface Var
public SConstraint getConstraint(int i)
getConstraint
in interface Var
i
- the number of the required constraint
public int getNbConstraints()
getNbConstraints
in interface Var
public PartiallyStoredVector<C> getConstraintVector()
getConstraintVector
in interface Var
public PartiallyStoredIntVector getIndexVector()
getIndexVector
in interface Var
public int getVarIndex(int constraintIndex)
getVarIndex
in interface Var
constraintIndex
- the index of the constraint
(among all constraints linked to the variable)
public void eraseConstraint(SConstraint<? extends Var> c)
c
- the constraint that should be removed from the list this variable
maintains.public int addConstraint(SConstraint c, int varIdx, boolean dynamicAddition)
addConstraint
in interface Var
c
- the constraint to addvarIdx
- the variable index accrding to the added constraintdynamicAddition
- states if the addition is definitic (cut) or
subject to backtracking (standard constraint)
public DisposableIterator<SConstraint> getConstraintsIterator()
remove
method throws an
UnsupportedOperationException
.
getConstraintsIterator
in interface Var
public final DisposableIterator<Couple<C>> getActiveConstraints(C cstrCause)
public boolean isInstantiated()
Var
isInstantiated
in interface Var
public final void updateCompulsoryPart(SConstraint cause) throws ContradictionException
ContradictionException
public void updateHypotheticalDomain(int idx, SConstraint constraint, boolean forceAwake)
idx
- index of the constraint calling #awake().constraint
- forceAwake
- public Extension getExtension(int extensionNumber)
IExtensionnable
getExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumber
public void addExtension(int extensionNumber)
IExtensionnable
addExtension
in interface IExtensionnable
extensionNumber
- should use the number returned by getAbstractSConstraintExtensionNumberpublic final boolean detectOrPostConsistencyConstraint(Solver solver)
public final void postConsistencyConstraint(Solver solver)
public final void postHorizonConstraint(Solver solver, int horizon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |