public class RNEdge extends Edge
Network
.
Edge
by a relation id that stores the id of the related arc in the network.predecessor, successor
Constructor and Description |
---|
RNEdge(Vertex predecessor,
Vertex successor,
float weight)
Creates a new residual network edge.
|
RNEdge(Vertex predecessor,
Vertex successor,
float weight,
int relationID)
Creates a new residual network edge.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Edge e)
Indicates whether the given edge equals this edge.
|
int |
getRelationID()
Gets the id of the related arc in the network.
|
void |
setRelationID(int id)
Sets the id of the related arc in the network.
|
deserialize, equals, equalsIgnoreWeight, getGraph, getID, getIndex, getPredecessor, getPredecessor, getSuccessor, getSuccessor, getWeight, isDirected, isLoop, serialize, setDirected, setWeight, toString
public RNEdge(Vertex predecessor, Vertex successor, float weight) throws java.lang.IllegalArgumentException
predecessor
- the predecessorsuccessor
- the successorweight
- the weightjava.lang.IllegalArgumentException
- public RNEdge(Vertex predecessor, Vertex successor, float weight, int relationID) throws java.lang.IllegalArgumentException
predecessor
- the predecessorsuccessor
- the successorweight
- the weightrelationID
- the id of the related arc in the networkjava.lang.IllegalArgumentException
- public int getRelationID()
< 1
if there is not id setpublic void setRelationID(int id)
id
- the id of the related arcpublic boolean equals(Edge e)
Edge
e.directed == this.directed && e.predecessor == this.predecessor && e.successor == this.successor && e.weight == this.weight
or if this edge is undirected and e.directed == this.directed && ((e.predecessor == this.predecessor && e.successor == this.successor) || (e.predecessor == this.successor && e.successor == this.predecessor)) && e.weight == this.weight
.