public final class Arc extends Object
Modifier and Type | Field and Description |
---|---|
int |
capacity
The unused (i.e.
|
ArcCompanion |
companion
The arc companion for constraint API.
|
int |
cost
The cost of the Arc cost
|
boolean |
forward
whether this arc is a forward arc or a residual arc
|
org.jacop.constraints.netflow.simplex.Node |
head
The head of the arc (where the arc points to).
|
int |
index
Index in lower arcs array
|
Arc |
sister
The flow of an arc is the residual capacity of its sister arc.
|
Constructor and Description |
---|
Arc(org.jacop.constraints.netflow.simplex.Node tail,
org.jacop.constraints.netflow.simplex.Node head)
Special constructor to create artificial arcs.
|
Arc(org.jacop.constraints.netflow.simplex.Node tail,
org.jacop.constraints.netflow.simplex.Node head,
int cost,
int lowerCapacity,
int upperCapacity)
General constructor to create arcs.
|
Modifier and Type | Method and Description |
---|---|
void |
addFlow(int delta) |
void |
clear()
Clears an artificial arc
|
ArcCompanion |
getCompanion() |
boolean |
hasCompanion() |
boolean |
isInCut(boolean forward) |
long |
longCost() |
String |
name() |
int |
reducedCost()
Computes the cost of this arc considering node potentials.
|
void |
set(int newCost,
int newCapacity)
Initializes an artificial arc
|
org.jacop.constraints.netflow.simplex.Node |
tail() |
String |
toFlow() |
String |
toString() |
public final org.jacop.constraints.netflow.simplex.Node head
public int cost
public int capacity
public final Arc sister
public int index
public ArcCompanion companion
public boolean forward
public Arc(org.jacop.constraints.netflow.simplex.Node tail, org.jacop.constraints.netflow.simplex.Node head)
tail
- tail of the archead
- head of the arcpublic Arc(org.jacop.constraints.netflow.simplex.Node tail, org.jacop.constraints.netflow.simplex.Node head, int cost, int lowerCapacity, int upperCapacity)
tail
- tail of the archead
- head of the arccost
- cost-per-unit of the arclowerCapacity
- lower capacity of the arcupperCapacity
- upper capacity of the arcpublic int reducedCost()
public void addFlow(int delta)
public org.jacop.constraints.netflow.simplex.Node tail()
public boolean isInCut(boolean forward)
public void set(int newCost, int newCapacity)
newCost
- new cost for the arcnewCapacity
- new capacity for the arcpublic void clear()
public long longCost()
public String toFlow()
public boolean hasCompanion()
public ArcCompanion getCompanion()
public String name()
Copyright © 2022. All rights reserved.