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.8
-
-
Field Summary
Fields Modifier and Type Field Description longcostOffsetCost due to deleted arcsjava.util.List<Arc>deletedArcsList of deleted arcs (contains no duplicates)TimeStamp<java.lang.Integer>deletedSizeNumber of deleted arcs at each leveljava.util.LinkedHashSet<ArcCompanion>lastModifiedArcsSet of arcs modified at current leveljava.util.List<ArcCompanion>modifiedArcsList of modified arcs (may contain duplicates)TimeStamp<java.lang.Integer>modifiedSizeNumber of modified arcs at each levelprivate static booleanSHOW_CHANGESStorestoreThe 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 voidadd(Arc arc)voidbacktrack()voidchangeCostOffset(long delta)Changes the cost offset by some value.longcost(long cutoff)intgetStoreLevel()Retrieves the current store level for domain pruning.voidincreaseLevel()voidinitialize(Store store)voidmodified(ArcCompanion companion)Tells the network that an arc has been modified.booleanneedsUpdate(int maxCost)voidremove(Arc arc)Removes an arc from the network.private voidrestore(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:MutableNetworkRemoves an arc from the network. The arc must be at its lower or upper bound before it can be removed.- Specified by:
removein interfaceMutableNetwork- Parameters:
arc- The arc to be removed
-
modified
public void modified(ArcCompanion companion)
Description copied from interface:MutableNetworkTells the network that an arc has been modified. The network will then restore the arc upon backtracking.- Specified by:
modifiedin 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:MutableNetworkChanges the cost offset by some value.- Specified by:
changeCostOffsetin interfaceMutableNetwork- Parameters:
delta- the change in cost
-
cost
public long cost(long cutoff)
- Overrides:
costin classNetworkSimplex
-
getStoreLevel
public int getStoreLevel()
Description copied from interface:MutableNetworkRetrieves the current store level for domain pruning.- Specified by:
getStoreLevelin interfaceMutableNetwork- Returns:
- the store level
-
needsUpdate
public boolean needsUpdate(int maxCost)
-
-