Class Arc
java.lang.Object
org.jacop.constraints.netflow.simplex.Arc
A directed, residual arc in the graph.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
The unused (i.e.The arc companion for constraint API.int
The cost of the Arc costboolean
whether this arc is a forward arc or a residual arcfinal Node
The head of the arc (where the arc points to).int
Index in lower arcs arrayfinal Arc
The flow of an arc is the residual capacity of its sister arc. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFlow
(int delta) void
clear()
Clears an artificial arcboolean
boolean
isInCut
(boolean forward) long
longCost()
name()
int
Computes the cost of this arc considering node potentials.void
set
(int newCost, int newCapacity) Initializes an artificial arctail()
toFlow()
toString()
-
Field Details
-
head
The head of the arc (where the arc points to). The head of an arc is the tail of its sister arc. -
cost
public int costThe cost of the Arc cost -
capacity
public int capacityThe unused (i.e. residual) capacity of the arc -
sister
The flow of an arc is the residual capacity of its sister arc. -
index
public int indexIndex in lower arcs array -
companion
The arc companion for constraint API. Only forward arcs have a companion, residual arcs do not. -
forward
public boolean forwardwhether this arc is a forward arc or a residual arc
-
-
Constructor Details
-
Arc
Special constructor to create artificial arcs. Should NOT be used in a model. Models should use (or subclass) a NetworkBuilder instead. A NetworkBuilder provides various addArc methods to create arcs more conveniently.- Parameters:
tail
- tail of the archead
- head of the arc
-
Arc
General constructor to create arcs. Models should consider to use (or subclass) a NetworkBuilder instead. A NetworkBuilder provides various addArc methods to create arcs more conveniently.- Parameters:
tail
- tail of the archead
- head of the arccost
- cost-per-unit of the arclowerCapacity
- lower capacity of the arcupperCapacity
- upper capacity of the arc
-
Arc
-
-
Method Details
-
reducedCost
public int reducedCost()Computes the cost of this arc considering node potentials.- Returns:
- the reduced cost
-
addFlow
public void addFlow(int delta) -
tail
-
isInCut
public boolean isInCut(boolean forward) -
set
public void set(int newCost, int newCapacity) Initializes an artificial arc- Parameters:
newCost
- new cost for the arcnewCapacity
- new capacity for the arc
-
clear
public void clear()Clears an artificial arc -
longCost
public long longCost()- Returns:
- cost associated with an arc.
-
toString
-
toFlow
-
hasCompanion
public boolean hasCompanion() -
getCompanion
-
name
-