choco.kernel.solver.constraints.global.scheduling
Class AbstractTaskSConstraint
java.lang.Object
choco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
choco.kernel.solver.constraints.global.scheduling.AbstractTaskSConstraint
- All Implemented Interfaces:
- IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, TaskPropagator, Cloneable, EventListener
- Direct Known Subclasses:
- AbstractResourceSConstraint, AbstractUseResourcesSConstraint
public abstract class AbstractTaskSConstraint
- extends AbstractLargeIntSConstraint
- implements TaskPropagator
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
addExtension, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, setConstraintIndex, setExtension, setVar, toString |
Methods inherited from class choco.kernel.solver.propagation.Propagator |
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, getPriority, isActive, propagate, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
taskvars
protected final TaskVar[] taskvars
startOffset
protected final int startOffset
endOffset
protected final int endOffset
taskIntVarOffset
protected final int taskIntVarOffset
AbstractTaskSConstraint
public AbstractTaskSConstraint(TaskVar task1,
TaskVar task2,
IntDomainVar... otherVars)
- Create a task constraint.
- Parameters:
taskvars
- the tasks using the resourcesotherVars
- other integer variables of the constraint
AbstractTaskSConstraint
public AbstractTaskSConstraint(TaskVar[] taskvars,
IntDomainVar[] intvars,
IntDomainVar... otherVars)
createTaskVarArray
public static final TaskVar[] createTaskVarArray(Solver solver)
makeIntVarArray
public static final IntDomainVar[] makeIntVarArray(TaskVar[] taskvars,
IntDomainVar[] intvars,
IntDomainVar[] othervars)
getTaskIntVarOffset
protected final int getTaskIntVarOffset()
getStartIndex
protected final int getStartIndex(int tidx)
getEndIndex
protected final int getEndIndex(int tidx)
getDurationIndex
protected final int getDurationIndex(int tidx)
addListener
public void addListener(boolean dynamicAddition)
- Description copied from class:
AbstractSConstraint
- This function connects a constraint with its variables in several ways.
Note that it may only be called once the constraint
has been fully created and is being posted to a model.
Note that it should be called only once per constraint.
This can be a dynamic addition (undone upon backtracking) or not
- Overrides:
addListener
in class AbstractSConstraint<IntDomainVar>
- Parameters:
dynamicAddition
- if the addition should be dynamical
awakeOnRemovals
public void awakeOnRemovals(int idx,
DisposableIntIterator deltaDomain)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- The default implementation of propagation when a variable has been modified
consists in iterating all values that have been removed (the delta domain)
and propagate them one after another, incrementally.
- Specified by:
awakeOnRemovals
in interface IntPropagator
- Overrides:
awakeOnRemovals
in class AbstractIntSConstraint
- Throws:
ContradictionException
awakeOnRem
public void awakeOnRem(int varIdx,
int val)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- Default propagation on one value removal: propagation on domain revision.
- Specified by:
awakeOnRem
in interface IntPropagator
- Overrides:
awakeOnRem
in class AbstractIntSConstraint
- Throws:
ContradictionException
getNbTasks
public final int getNbTasks()
getTask
public final TaskVar getTask(int idx)
pretty
protected final String pretty(String name)
pretty
public String pretty()
- Description copied from interface:
IPretty
- pretty printing of the object. This String is not constant and may depend on the context.
- Specified by:
pretty
in interface IPretty
- Overrides:
pretty
in class AbstractSConstraint<IntDomainVar>
- Returns:
- a readable string representation of the object
isTaskConsistencyEnforced
public boolean isTaskConsistencyEnforced()
awakeOnHypDomMod
public void awakeOnHypDomMod(int varIdx)
throws ContradictionException
- Description copied from interface:
TaskPropagator
- Default propagation on improved hypothetical domain: propagation on domain revision.
- Specified by:
awakeOnHypDomMod
in interface TaskPropagator
- Throws:
ContradictionException
Copyright © 2012. All Rights Reserved.