Package org.jacop.constraints.netflow
Class Network
java.lang.Object
org.jacop.constraints.netflow.simplex.NetworkSimplex
org.jacop.constraints.netflow.Network
- All Implemented Interfaces:
MutableNetwork
- Direct Known Subclasses:
Pruning
This class extends the minimum-cost flow network by providing operations and
data structures for removal and modification of arcs.
- Version:
- 4.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionlong
Cost due to deleted arcsList of deleted arcs (contains no duplicates)Number of deleted arcs at each levelfinal LinkedHashSet
<ArcCompanion> Set of arcs modified at current levelfinal List
<ArcCompanion> List of modified arcs (may contain duplicates)Number of modified arcs at each levelprivate static final boolean
The storeFields inherited from class org.jacop.constraints.netflow.simplex.NetworkSimplex
allArcs, blocking, DEBUG, DEBUG_ALL, DELETED_ARC, infeasibleNodes, LARGE_COST, lower, nodes, numArcs, pivotRule, root, TREE_ARC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
void
changeCostOffset
(long delta) Changes the cost offset by some value.long
cost
(long cutoff) int
Retrieves the current store level for domain pruning.void
void
initialize
(Store store) void
modified
(ArcCompanion companion) Tells the network that an arc has been modified.boolean
needsUpdate
(int maxCost) void
Removes an arc from the network.private void
restore
(ArcCompanion companion) Methods inherited from class org.jacop.constraints.netflow.simplex.NetworkSimplex
addArc, addArcWithFlow, augmentFlow, dualPivot, networkSimplex, parametricStep, primalStep, print, removeArc, treeSwap, updateTree
-
Field Details
-
SHOW_CHANGES
private static final boolean SHOW_CHANGES- See Also:
-
deletedArcs
List of deleted arcs (contains no duplicates) -
deletedSize
Number of deleted arcs at each level -
costOffset
public long costOffsetCost due to deleted arcs -
modifiedArcs
List of modified arcs (may contain duplicates) -
modifiedSize
Number of modified arcs at each level -
lastModifiedArcs
Set of arcs modified at current level -
store
The store
-
-
Constructor Details
-
Network
-
-
Method Details
-
initialize
-
add
-
remove
Description copied from interface:MutableNetwork
Removes an arc from the network. The arc must be at its lower or upper bound before it can be removed.- Specified by:
remove
in interfaceMutableNetwork
- Parameters:
arc
- The arc to be removed
-
modified
Description copied from interface:MutableNetwork
Tells the network that an arc has been modified. The network will then restore the arc upon backtracking.- Specified by:
modified
in interfaceMutableNetwork
- Parameters:
companion
- The arc that was modified
-
increaseLevel
public void increaseLevel() -
backtrack
public void backtrack() -
restore
-
changeCostOffset
public void changeCostOffset(long delta) Description copied from interface:MutableNetwork
Changes the cost offset by some value.- Specified by:
changeCostOffset
in interfaceMutableNetwork
- Parameters:
delta
- the change in cost
-
cost
public long cost(long cutoff) - Overrides:
cost
in classNetworkSimplex
-
getStoreLevel
public int getStoreLevel()Description copied from interface:MutableNetwork
Retrieves the current store level for domain pruning.- Specified by:
getStoreLevel
in interfaceMutableNetwork
- Returns:
- the store level
-
needsUpdate
public boolean needsUpdate(int maxCost)
-