|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.graphstream.algorithm.flow.FlowAlgorithmBase
public abstract class FlowAlgorithmBase
Base for flow algorithms. Provides features to handle capacities and flows.
Method Summary | |
---|---|
double |
getCapacity(int uIndex,
int vIndex)
Shortcut getCapacity(Node, Node) . |
double |
getCapacity(org.graphstream.graph.Node u,
org.graphstream.graph.Node v)
Get capacity of edge (u,v). |
double |
getCapacity(String uId,
String vId)
Shortcut getCapacity(Node, Node) . |
String |
getCapacityAttribute()
Get the key attribute from which capacities are loaded. |
double |
getFlow(int uIndex,
int vIndex)
Shortcut to getFlow(Node, Node) . |
double |
getFlow(org.graphstream.graph.Node u,
org.graphstream.graph.Node v)
Get flow value of edge (u,v). |
double |
getFlow(String uId,
String vId)
Shortcut to getFlow(Node, Node) . |
String |
getFlowSinkId()
Get id of the sink. |
String |
getFlowSourceId()
Get id of the source. |
double |
getMaximumFlow()
Get maximum flow compute by Algorithm.compute() . |
void |
init(org.graphstream.graph.Graph graph)
Initialization of the algorithm. |
void |
init(org.graphstream.graph.Graph g,
String sourceId,
String sinkId)
Init the algorithm. |
void |
setAllCapacities(double value)
|
void |
setCapacity(int uIndex,
int vIndex,
double capacity)
Shortcut to setCapacity(Node, Node, double) . |
void |
setCapacity(org.graphstream.graph.Node u,
org.graphstream.graph.Node v,
double capacity)
Set capacity of (u,v). |
void |
setCapacity(String uId,
String vId,
double capacity)
Shortcut to setCapacity(Node, Node, double) . |
void |
setCapacityAttribute(String attribute)
Set the key of the attribute from which capacities will be loaded. |
void |
setFlow(int uIndex,
int vIndex,
double flow)
Shortcut to setFlow(Node, Node, double) . |
void |
setFlow(org.graphstream.graph.Node u,
org.graphstream.graph.Node v,
double flow)
Set flow of edge (u,v). |
void |
setFlow(String uId,
String vId,
double flow)
Shortcut to setFlow(Node, Node, double) . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.graphstream.algorithm.Algorithm |
---|
compute |
Method Detail |
---|
public String getFlowSourceId()
FlowAlgorithm
getFlowSourceId
in interface FlowAlgorithm
public String getFlowSinkId()
FlowAlgorithm
getFlowSinkId
in interface FlowAlgorithm
public void init(org.graphstream.graph.Graph graph)
Algorithm
Algorithm.compute()
method to initialize or reset the algorithm according
to the new given graph.
init
in interface Algorithm
graph
- The graph this algorithm is using.public void init(org.graphstream.graph.Graph g, String sourceId, String sinkId)
FlowAlgorithm
Algorithm.init(Graph)
method
of Algorithm so users just have to call this new method.
init
in interface FlowAlgorithm
g
- graph that should be used by the algorithmsourceId
- id of the source of the flowsinkId
- id of the sink of the flowpublic double getMaximumFlow()
FlowAlgorithm
Algorithm.compute()
.
getMaximumFlow
in interface FlowAlgorithm
public double getFlow(int uIndex, int vIndex)
getFlow(Node, Node)
.
uIndex
- index of sourcevIndex
- index of target
public double getFlow(String uId, String vId)
getFlow(Node, Node)
.
uId
- id of sourcevId
- id of target
public double getFlow(org.graphstream.graph.Node u, org.graphstream.graph.Node v)
FlowAlgorithm
getFlow
in interface FlowAlgorithm
public void setFlow(int uIndex, int vIndex, double flow)
setFlow(Node, Node, double)
.
uIndex
- index of uvIndex
- index of vflow
- new float of (u,v)public void setFlow(String uId, String vId, double flow)
setFlow(Node, Node, double)
.
uId
- id of uvId
- id of vflow
- new float of (u,v)public void setFlow(org.graphstream.graph.Node u, org.graphstream.graph.Node v, double flow)
FlowAlgorithm
setFlow
in interface FlowAlgorithm
flow
- new flowpublic double getCapacity(int uIndex, int vIndex)
getCapacity(Node, Node)
.
uIndex
- index of uvIndex
- index of v
public double getCapacity(String uId, String vId)
getCapacity(Node, Node)
.
uId
- id of uvId
- id of v
public double getCapacity(org.graphstream.graph.Node u, org.graphstream.graph.Node v)
FlowAlgorithm
getCapacity
in interface FlowAlgorithm
public void setCapacity(int uIndex, int vIndex, double capacity)
setCapacity(Node, Node, double)
.
uIndex
- index of uvIndex
- index of vcapacity
- new capacity of (u,v)public void setCapacity(String uId, String vId, double capacity)
setCapacity(Node, Node, double)
.
uId
- id of uvId
- id of vcapacity
- new capacity of (u,v)public void setCapacity(org.graphstream.graph.Node u, org.graphstream.graph.Node v, double capacity)
FlowAlgorithm
FlowAlgorithm.init(Graph, String, String)
and Algorithm.compute()
.
setCapacity
in interface FlowAlgorithm
capacity
- new capacity of (u,v)public void setCapacityAttribute(String attribute)
FlowAlgorithm
Algorithm.compute()
.
setCapacityAttribute
in interface FlowAlgorithm
public String getCapacityAttribute()
FlowAlgorithm
getCapacityAttribute
in interface FlowAlgorithm
FlowAlgorithm.setCapacityAttribute(String)
public void setAllCapacities(double value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |