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
public class Network extends NetworkSimplex implements MutableNetwork
This class extends the minimum-cost flow network by providing operations and data structures for removal and modification of arcs.- Version:
- 4.7
-
-
Field Summary
Fields Modifier and Type Field Description long
costOffset
Cost due to deleted arcsjava.util.List<Arc>
deletedArcs
List of deleted arcs (contains no duplicates)TimeStamp<java.lang.Integer>
deletedSize
Number of deleted arcs at each leveljava.util.LinkedHashSet<ArcCompanion>
lastModifiedArcs
Set of arcs modified at current leveljava.util.List<ArcCompanion>
modifiedArcs
List of modified arcs (may contain duplicates)TimeStamp<java.lang.Integer>
modifiedSize
Number of modified arcs at each levelprivate static boolean
SHOW_CHANGES
Store
store
The store-
Fields 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
add(Arc arc)
void
backtrack()
void
changeCostOffset(long delta)
Changes the cost offset by some value.long
cost(long cutoff)
int
getStoreLevel()
Retrieves the current store level for domain pruning.void
increaseLevel()
void
initialize(Store store)
void
modified(ArcCompanion companion)
Tells the network that an arc has been modified.boolean
needsUpdate(int maxCost)
void
remove(Arc arc)
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 Detail
-
SHOW_CHANGES
private static final boolean SHOW_CHANGES
- See Also:
- Constant Field Values
-
deletedArcs
public final java.util.List<Arc> deletedArcs
List of deleted arcs (contains no duplicates)
-
deletedSize
public TimeStamp<java.lang.Integer> deletedSize
Number of deleted arcs at each level
-
costOffset
public long costOffset
Cost due to deleted arcs
-
modifiedArcs
public final java.util.List<ArcCompanion> modifiedArcs
List of modified arcs (may contain duplicates)
-
modifiedSize
public TimeStamp<java.lang.Integer> modifiedSize
Number of modified arcs at each level
-
lastModifiedArcs
public final java.util.LinkedHashSet<ArcCompanion> lastModifiedArcs
Set of arcs modified at current level
-
store
public Store store
The store
-
-
Method Detail
-
initialize
public void initialize(Store store)
-
add
private void add(Arc arc)
-
remove
public void remove(Arc arc)
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
public void modified(ArcCompanion companion)
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
private void restore(ArcCompanion companion)
-
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)
-
-