Package org.jacop.constraints.netflow
Class NetworkFlow
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.netflow.NetworkFlow
- All Implemented Interfaces:
RemoveLevelLate,Stateful,UsesQueueVariable
The network flow constraint. Use the NetworkBuilder to create a network and
instantiate the network.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe cost variablebooleanDisables the queue variable function during consistencyprivate static final boolean(package private) static AtomicIntegerInstance counterfinal Map<IntVar, VarHandler> The variables and their handlersfinal PruningThe networkintThe set of queued variablesprivate static final intprivate static final boolean(package private) StatisticsFields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, traceFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNetworkFlow(List<Node> nodes, List<Arc> arcs, List<VarHandler> flowVariables, IntVar costVariable) InitializationNetworkFlow(NetworkBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsistency(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.intIt retrieves the pruning event which causes reevaluation of the constraint.intvoidIt imposes the constraint in a given store.voidqueueVariable(int level, Var variable) Search & BacktrackingvoidremoveLevel(int level) This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid.voidremoveLevelLate(int level) This function is called in case of the backtrack.toString()Identifiersprivate voidMethods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jacop.api.Stateful
isStateful
-
Field Details
-
QUEUE_INDEX
private static final int QUEUE_INDEX- See Also:
-
DO_INSTRUMENTATION
private static final boolean DO_INSTRUMENTATION- See Also:
-
SHOW_LEVEL
private static final boolean SHOW_LEVEL- See Also:
-
statistics
Statistics statistics -
idNumber
Instance counter -
network
The network -
costVariable
The cost variable -
map
The variables and their handlers -
queue
The set of queued variables -
disableQueueVariable
public boolean disableQueueVariableDisables the queue variable function during consistency -
previousLevel
public int previousLevel
-
-
Constructor Details
-
Method Details
-
getConsistencyPruningEvent
Description copied from class:ConstraintIt retrieves the pruning event which causes reevaluation of the constraint.- Overrides:
getConsistencyPruningEventin classConstraint- Parameters:
var- variable for which pruning event is retrieved- Returns:
- it returns the int code of the pruning event (GROUND, BOUND, ANY, NONE)
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEventin classConstraint
-
impose
Description copied from class:ConstraintIt imposes the constraint in a given store.- Overrides:
imposein classConstraint- Parameters:
store- the constraint store to which the constraint is imposed to.
-
queueVariable
Search & Backtracking- Overrides:
queueVariablein classConstraint- Parameters:
level- the level of the store at which the change has occurred.variable- variable which has changed.
-
updateGraph
private void updateGraph() -
consistency
Description copied from class:ConstraintIt 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:
consistencyin classConstraint- Parameters:
store- constraint store within which the constraint consistency is being checked.
-
removeLevel
public void removeLevel(int level) Description copied from interface:StatefulThis function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid. This function is called *before* all timestamps, variables, mutablevariables have reverted to their previous value.- Specified by:
removeLevelin interfaceStateful- Parameters:
level- the level which is being removed.
-
removeLevelLate
public void removeLevelLate(int level) Description copied from interface:RemoveLevelLateThis function is called in case of the backtrack. It is called after all timestamps, variables, mutablevariables have reverted to their values *after* removing the level.- Specified by:
removeLevelLatein interfaceRemoveLevelLate- Parameters:
level- the level which is being removed.
-
toString
Identifiers- Overrides:
toStringin classConstraint
-