Class Flow
- java.lang.Object
-
- org.networkcalculus.dnc.network.server_graph.Flow
-
public class Flow extends java.lang.Object
Class representing flows through the network.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
alias
private ArrivalCurve
arrival_curve
The flow's arrival curveprivate int
id
The flow's ID.static Flow
NULL_FLOW
private Path
path
The turn path the flow traverses incl explicit sink
-
Constructor Summary
Constructors Modifier Constructor Description private
Flow()
protected
Flow(int id, java.lang.String alias, ArrivalCurve ac, Path path)
-
Method Summary
Modifier and Type Method Description private java.lang.StringBuffer
commonStringPrefix()
static Flow
createDummyFlow(java.lang.String alias, ArrivalCurve ac, Path path)
Creates a dummy flow with an arrival curve.
All dummy flows share the same id -1.java.lang.String
getAlias()
ArrivalCurve
getArrivalCurve()
int
getId()
Path
getPath()
Server
getPrecedingServer(Server s)
Turn
getPrecedingTurn(Server s)
java.util.LinkedList<Server>
getServersOnPath()
Server
getSink()
Server
getSource()
Path
getSubPath(Server from, Server to)
Server
getSucceedingServer(Server s)
Turn
getSucceedingTurn(Server s)
java.util.List<Turn>
getTurnsOnPath()
void
setAlias(java.lang.String alias)
boolean
setArrivalCurve(ArrivalCurve arrival_curve)
java.lang.String
toLongString()
java.lang.String
toShortString()
java.lang.String
toString()
-
-
-
Field Detail
-
NULL_FLOW
public static final Flow NULL_FLOW
-
id
private int id
The flow's ID.
-
arrival_curve
private ArrivalCurve arrival_curve
The flow's arrival curve
-
alias
private java.lang.String alias
-
path
private Path path
The turn path the flow traverses incl explicit sink
-
-
Constructor Detail
-
Flow
protected Flow(int id, java.lang.String alias, ArrivalCurve ac, Path path)
- Parameters:
id
- The flow's id (unique).alias
- The flow's alias (not necessarily unique).ac
- The flow's arrival curve.path
- The turn path the flow traverses.
-
Flow
private Flow()
-
-
Method Detail
-
createDummyFlow
public static Flow createDummyFlow(java.lang.String alias, ArrivalCurve ac, Path path)
Creates a dummy flow with an arrival curve.
All dummy flows share the same id -1.- Parameters:
alias
- The flow's alias (not necessarily unique).ac
- The flow's arrival curve.path
- The turn path the flow traverses.- Returns:
- a dummy flow
-
setArrivalCurve
public boolean setArrivalCurve(ArrivalCurve arrival_curve)
-
getArrivalCurve
public ArrivalCurve getArrivalCurve()
- Returns:
- A copy of the arrival curve
-
getId
public int getId()
-
getAlias
public java.lang.String getAlias()
-
setAlias
public void setAlias(java.lang.String alias)
-
getPath
public Path getPath()
-
commonStringPrefix
private java.lang.StringBuffer commonStringPrefix()
-
toShortString
public java.lang.String toShortString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of the flow.
-
toLongString
public java.lang.String toLongString()
-
getSource
public Server getSource()
-
getSink
public Server getSink()
-
getServersOnPath
public java.util.LinkedList<Server> getServersOnPath()
-
getTurnsOnPath
public java.util.List<Turn> getTurnsOnPath() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getSubPath
public Path getSubPath(Server from, Server to) throws java.lang.Exception
- Parameters:
from
- Source, inclusive.to
- Sink, inclusive.- Returns:
- The subpath.
- Throws:
java.lang.Exception
- No subpath found; most probably an input parameter problem.
-
getPrecedingTurn
public Turn getPrecedingTurn(Server s) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getSucceedingTurn
public Turn getSucceedingTurn(Server s) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPrecedingServer
public Server getPrecedingServer(Server s) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-