public class Network
extends java.lang.Object
That means the path of a flow is a sequence of buffers crossed by it and the analysis operating on a network handles Server objects as such.
Please consider this when modeling a network for analysis. E.g., assuming output buffering in a simple wireless sensor network with one transceiver per node there is a 1:1-relation between network graph connecting wireless sensor nodes and servers in the DiscoDNC network.
A flows path, however, is a sequence of crossed buffers. As a flow usually does not reach the output buffer of its sink, the path should not contain a link to it. Otherwise the flow interference pattern of the network will be too pessimistic, yet, the results remain valid.
In practice, on can model a sink explicitly by setting the server's service curve to be an infinite burst after without delay ( see ServiceCurve.createZeroDelayBurst() ).
Modifier and Type | Field | Description |
---|---|---|
private java.lang.String |
flow_default_name_prefix |
|
private int |
flow_id_counter |
|
private java.util.Set<Flow> |
flows |
|
private java.lang.String |
link_default_name_prefix |
|
private int |
link_id_counter |
|
private java.util.Set<Link> |
links |
|
private java.util.Map<java.lang.Integer,Flow> |
map__id__flow |
|
private java.util.Map<java.lang.Integer,Server> |
map__id__server |
|
private java.util.Map<Link,java.util.Set<Flow>> |
map__link__flows |
|
private java.util.Map<Server,java.util.Set<Flow>> |
map__server__flows |
|
private java.util.Map<Server,java.util.Set<Link>> |
map__server__in_links |
|
private java.util.Map<Server,java.util.Set<Link>> |
map__server__out_links |
|
private java.util.Map<Server,java.util.Set<Flow>> |
map__server__source_flows |
|
private java.lang.String |
server_default_name_prefix |
|
private int |
server_id_counter |
|
private java.util.Set<Server> |
servers |
Constructor | Description |
---|---|
Network() |
Modifier and Type | Method | Description |
---|---|---|
protected Flow |
addFlow(ArrivalCurve arrival_curve,
Path path) |
|
Flow |
addFlow(ArrivalCurve arrival_curve,
Server single_hop) |
Creates a flow and adds it to the network.
|
Flow |
addFlow(ArrivalCurve arrival_curve,
Server source,
Server sink) |
Creates a flow and adds it to the network.
|
Flow |
addFlow(ArrivalCurve arrival_curve,
java.util.List path) |
|
Flow |
addFlow(java.lang.String alias,
ArrivalCurve arrival_curve,
Server single_hop) |
Creates a flow and adds it to the network.
|
Flow |
addFlow(java.lang.String alias,
ArrivalCurve arrival_curve,
Server source,
Server sink) |
Creates a flow and adds it to the network.
|
Flow |
addFlow(java.lang.String alias,
ArrivalCurve arrival_curve,
java.util.List path) |
Creates a flow and adds it to the network.
|
private Flow |
addFlowToNetwork(java.lang.String alias,
ArrivalCurve arrival_curve,
Path path) |
|
Link |
addLink(Server source,
Server destination) |
|
Link |
addLink(java.lang.String alias,
Server source,
Server destination) |
|
Server |
addServer(ServiceCurve service_curve) |
|
Server |
addServer(ServiceCurve service_curve,
MaxServiceCurve max_service_curve) |
By default the server's use_gamma and use_extra_gamma are enabled
|
Server |
addServer(ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
boolean use_gamma,
boolean use_extra_gamma) |
|
Server |
addServer(ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
AnalysisConfig.Multiplexing multiplexing) |
|
Server |
addServer(ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
AnalysisConfig.Multiplexing multiplexing,
boolean use_gamma,
boolean use_extra_gamma) |
|
Server |
addServer(ServiceCurve service_curve,
AnalysisConfig.Multiplexing multiplexing) |
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve) |
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve,
MaxServiceCurve max_service_curve) |
By default the server's use_gamma and use_extra_gamma are enabled
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
boolean use_gamma,
boolean use_extra_gamma) |
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
AnalysisConfig.Multiplexing multiplexing) |
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve,
MaxServiceCurve max_service_curve,
AnalysisConfig.Multiplexing multiplexing,
boolean use_gamma,
boolean use_extra_gamma) |
|
Server |
addServer(java.lang.String alias,
ServiceCurve service_curve,
AnalysisConfig.Multiplexing multiplexing) |
|
Network |
copy() |
Creates a deep copy of this network.
|
Path |
createPath(Link link) |
|
Path |
createPath(Server server) |
|
Path |
createPath(java.util.List path) |
|
Path |
createPath(java.util.List<Server> path_servers,
java.util.List<Link> path_links) |
|
private Path |
createPathFromLinks(java.util.List<Link> path_links) |
|
private Path |
createPathFromServers(java.util.List<Server> path_servers) |
|
int |
degree(Server s) |
|
Link |
findLink(Server src,
Server dest) |
|
Server |
findSplittingServer(Server server_common_dest,
java.util.Set<Flow> flows_of_interest) |
Returns the server at which the flows in
flows_of_interest first
all meet each other (when viewed from the source). |
Flow |
getFlow(int id) |
|
java.util.Set<Flow> |
getFlows() |
|
java.util.Set<Flow> |
getFlows(Link l) |
|
java.util.Set<Flow> |
getFlows(Path p) |
|
java.util.Set<Flow> |
getFlows(Server s) |
|
java.util.Set<Flow> |
getFlows(java.util.Set<Link> links) |
|
java.util.Map<Server,java.util.Set<Flow>> |
getFlowsPerServer(Path p,
java.util.Set<Flow> excluded_flows) |
Do not confuse with getServerJoiningFlowsMap
|
java.util.Map<Path,java.util.Set<Flow>> |
getFlowsPerSubPath(Path p) |
For every distinct sub-path of p this method returns the flows taking it
entirely.
|
java.util.Set<Link> |
getIncidentLinks(Server s) |
Returns a new set consisting of references to the links.
|
java.util.Set<Link> |
getInLinks(Server s) |
Returns a new set consisting of references to the servers.
|
java.util.Set<Server> |
getInOutServers() |
Returns the subsets of all nodes of the directed graph
g that
are neither sources nor sinks, i.e. |
java.util.Set<Link> |
getLinks() |
|
java.util.Set<Server> |
getNeighbors(Server s) |
Returns a new set consisting of references to the servers.
|
java.util.Set<Link> |
getOutLinks(Server s) |
Returns a new set consisting of references to the servers.
|
java.util.Set<Server> |
getPredecessors(Server s) |
Returns a new set consisting of references to the servers.
|
Server |
getServer(int id) |
|
java.util.Map<Server,java.util.Set<Flow>> |
getServerJoiningFlowsMap(Path path) |
|
java.util.Map<Server,java.util.Set<Flow>> |
getServerLeavingFlowsMap(Path path) |
|
java.util.Set<Server> |
getServers() |
|
Path |
getShortestPath(Server src,
Server snk) |
Calculates the shortest path between src and snk according to Dijkstra's
algorithm
|
java.util.Set<Server> |
getSinkSet() |
Returns the subsets of all nodes of the directed graph
g that
are sinks, i.e. |
ArrivalCurve |
getSourceFlowArrivalCurve(Server source) |
Returns an aggregate arrival curve for all flows originating in
source . |
ArrivalCurve |
getSourceFlowArrivalCurve(Server source,
java.util.Set<Flow> source_flows) |
Returns an aggregate arrival curve for all flows originating in
source and contained in the set outgoing_flows . |
java.util.Set<Flow> |
getSourceFlows(Server source) |
|
java.util.Set<Server> |
getSourceSet() |
Returns the subsets of all nodes of the directed graph
g that
are sources, i.e. |
java.util.Set<Server> |
getSuccessors(Server s) |
Returns a new set consisting of references to the servers.
|
java.util.Map<org.apache.commons.math3.util.Pair<Link,Path>,java.util.Set<Flow>> |
groupFlowsPerInlinkSubPath(Path p,
java.util.Set<Flow> flows_to_group) |
|
java.util.Map<Path,java.util.Set<Flow>> |
groupFlowsPerSubPath(Path p,
java.util.Set<Flow> flows_to_group) |
|
private java.util.Map<org.apache.commons.math3.util.Pair<Server,Path>,java.util.Set<Flow>> |
groupFlowsPerSubPathInternal(Path p,
java.util.Set<Flow> flows_to_group) |
|
int |
inDegree(Server s) |
|
int |
numFlows() |
|
int |
numLinks() |
|
int |
numServers() |
|
int |
outDegree(Server s) |
|
private void |
remove(java.util.Set<Server> servers_to_remove,
java.util.Set<Link> links_to_remove,
java.util.Set<Flow> flows_to_remove) |
|
void |
removeFlow(Flow f) |
Removes a flow from the network.
|
void |
removeLink(Link l) |
|
void |
removeServer(Server s) |
|
void |
saveAs(java.lang.String output_path,
java.lang.String file_name) |
|
void |
saveAs(java.lang.String output_path,
java.lang.String file_name,
java.lang.String package_name) |
|
java.lang.String |
toString() |
|
private void |
updateServerAdditionInternally(Server new_server) |
private java.util.Set<Server> servers
private java.util.Set<Link> links
private java.util.Set<Flow> flows
private java.util.Map<Server,java.util.Set<Flow>> map__server__source_flows
private java.lang.String server_default_name_prefix
private int server_id_counter
private java.util.Map<java.lang.Integer,Server> map__id__server
private java.lang.String link_default_name_prefix
private int link_id_counter
private java.lang.String flow_default_name_prefix
private int flow_id_counter
private java.util.Map<java.lang.Integer,Flow> map__id__flow
private void remove(java.util.Set<Server> servers_to_remove, java.util.Set<Link> links_to_remove, java.util.Set<Flow> flows_to_remove)
public Server addServer(ServiceCurve service_curve)
public Server addServer(ServiceCurve service_curve, AnalysisConfig.Multiplexing multiplexing)
public Server addServer(java.lang.String alias, ServiceCurve service_curve)
public Server addServer(java.lang.String alias, ServiceCurve service_curve, AnalysisConfig.Multiplexing multiplexing)
public Server addServer(ServiceCurve service_curve, MaxServiceCurve max_service_curve)
service_curve
- The server's service curve.max_service_curve
- The server's maximum service curve.public Server addServer(java.lang.String alias, ServiceCurve service_curve, MaxServiceCurve max_service_curve)
alias
- The server's user-defined alias.service_curve
- The server's service curve.max_service_curve
- The server's maximum service curve.public Server addServer(ServiceCurve service_curve, MaxServiceCurve max_service_curve, boolean use_gamma, boolean use_extra_gamma)
public Server addServer(java.lang.String alias, ServiceCurve service_curve, MaxServiceCurve max_service_curve, AnalysisConfig.Multiplexing multiplexing)
public Server addServer(ServiceCurve service_curve, MaxServiceCurve max_service_curve, AnalysisConfig.Multiplexing multiplexing)
public Server addServer(java.lang.String alias, ServiceCurve service_curve, MaxServiceCurve max_service_curve, boolean use_gamma, boolean use_extra_gamma)
public Server addServer(ServiceCurve service_curve, MaxServiceCurve max_service_curve, AnalysisConfig.Multiplexing multiplexing, boolean use_gamma, boolean use_extra_gamma)
public Server addServer(java.lang.String alias, ServiceCurve service_curve, MaxServiceCurve max_service_curve, AnalysisConfig.Multiplexing multiplexing, boolean use_gamma, boolean use_extra_gamma)
private void updateServerAdditionInternally(Server new_server)
public void removeServer(Server s) throws java.lang.Exception
java.lang.Exception
public Server getServer(int id) throws java.lang.Exception
java.lang.Exception
public java.util.Set<Server> getServers()
public int numServers()
public java.util.Set<Server> getInOutServers()
g
that
are neither sources nor sinks, i.e. who have both (a) predecessor(s) and (a)
successor(s) (in-degree > 0 and out-degree > 0).public java.util.Set<Server> getSourceSet()
g
that
are sources, i.e. whose predecessor set is empty (in-degree == 0).public java.util.Set<Server> getSinkSet()
g
that
are sinks, i.e. whose successor set is empty (out-degree == 0).public int degree(Server s)
public int inDegree(Server s)
public int outDegree(Server s)
public java.util.Set<Link> getInLinks(Server s)
s
- The server whose inlinks are returned.public java.util.Set<Link> getOutLinks(Server s)
s
- The server whose outlinks are returned.public java.util.Set<Link> getIncidentLinks(Server s)
s
- The server whose inlinks and outlinks are returned.public java.util.Set<Server> getNeighbors(Server s)
s
- The server whose inlink sources and outlink destinations are
returned.public java.util.Set<Server> getPredecessors(Server s)
s
- The server whose inlink sources are returned.public java.util.Set<Server> getSuccessors(Server s)
s
- The server whose outlink destinations are returned.public Link addLink(Server source, Server destination) throws java.lang.Exception
java.lang.Exception
public Link addLink(java.lang.String alias, Server source, Server destination) throws java.lang.Exception
java.lang.Exception
public void removeLink(Link l) throws java.lang.Exception
java.lang.Exception
public java.util.Set<Link> getLinks()
public int numLinks()
public Link findLink(Server src, Server dest) throws java.lang.Exception
src
- The link's source.dest
- The link's destination.java.lang.Exception
- No link from src to snk found in this network.public Flow addFlow(ArrivalCurve arrival_curve, java.util.List path) throws java.lang.Exception
java.lang.Exception
protected Flow addFlow(ArrivalCurve arrival_curve, Path path) throws java.lang.Exception
java.lang.Exception
public Flow addFlow(ArrivalCurve arrival_curve, Server source, Server sink) throws java.lang.Exception
arrival_curve
- The flow's arrival curve.source
- Source for shortest path routing.sink
- Sink for shortest path routing.java.lang.Exception
- Could not create a path from the given source/sink-pair.public Flow addFlow(java.lang.String alias, ArrivalCurve arrival_curve, Server source, Server sink) throws java.lang.Exception
alias
- The flow's user defined-alias.arrival_curve
- The flow's arrival curve.source
- Source for shortest path routing.sink
- Sink for shortest path routing.java.lang.Exception
- Could not create a path from the given source/sink-pair.public Flow addFlow(java.lang.String alias, ArrivalCurve arrival_curve, java.util.List path) throws java.lang.Exception
alias
- The flow's user defined-alias.arrival_curve
- The flow's arrival curve.path
- The flows path as a list of servers or links.java.lang.Exception
- The given path is not entirely in the network.public Flow addFlow(ArrivalCurve arrival_curve, Server single_hop) throws java.lang.Exception
arrival_curve
- The flow's arrival curve.single_hop
- The single hop the flow takes in the network.java.lang.Exception
- The given server is not in the network.public Flow addFlow(java.lang.String alias, ArrivalCurve arrival_curve, Server single_hop) throws java.lang.Exception
alias
- The flow's user defined-alias.arrival_curve
- The flow's arrival curve.single_hop
- The single hop the flow takes in the network.java.lang.Exception
- The given server is not in the network.private Flow addFlowToNetwork(java.lang.String alias, ArrivalCurve arrival_curve, Path path) throws java.lang.Exception
java.lang.Exception
public void removeFlow(Flow f) throws java.lang.Exception
f
- The flow to be removed.java.lang.Exception
- Flow to be removed is not in this network's list of flows.public java.util.Set<Flow> getFlows()
public int numFlows()
public Flow getFlow(int id) throws java.lang.Exception
java.lang.Exception
public java.util.Set<Flow> getFlows(Path p) throws java.lang.Exception
java.lang.Exception
public java.util.Map<Server,java.util.Set<Flow>> getFlowsPerServer(Path p, java.util.Set<Flow> excluded_flows) throws java.lang.Exception
p
- The path to split up into its hops and analyze for flows.excluded_flows
- Flows to omit in the sorting operation.java.lang.Exception
- Could not sort although there may be flows.public java.util.Map<Path,java.util.Set<Flow>> getFlowsPerSubPath(Path p) throws java.lang.Exception
p
- The path to split up and analyze for flows.java.lang.Exception
- Could not sort although there may be flows.public java.util.Map<Path,java.util.Set<Flow>> groupFlowsPerSubPath(Path p, java.util.Set<Flow> flows_to_group) throws java.lang.Exception
java.lang.Exception
private java.util.Map<org.apache.commons.math3.util.Pair<Server,Path>,java.util.Set<Flow>> groupFlowsPerSubPathInternal(Path p, java.util.Set<Flow> flows_to_group) throws java.lang.Exception
java.lang.Exception
public java.util.Map<org.apache.commons.math3.util.Pair<Link,Path>,java.util.Set<Flow>> groupFlowsPerInlinkSubPath(Path p, java.util.Set<Flow> flows_to_group) throws java.lang.Exception
p
- flows_to_group
- java.lang.Exception
public ArrivalCurve getSourceFlowArrivalCurve(Server source)
source
.
Returns a null curve if there are no source flows at source
.
source
- The source of all flows to be aggregated.public ArrivalCurve getSourceFlowArrivalCurve(Server source, java.util.Set<Flow> source_flows)
source
and contained in the set outgoing_flows
.
Returns a null curve if the intersection of those sets of curves is empty.
source
- The source of all flows to be aggregated.source_flows
- The set of all flows to be aggregated.public Path createPath(Server server) throws java.lang.Exception
java.lang.Exception
public Path createPath(Link link) throws java.lang.Exception
java.lang.Exception
public Path createPath(java.util.List path) throws java.lang.Exception
java.lang.Exception
private Path createPathFromServers(java.util.List<Server> path_servers) throws java.lang.Exception
java.lang.Exception
private Path createPathFromLinks(java.util.List<Link> path_links) throws java.lang.Exception
java.lang.Exception
public Path createPath(java.util.List<Server> path_servers, java.util.List<Link> path_links) throws java.lang.Exception
java.lang.Exception
public java.util.Map<Server,java.util.Set<Flow>> getServerJoiningFlowsMap(Path path) throws java.lang.Exception
path
- The tandem of servers to check for flows.flows_to_join
- Flows not in the return setjava.lang.Exception
- Could not derive the joining flows even if there are.public java.util.Map<Server,java.util.Set<Flow>> getServerLeavingFlowsMap(Path path) throws java.lang.Exception
java.lang.Exception
public Path getShortestPath(Server src, Server snk) throws java.lang.Exception
src
- The path's source.snk
- The path's sink.java.lang.Exception
- Could not find a shortest path for some reason.public Server findSplittingServer(Server server_common_dest, java.util.Set<Flow> flows_of_interest) throws java.lang.Exception
flows_of_interest
first
all meet each other (when viewed from the source). When viewed from
server
towards the sink, this is the last server where all flows
are still together.server_common_dest
- The common destination, excluded as a potential splitting server.flows_of_interest
- The flows whose common subpath before server_common_dest is computed.java.lang.Exception
- No splitting point prior to the common destination found.public Network copy() throws java.lang.Exception
java.lang.Exception
- Signals problems while instantiating the copy.public void saveAs(java.lang.String output_path, java.lang.String file_name) throws java.lang.Exception
java.lang.Exception
public void saveAs(java.lang.String output_path, java.lang.String file_name, java.lang.String package_name) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object