public class NetPlan extends NetworkElement
Class defining a complete multi-layer network structure. Layers may
contain links, demands, routes or forwarding rules,
while nodes and SRGs are defined with a network-wide scope, that is, they
appear in all layers. To simplify handling of single-layer designs, methods that may refer to
layer-specific elements have an optiona input parameter of type NetworkLayer
.
In case of not using this optional parameter, the action
will be applied to the default layer (by default it is first defined layer),
which can be modified using the setNetworkLayerDefault(NetworkLayer)
setNetworkLayerDefault())}
method.
Internal representation of the NetPlan
object is based on:
NetworkLayer
objects.Node
objects.Link
objects.Route
objects (depending on the selected Routing Type
.Unicast
or Multicast
demand objects. Shared Risk Group
objectsEach element has a unique identifier (represented as long
) assigned the moment they are created, and two elements
(irregardless of their type) cannot share this identifier. This id is incremental (but not necessarily consecutive) and perpetual (i.e after removing an element identifiers are no renumbered).
Also, elements have an index number that identify them among their own type (nodes, links, etc.). Indexes are renumbered when an element is removed and are zero base, that is the first element of its type is always 0 and the last is N-1 (where N is the total number of elements of the same type).
An instance of a NetPlan object can be set as unmodifiable through the
setModifiableState(boolean)
setModifiableState())} method. The instance will work
transparently as NetPlan
object unless you try to change it. Calling
any method that can potentially change the network (e.g. add/set/remove methods)
throws an UnsupportedOperationException
.
Modifier and Type | Field and Description |
---|---|
static String |
PLOTLAYTOUT_DEFAULTNODELAYOUTGUINAME |
static String |
PLOTLAYTOUT_DEFAULTNODELAYOUTNAME |
Constructor and Description |
---|
NetPlan()
Default constructor.
|
NetPlan(File file)
Generates a new network design from a given
.n2p file. |
NetPlan(InputStream inputStream)
Generates a new network design from an input stream.
|
Modifier and Type | Method and Description |
---|---|
Demand |
addDemand(Node ingressNode,
Node egressNode,
double offeredTraffic,
Constants.RoutingType routingType,
Map<String,String> attributes,
NetworkLayer... optionalLayerParameter)
Adds a new traffic demand.
|
Pair<Demand,Demand> |
addDemandBidirectional(Node ingressNode,
Node egressNode,
double offeredTraffic,
Constants.RoutingType routingType,
Map<String,String> attributes,
NetworkLayer... optionalLayerParameter)
Adds two demands, one in each direction,.
|
List<Demand> |
addDemandsFromTrafficMatrix(DoubleMatrix2D trafficMatrix,
Constants.RoutingType routingType,
NetworkLayer... optionalLayerParameter)
Adds new traffic demands froma traffic matrix given as a
DoubleMatrix2D object. |
void |
addGlobalPlanningDomain(String planningDomain)
Adds a new planning domain to which elements can be assigned in the design.
|
NetworkLayer |
addLayer(String name,
String description,
String linkCapacityUnitsName,
String demandTrafficUnitsName,
URL defaultNodeIconURL,
Map<String,String> attributes)
Adds a new layer.
|
NetworkLayer |
addLayerFrom(NetworkLayer origin)
Creates a new layer and adds the links, routes etc.
|
Link |
addLink(Node originNode,
Node destinationNode,
double capacity,
double lengthInKm,
double propagationSpeedInKmPerSecond,
Map<String,String> attributes,
NetworkLayer... optionalLayerParameter)
Adds a new link.
|
Pair<Link,Link> |
addLinkBidirectional(Node originNode,
Node destinationNode,
double capacity,
double lengthInKm,
double propagationSpeedInKmPerSecond,
Map<String,String> attributes,
NetworkLayer... optionalLayerParameter)
Adds two links, one in each direction.
|
MulticastDemand |
addMulticastDemand(Node ingressNode,
Set<Node> egressNodes,
double offeredTraffic,
Map<String,String> attributes,
NetworkLayer... optionalLayerParameter)
Adds a new multicast traffic demand.
|
MulticastTree |
addMulticastTree(MulticastDemand demand,
double carriedTraffic,
double occupiedLinkCapacity,
Set<Link> linkSet,
Map<String,String> attributes)
Adds a new traffic multicast tree.
|
void |
addMulticastTreesFromCandidateTreeList(SortedMap<MulticastDemand,List<SortedSet<Link>>> cpl)
Adds multiple multicast trees from a Candidate Tree list.
|
Node |
addNode(double xCoord,
double yCoord,
String name,
Map<String,String> attributes)
Adds a new node to the network.
|
void |
addPlotNodeLayout(String newPlotNodeLayoutName)
Adds a new layout.
|
Resource |
addResource(String type,
String name,
Optional<Node> hostNode,
double capacity,
String capacityMeasurementUnits,
Map<Resource,Double> capacityIOccupyInBaseResource,
double processingTimeToTraversingTrafficInMs,
Map<String,String> attributes)
Adds a new Resource to the network.
|
Route |
addRoute(Demand demand,
double carriedTraffic,
double occupiedLinkCapacity,
List<Link> sequenceOfLinks,
Map<String,String> attributes)
Adds a new traffic route
|
void |
addRoutesAndBackupRoutesFromCandidate11PathList(SortedMap<Pair<Node,Node>,List<Pair<List<Link>,List<Link>>>> cpl11,
NetworkLayer... optionalLayer)
For each demand in the map, adds a number of route pairs with the given paths, where each route pair has a primary route and one backup to it.
|
void |
addRoutesFromCandidatePathList(SortedMap<Pair<Node,Node>,List<List<Link>>> cpl,
NetworkLayer... optionalLayer)
Adds multiples routes for each demand of the given layer, using the paths in an input Candidate Path List.
|
Route |
addServiceChain(Demand demand,
double carriedTraffic,
List<Double> occupiedLinkAndResourceCapacities,
List<? extends NetworkElement> sequenceOfLinksAndResources,
Map<String,String> attributes)
Adds a new traffic service chain, which is a route which also traverses and occupied resources.
|
SharedRiskGroup |
addSRG(double mttfInHours,
double mttrInHours,
Map<String,String> attributes)
Adds a new SRG.
|
SharedRiskGroup |
addSRGDynamic(double mttfInHours,
double mttrInHours,
String className,
String dynamicInitializationString,
Map<String,String> attributes)
Adds a new dynamic SRG.
|
void |
assignFrom(NetPlan netPlan)
Assigns the information from the input
NetPlan . |
void |
checkCachesConsistency()
For debug purposes: Checks the consistency of the internal cache (nodes, srgs, resources, layers, links, demands, multicast demands, multicast trees, routes).
|
NetworkLayer |
checkContiguousPath(List<Link> links,
NetworkLayer layer,
Node originNode,
Node destinationNode)
Checks that the input sequence of links belong to the same layer and follow a contiguous path.
|
NetworkLayer |
checkInThisNetPlanOptionalLayerParameter(NetworkLayer... optionalLayer)
Checks if the given layer is valid and belongs to this
NetPlan design. |
DoubleMatrix1D |
checkMatrixDemandLinkCarriedTrafficFlowConservationConstraints(DoubleMatrix2D x_de,
boolean xdeValueAsFractionsRespectToDemandOfferedTraffic,
NetworkLayer... optionalLayerParameter)
Checks the flow conservation constraints, and returns the traffic carried per demand.
|
DoubleMatrix2D |
checkMatrixDestinationLinkCarriedTrafficFlowConservationConstraints(DoubleMatrix2D x_te,
NetworkLayer... optionalLayerParameter)
Checks the flow conservation constraints, and returns the traffic carried per input output node pair.
|
SortedMap<MulticastDemand,List<SortedSet<Link>>> |
computeMulticastCandidatePathList(DoubleMatrix1D costs,
String solverName,
String solverLibraryName,
double maxSolverTimeInSecondsPerTree,
String... candidateTreeListParamValuePairs)
The same as
computeMulticastCandidatePathList for the default layer |
SortedMap<MulticastDemand,List<SortedSet<Link>>> |
computeMulticastCandidatePathList(NetworkLayer layer,
DoubleMatrix1D linkCosts,
String solverName,
String solverLibraryName,
double maxSolverTimeInSecondsPerTree,
String... candidateTreeListParamValuePairs)
Adds multicast trees specified by those trees that satisfy the options described below.
|
DoubleMatrix1D |
computeMulticastTreeCostVector(double[] costs,
NetworkLayer... optionalLayerParameter)
Returns an array with the cost of each multicast tree in the layer.
|
DoubleMatrix1D |
computeRouteCostVector(double[] costs,
NetworkLayer... optionalLayerParameter)
Returns an array with the cost of each route in the layer.
|
static SortedMap<Pair<Node,Node>,List<Pair<List<Link>,List<Link>>>> |
computeUnicastCandidate11PathList(Map<Pair<Node,Node>,List<List<Link>>> cpl,
int disjointType)
Computes a list of disjoint path pairs for each node pair, using the paths in the input candidate path list given.
|
static SortedMap<Demand,List<Pair<List<NetworkElement>,List<NetworkElement>>>> |
computeUnicastCandidate11ServiceChainList(SortedMap<Demand,List<List<NetworkElement>>> cpl,
int disjointType)
Computes a list of disjoint service chain pairs for each demand (service chain requests), using the service chain paths in the input
candidate path list given.
|
SortedMap<Pair<Node,Node>,List<List<Link>>> |
computeUnicastCandidatePathList(DoubleMatrix1D linkCosts,
int K,
double maxLengthInKm,
int maxNumHops,
double maxPropDelayInMs,
double maxRouteCost,
double maxRouteCostFactorRespectToShortestPath,
double maxRouteCostRespectToShortestPath,
SortedSet<Pair<Node,Node>> nodePairs,
NetworkLayer... optionalLayerParameter)
Computes for all the node pairs, a candidate path list in the given layer, composed of the k shortest paths according with the options indicated below.
|
SortedMap<Demand,List<List<NetworkElement>>> |
computeUnicastCandidateServiceChainList(DoubleMatrix1D linkCosts,
DoubleMatrix1D resourceCosts,
int K,
double maxCostServiceChain,
double maxLengthInKmPerSubpath,
int maxNumHopsPerSubpath,
double maxPropDelayInMsPerSubpath,
NetworkLayer... optionalLayerParameter)
Computes for each demand (service chain request) up to k minimum cost service chain paths (sequence and links and resources), according to
the link and resources cost information provided, as well as other constraints defined in the input parameters.
|
NetPlan |
copy()
Returns a deep copy of the current design.
|
void |
copyFrom(NetPlan originNetPlan)
Removes all information from the current
NetPlan and copy the information from the input NetPlan . |
SortedMap<Link,SortedMap<String,Pair<Double,Double>>> |
getAllLinksPerQosOccupationAndQosViolationMap(NetworkLayer... optionalLayerParameter)
For each link in the given layer, returns a map, with key the QoS types traversing it, and two
associated values: (i) the total traffic occupied of such Qos type, (ii) the amount out of that traffic that is violating the QoS
|
SortedSet<String> |
getAllPlotNodeLayoutsDefined()
Returns all the names (identifiers) of the current node layout
|
static SortedMap<NetworkElement,String> |
getAttributes(Collection<? extends NetworkElement> collection,
String attribute)
Returns the values of a given attribute for all the provided network elements.
|
static DoubleMatrix1D |
getAttributeValues(Collection<? extends NetworkElement> collection,
String attributeName,
double defaultValue)
Returns the values of a given attribute for all the provided network elements, as a
DoubleMatrix1D vector. |
Demand |
getDemand(int index,
NetworkLayer... optionalLayerParameter)
Returns the demand with the given index.
|
Demand |
getDemandFromId(long uid)
Returns the demand with the given unique identifier.
|
ArrayList<Long> |
getDemandIds(NetworkLayer... optionalLayerParameter)
Returns the array of demand unique ids for the given layer (i-th position, corresponds to index i).
|
List<Demand> |
getDemands(NetworkLayer... optionalLayerParameter)
Returns the array of demands for the given layer (i-th position, corresponds to index i).
|
List<Demand> |
getDemandsBlocked(NetworkLayer... optionalLayerParameter)
Returns the demands that have blocked traffic in the given layer.
|
SortedSet<Demand> |
getDemandsCoupled(NetworkLayer... optionalLayerParameter)
Returns the set of unicast demands that are coupled.
|
List<Demand> |
getDemandsHopByHopRouted(NetworkLayer... optionalLayerParameter)
Returns the array of demands in the given layer that are hop-by-hop routed, ordered by its index.
|
List<Demand> |
getDemandsSourceRouted(NetworkLayer... optionalLayerParameter)
Returns the array of demands in the given layer that are source routed, ordered by its index.
|
String |
getDemandTrafficUnitsName(NetworkLayer... optionalLayerParameter)
Returns the name of the traffic units of the demands of the given layer.
|
double |
getForwardingRuleCarriedTraffic(Demand demand,
Link link)
Returns the traffic that is carried using a forwarding rule, in the given layer.
|
SortedMap<Pair<Demand,Link>,Double> |
getForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the forwarding rules for the given layer.
|
double |
getForwardingRuleSplittingFactor(Demand demand,
Link link)
Returns the splitting factor of the forwarding rule of the given demand and link, which must be of the same layer.
|
SortedSet<Node> |
getGlobalPlanningDomainNodes(String planningDomain)
Returns the network elements associated to the given planning domain, or null if the planning domain was not defined
|
SortedSet<String> |
getGlobalPlanningDomains()
Returns the set of defined planning domains in this network design
|
static Collection<Long> |
getIds(Collection<? extends NetworkElement> collection)
Returns the unique ids of the provided network elements.
|
static Collection<Integer> |
getIndexes(Collection<? extends NetworkElement> collection)
Returns the indexes of the provided network elements.
|
Link |
getLink(int index,
NetworkLayer... optionalLayerParameter)
Returns the link with the given index in the given layer.
|
String |
getLinkCapacityUnitsName(NetworkLayer... optionalLayerParameter)
Returns the name of the capacity units of the links of the given layer.
|
Link |
getLinkFromId(long uid)
Returns the link with the given unique identifier.
|
ArrayList<Long> |
getLinkIds(NetworkLayer... optionalLayerParameter)
Returns the array of link ids for the given layer (i-th position, corresponds to index i).
|
List<Link> |
getLinks(NetworkLayer... optionalLayerParameter)
Return a list of all the links in the given layer.
|
SortedSet<Link> |
getLinksAreBottleneck(NetworkLayer... optionalLayerParameter)
Returns the set of links that are a bottleneck, i.e the fraction of occupied capacity respect to the total
is highest.
|
SortedSet<Link> |
getLinksCoupledToMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of links that are coupled to a multicast demand in the given layer.
|
SortedSet<Link> |
getLinksCoupledToUnicastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of links that are couple to a unicast demand in the given layer.
|
SortedSet<Link> |
getLinksDown(NetworkLayer... optionalLayerParameter)
Returns the set of links that are down in the given layer.
|
SortedSet<Link> |
getLinksDownAllLayers()
Returns the set of links that are down in all layers.
|
SortedSet<Link> |
getLinksOversubscribed(NetworkLayer... optionalLayerParameter)
Returns the set of links oversuscribed: the total occupied capacity exceeds the link capacity.
|
SortedSet<Link> |
getLinksUp(NetworkLayer... optionalLayerParameter)
Returns the set of links that are up in the given layer.
|
SortedSet<Link> |
getLinksUpAllLayers()
Returns the set of links that are up in all layers.
|
SortedSet<Link> |
getLinksWithZeroCapacity(NetworkLayer... optionalLayerParameter)
Returns the set of links that have zero capacity in the given layer.
|
DoubleMatrix2D |
getMatrixDemand2LinkAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-link incidence matrix (a DxE matrix in
which an element δde is equal to the number of
times which traffic routes carrying traffic from demand d traverse
link e).
|
DoubleMatrix2D |
getMatrixDemand2LinkTrafficCarried(SortedSet<Demand> demandsOfInterest,
NetworkLayer... optionalLayerParameter)
Returns the demand-link incidence matrix (DxE in which an element δde is equal to the amount of traffic of each demand carried in each link).
|
DoubleMatrix2D |
getMatrixDemand2ResourceAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-resource incidence matrix, with as many rows as demands of the given layer, and
a many colmns as resources, coordinate (d,r) equals the number of times that
traffic routes of the demand d, traverse resource r.
|
DoubleMatrix2D |
getMatrixDemand2ResourceOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns the demand-resource matrix, with as many rows as demands of the given layer, and as many columns as resources,
coordinate (d,r) is the resource capacity that demand d currently occupies in resource r (recall that failed routes do not occupy capacity
in the traversed resources).
|
DoubleMatrix2D |
getMatrixDemand2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-route incidence matrix (a DxR matrix in
which an element δdr is equal to 1 if traffic
route r is able to carry traffic from demand d).
|
DoubleMatrix2D |
getMatrixDemandBasedForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the splitting ratio matrix (fractions of traffic entering a node from
demand 'd', leaving that node through link 'e').
|
DoubleMatrix2D |
getMatrixDestination2LinkTrafficCarried(NetworkLayer... optionalLayerParameter) |
DoubleMatrix2D |
getMatrixDestinationBasedForwardingRules(NetworkLayer... optionalLayer)
A destination-based routing in the form of fractions fte (fraction of the traffic targeted to node t that arrives (or is generated in) node a(e)
(the initial node of link e), that is forwarded through link e).
|
DoubleMatrix2D |
getMatrixLink2LinkBidirectionalityMatrix(NetworkLayer... optionalLayerParameter)
Returns the link-link bidirectionality matrix (a ExE matrix where the element δee' equals 1 when each position e and e' represent a bidirectional
link at the given layer.
|
DoubleMatrix2D |
getMatrixLink2MulticastTreeAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-multicast incidence matrix (an ExT matrix in which an element δet is equal
to the number of times a multicast tree t traverse link e.
|
DoubleMatrix2D |
getMatrixLink2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-route incidence matrix (an ExR matrix in
which an element δep is equal to the number of
times which traffic route r traverses link e).
|
DoubleMatrix2D |
getMatrixLink2RouteFirstBackupRouteAssignment(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows as links and as many columns as routes in the given layer,
the position (e,r) contains the number of times that the first backup path of route r traveres link e
|
DoubleMatrix2D |
getMatrixLink2SRGAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-srg assignment matrix (an ExS matrix in which an element δes equals 1 if link e
fails when SRG s is affected.
|
DoubleMatrix2D |
getMatrixMulticastDemand2LinkAssignment(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-link incidence matrix (a DxE matrix in
which an element δde is equal to the number of
times which multicast trees carrying traffic from demand d traverse
link e).
|
DoubleMatrix2D |
getMatrixMulticastDemand2LinkTrafficCarried(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-link incidence matrix (DxE in which an element δde is equal to the amount of traffic of
each multicast demand carried in each link).
|
DoubleMatrix2D |
getMatrixMulticastDemand2MulticastTreeAssignment(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-multicast tree incidence matrix (a DxT matrix in
which an element δdt is equal to 1 if multicast tree t is able to carry traffic from multicast demand d).
|
DoubleMatrix2D |
getMatrixMulticastTree2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns the multicast tree-srg incidence matrix (an TxS matrix in which an element δts equals 1 when multicast tree t
fails when SRG s is affected.
|
DoubleMatrix2D |
getMatrixNode2NodeEuclideanDistance()
Returns the NxN Euclidean distance matrix (derived
from node coordinates), where N is the number of nodes within the network.
|
DoubleMatrix2D |
getMatrixNode2NodeHaversineDistanceInKm()
Returns the NxN Haversine distance matrix (derived
from node coordinates, where 'xCoord' is equal to longitude and 'yCoord'
is equal to latitude), where N is the number of nodes within the network.
|
DoubleMatrix2D |
getMatrixNode2NodeOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the traffic matrix, where rows and columns represent the ingress
node and the egress node, respectively, in increasing order of identifier.
|
DoubleMatrix2D |
getMatrixNodeDemandAdjacency(NetworkLayer... optionalLayerParameter)
Returns a NxN matrix where each position accounts from the humber of demands that node i (row) as ingress node and j (column) as egress node.
|
DoubleMatrix2D |
getMatrixNodeDemandIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand incidence matrix (a NxD in which an element δnd equals 1 if n is the ingress node of d,
-1 if n is the egress node of d and 0 otherwise).
|
DoubleMatrix2D |
getMatrixNodeDemandIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand incoming incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is terminated
in node n and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeDemandOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand outgoing incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is initiated
in node n and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeLinkAdjacency(NetworkLayer... optionalLayerParameter)
Returns the node-link adjacency matrix (a NxN matrix in which element δij is equals to the number of links from node i to node j.
|
DoubleMatrix2D |
getMatrixNodeLinkIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link incidence matrix (a NxE matrix in which element δne equals 1 if link e is initiated in node n, -1
if link e ends in node n, and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeLinkIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link incoming incidence matrix (a NxE matrix in which element δne equals 1 if link e is terminated in node n,
and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeLinkOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link outgoing incidence matrix (a NxE matrix in which element δne equals 1 if link e is initiated in node n,
and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeMulticastDemandAdjacency(NetworkLayer... optionalLayerParameter)
Returns a NxN matrix where each position accounts from the humber of multicast demands that node i (row) as ingress node and j (column) as an egress node.
|
DoubleMatrix2D |
getMatrixNodeMulticastDemandIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand incidence matrix (a NxD in which an element δnd equals 1 if n is the ingress node of d,
-1 if n is an egress node of d and 0 otherwise).
|
DoubleMatrix2D |
getMatrixNodeMulticastDemandIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand incoming incidence matrix (a NxD matrix in which element δnd equals 1 if multicast demand d is terminated
in node n and 0 otherwise.
|
DoubleMatrix2D |
getMatrixNodeMulticastDemandOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand outgoing incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is initiated
in node n and 0 otherwise.
|
DoubleMatrix2D |
getMatrixResource2NodeAssignment()
Returns a matrix with as many rows resources, and columns as nodes.
|
DoubleMatrix2D |
getMatrixResource2ResourceType(String type)
Returns a matrix with as many rows resources as resources of the given type (ordered in an arbitrary form),
and as many columns as resources in the network.
|
DoubleMatrix2D |
getMatrixResource2ResourceUpperToBaseAssignment()
Returns a matrix with as many rows and columns as resources.
|
DoubleMatrix2D |
getMatrixResource2ResourceUpperToBaseOccupation()
Returns a matrix with as many rows and columns as resources, coordinate (r1,r2) contains the capacity that resource r1 currently occupies
in r2.
|
DoubleMatrix2D |
getMatrixResource2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer,
coordinate (res,rou) contains the number times that route rou
traverses resource res.
|
Pair<List<Resource>,DoubleMatrix2D> |
getMatrixResource2RouteAssignment(String type,
NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer,
coordinate (res,rou) contains the number times that route rou
traverses resource res.
|
DoubleMatrix2D |
getMatrixResource2RouteOccupation(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer, and coordinate (res,rou) contains
the capacity occupied by route rou in resource res (note that if a route is down, its occupied capacity in a resource becomes zero).
|
DoubleMatrix2D |
getMatrixResource2SRGAssignment()
Returns a matrix with as many rows resources, and columns as SRGs.
|
DoubleMatrix2D |
getMatrixRoute2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns the route-srg incidence matrix (an RxS matrix in which an element δrs equals 1 if route r
fails when SRG s is affected.
|
DoubleMatrix2D |
getMatrixRouteFirstBackupRoute2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows as routes of the given layer, and as many
columns as SRGS.
|
MulticastDemand |
getMulticastDemand(int index,
NetworkLayer... optionalLayerParameter)
Returns the multicast demand with the given index in the given layer.
|
MulticastDemand |
getMulticastDemandFromId(long uid)
Returns the multicast demand with the given unique identifier.
|
ArrayList<Long> |
getMulticastDemandIds(NetworkLayer... optionalLayerParameter)
Returns the array of multicast demand ids for the given layer (i-th position, corresponds to index i).
|
List<MulticastDemand> |
getMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the list of multicast demands for the given layer (i-th position, corresponds to multicast demand with index i).
|
List<MulticastDemand> |
getMulticastDemandsBlocked(NetworkLayer... optionalLayerParameter)
Returns the multicast demands that have blocked traffic in the given layer.
|
MulticastTree |
getMulticastTree(int index,
NetworkLayer... optionalLayerParameter)
Returns the multicast tree with the given index in the given layer.
|
MulticastTree |
getMulticastTreeFromId(long uid)
Returns the multicast tree with the given unique identifier.
|
ArrayList<Long> |
getMulticastTreeIds(NetworkLayer... optionalLayerParameter)
Returns the array of multicast tree ids for the given layer (i-th position, corresponds to index i).
|
List<MulticastTree> |
getMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the array of multicast trees for the given layer (i-th position, corresponds to index i).
|
SortedSet<MulticastTree> |
getMulticastTreesDown(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that are down (i.e.
|
SortedSet<MulticastTree> |
getMulticastTreesTraversingZeroCapLinks(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that are down (i.e.
|
NetworkElement |
getNetworkElement(long id)
Return the network element with the given unique id.
|
static NetworkElement |
getNetworkElementByAttribute(Collection<? extends NetworkElement> listOfElements,
String attribute,
String value)
Returns the first network element among the ones passed as input parameters, that has the given key-value as attribute.
|
long |
getNetworkElementNextId()
Returns the next identifier for a new network element (layer, node, link, demand...)
|
static Collection<? extends NetworkElement> |
getNetworkElementsByAttribute(Collection<? extends NetworkElement> listOfElements,
String attribute,
String value)
Returns all the network elements among the ones passed as input parameters, that have the given key-value as attribute.
|
NetworkLayer |
getNetworkLayer(int index)
Returns the network layer with the given unique identifier.
|
NetworkLayer |
getNetworkLayer(String name)
Returns the network layer with the given name.
|
NetworkLayer |
getNetworkLayerDefault()
Return the default network layer.
|
NetworkLayer |
getNetworkLayerFromId(long uid)
Returns the network layer with the given unique identifier.
|
ArrayList<Long> |
getNetworkLayerIds()
Returns the array of layer ids (i-th position, corresponds to index i).
|
List<NetworkLayer> |
getNetworkLayerInTopologicalOrder()
Returns network layers in bottom-up order, that is, starting from the
lower layers to the upper layers following coupling relationships.
|
List<NetworkLayer> |
getNetworkLayers()
Returns the array of network layers (i-th position, corresponds to index i).
|
Node |
getNode(int index)
Returns the node with the given index.
|
Node |
getNodeByName(String name)
Returns the first node with the given name.
|
List<Node> |
getNodeByNameAllNodes(String name)
Returns a list with all the nodes with the given name, or an empty list if none.
|
Node |
getNodeFromId(long uid)
Returns the node with the given unique identifier.
|
ArrayList<Long> |
getNodeIds()
Returns the array of node ids (i-th position, corresponds to index i)
|
SortedSet<Demand> |
getNodePairDemands(Node originNode,
Node destinationNode,
boolean returnDemandsInBothDirections,
NetworkLayer... optionalLayerParameter)
Gets the set of demands at the given layer from the input nodes (if
returnDemandsInBothDirections is true , also the reversed links are included). |
double |
getNodePairEuclideanDistance(Node originNode,
Node destinationNode)
Gets the Euclidean distance for a node pair.
|
double |
getNodePairHaversineDistanceInKm(Node originNode,
Node destinationNode)
Gets the Haversine distance for a node pair.
|
SortedSet<Link> |
getNodePairLinks(Node originNode,
Node destinationNode,
boolean returnLinksInBothDirections,
NetworkLayer... optionalLayerParameter)
Gets the set of links at the given layer from the given nodes (if
returnLinksInBothDirections is true , also the reversed links are included). |
SortedSet<Route> |
getNodePairRoutes(Node originNode,
Node destinationNode,
boolean returnRoutesInBothDirections,
NetworkLayer... optionalLayerParameter)
Gets the set of routes at the given layer from the given nodes (if
returnRoutesInBothDirections is true , also the reversed routes are included). |
List<Node> |
getNodes()
Returns the array of nodes (i-th position, corresponds to index i).
|
SortedSet<Node> |
getNodesDown()
Returns the set of nodes that are down (iteration order corresponds to ascending order of indexes).
|
SortedSet<Node> |
getNodesUp()
Returns the set of nodes that are up (iteration order correspond to ascending order of indexes).
|
int |
getNumberOfDemands(NetworkLayer... optionalLayerParameter)
Returns the number of demands at the given layer.
|
int |
getNumberOfForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the number of non-zero forwarding rules at the given layer.
|
int |
getNumberOfLayers()
Returns the number of layers defined.
|
int |
getNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns the number of links at the given layer.
|
int |
getNumberOfMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the number of multicast demands at the given layer.
|
int |
getNumberOfMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the number of multicast trees at the given layer.
|
int |
getNumberOfNodePairs()
Returns the number of node pairs.
|
int |
getNumberOfNodes()
Returns the number of network nodes,
|
int |
getNumberOfResources()
Returns the number of resources (Resource) defined
|
int |
getNumberOfRoutes(NetworkLayer... optionalLayerParameter)
Returns the number of routes at the given layer.
|
int |
getNumberOfSRGs()
Returns the number of shared risk groups (SRGs) defined
|
String |
getPlotNodeLayoutCurrentlyActive()
Returns the name (identifier) of the current node layout
|
String |
getPlotNodeLayoutDefaultLayoutName()
Returns the name of the default node layout (this is a constant).
|
Resource |
getResource(int index)
Returns the resource with the given index
|
Resource |
getResourceFromId(long uid)
Returns the resource with the given unique identifier.
|
ArrayList<Long> |
getResourceIds()
Returns the array of resource ids (i-th position, corresponds to index i)
|
List<Resource> |
getResources()
Returns the array of resources (i-th position, corresponds to index i).
|
SortedSet<Resource> |
getResources(String type)
Returns the set of resources in the network for the given type.
|
SortedSet<Resource> |
getResourcesAttachedToAnyNode()
Returns the set of resources which are attached to any node (that is, not unattached)
|
Route |
getRoute(int index,
NetworkLayer... optionalLayerParameter)
Returns the route with the given index in the given layer.
|
Route |
getRouteFromId(long uid)
Returns the route with the given unique identifier.
|
ArrayList<Long> |
getRouteIds(NetworkLayer... optionalLayerParameter)
Returns the array of route ids for the given layer (i-th position, corresponds to index i).
|
List<Route> |
getRoutes(NetworkLayer... optionalLayerParameter)
Returns the array of route ids for the given layer (i-th position, corresponds to index i).
|
List<Route> |
getRoutesAreBackup(NetworkLayer... optionalLayerParameter)
Returns the list of routes which are not backup of any other route
|
List<Route> |
getRoutesAreNotBackup(NetworkLayer... optionalLayerParameter)
Returns the list of routes which are backup of any other route
|
SortedSet<Route> |
getRoutesDown(NetworkLayer... optionalLayerParameter)
Returns the set of routes that are down (traverse a link or node that is failed).
|
SortedSet<Route> |
getRoutesTraversingZeroCapacityLinks(NetworkLayer... optionalLayerParameter)
Returns the set of routes that are traversing a link with zero capacity.
|
SortedSet<String> |
getSiteNames()
Returns the set of all site names defined in the network
|
SortedSet<Node> |
getSiteNodes(String siteName)
Given a site name, returns the set of nodes associated to that site, or an empty set if none
|
SharedRiskGroup |
getSRG(int index)
Returns the shared risk group with the given index
|
SharedRiskGroup |
getSRGFromId(long uid)
Returns the shared risk group with the given unique identifier.
|
ArrayList<Long> |
getSRGIds()
Returns the array of shared risk group ids (i-th position, corresponds to index i)
|
List<SharedRiskGroup> |
getSRGs()
Returns the array of shared risk groups (i-th position, corresponds to index i).
|
SortedSet<SharedRiskGroup> |
getSrgsDynamic()
Returns the set of Srgs that are dynamically calculated
|
SortedSet<Demand> |
getTaggedDemands(String tag,
NetworkLayer... optionalLayerParameter)
Returns the set of demands in the given layer with the given tag.
|
SortedSet<NetworkLayer> |
getTaggedLayers(String tag)
Returns the set of layers with the given tag.
|
SortedSet<Link> |
getTaggedLinks(String tag,
NetworkLayer... optionalLayerParameter)
Returns the set of links in the given layer with the given tag.
|
SortedSet<MulticastDemand> |
getTaggedMulticastDemands(String tag,
NetworkLayer... optionalLayerParameter)
Returns the set of multicast demands in the given layer with the given tag.
|
SortedSet<MulticastTree> |
getTaggedMulticastTrees(String tag,
NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees in the given layer with the given tag.
|
SortedSet<Node> |
getTaggedNodes(String tag)
Returns the set of nodes with the given tag.
|
SortedSet<Resource> |
getTaggedResources(String tag)
Returns the set of resources with the given tag.
|
SortedSet<Route> |
getTaggedRoutes(String tag,
NetworkLayer... optionalLayerParameter)
Returns the set of routes in the given layer with the given tag.
|
SortedSet<SharedRiskGroup> |
getTaggedSrgs(String tag)
Returns the set of SRGs with the given tag.
|
SortedSet<Resource> |
getUnattachedResources()
Returns the set of resources which are not attached to any node
|
DoubleMatrix1D |
getVectorAttributeValues(Collection<? extends NetworkElement> collection,
String attributeKey)
Retuns a vector with the values of all given network elements for the given attribute key.
|
DoubleMatrix1D |
getVectorDemandBlockedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the blocked traffic per demand, at the given layer.
|
DoubleMatrix1D |
getVectorDemandCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per demand, at the given layer.
|
DoubleMatrix1D |
getVectorDemandOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per demand, at the given layer.
|
DoubleMatrix1D |
getVectorDemandTraversesOversubscribedLink(NetworkLayer... optionalLayerParameter)
Returns a vector where each index equals the demand index and the value is 1 if said demand traverses oversubscrined links, 0 otherwise.
|
DoubleMatrix1D |
getVectorDemandWorseCasePropagationTimeInMs(NetworkLayer... optionalLayerParameter)
Returns the vector with the worst propagation time (in ms) per demand at the given layer.
|
DoubleMatrix1D |
getVectorLinkCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the capacity per link, at the given layer.
|
DoubleMatrix1D |
getVectorLinkCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the total carried traffic per link, at the given layer.
|
DoubleMatrix1D |
getVectorLinkLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with the length in km in the links, at the given layer.
|
DoubleMatrix1D |
getVectorLinkOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the total occupied capacity in the links, at the given layer.
|
DoubleMatrix1D |
getVectorLinkOversubscribedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the oversubscibed traffic (oversubscribed traffic being the sum of all carried traffic, minus the capacity, or 0 if such substraction is negative) in each link at the given layer.
|
DoubleMatrix1D |
getVectorLinkPropagationDelayInMiliseconds(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation delay in milliseconds in the links, at the given layer.
|
DoubleMatrix1D |
getVectorLinkPropagationSpeedInKmPerSecond(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation speed in km/s in the links, at the given layer.
|
DoubleMatrix1D |
getVectorLinkSpareCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the spare capacity (available minus occupied, or zero if oversubscribed) per link, at the given layer.
|
DoubleMatrix1D |
getVectorLinkUpState(NetworkLayer... optionalLayerParameter)
Returns a vector with the up/down state in the links (1 up, 0 down), at the given layer.
|
DoubleMatrix1D |
getVectorLinkUtilization(NetworkLayer... optionalLayerParameter)
Returns a vector with the utilization per link, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastDemandBlockedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the blocked traffic per multicast demand, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastDemandCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per multicast demand, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastDemandOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per multicast demand, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastDemandTraversesOversubscribedLink(NetworkLayer... optionalLayerParameter)
Returns the vector indicating wheter a multicast demnd traverses (1) or not (0) oversubscribes links at the given layer.
|
DoubleMatrix1D |
getVectorMulticastDemandWorseCasePropagationTimeInMs(NetworkLayer... optionalLayerParameter)
Returns the vector with the worst propagation time (in ms) per multicast demand at the given layer.
|
DoubleMatrix1D |
getVectorMulticastTreeAverageNumberOfHops(NetworkLayer... optionalLayerParameter)
Returns a vector with the avergage number of hops per multicast tree at the given layer.
|
DoubleMatrix1D |
getVectorMulticastTreeCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per multicast tree, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastTreeNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with the number of links per multicast tree, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastTreeOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the occupied capacity traffic per multicast tree, at the given layer.
|
DoubleMatrix1D |
getVectorMulticastTreeOfferedTrafficOfAssociatedMulticastDemand(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per multicast tree from its associated multicast demand, at the given layer.
|
DoubleMatrix1D |
getVectorNodeEgressUnicastTraffic(NetworkLayer... optionalLayerParameter)
Returns the vector with the total incoming offered traffic per node at the given layer.
|
DoubleMatrix1D |
getVectorNodeIngressUnicastTraffic(NetworkLayer... optionalLayerParameter)
Returns the vector with the total outgoing offered traffic per node at the given layer.
|
DoubleMatrix1D |
getVectorNodePopulation()
Returns a vector with the population of the nodes.
|
DoubleMatrix1D |
getVectorNodeUpState()
Returns a vector with the up/down state of the nodes (1 up, 0 down).
|
DoubleMatrix1D |
getVectorResourceCapacity()
Returns a vector with as many elements as resources, containing the capacity (in the own resource capacity units), for each resource.
|
DoubleMatrix1D |
getVectorResourceIsOfType(String type)
Returns a vector with as many elements as resources, containing a 1 in coordinate of index i if the resource of index i is of the given type, a 0 if not.
|
DoubleMatrix1D |
getVectorResourceOccupiedCapacity()
Returns a vector with as many elements as resources, containing the currently occupied capacity (in the own resource capacity units), for each resource.
|
DoubleMatrix1D |
getVectorResourceProcessingTimeInMs()
Returns a vector with as many elements as resources, containing the processing time in ms for the traversig traffic, for each resource.
|
DoubleMatrix1D |
getVectorRouteCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per route, at the given layer.
|
DoubleMatrix1D |
getVectorRouteFirstBackupRouteLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with one element per route, containing the length in km of the first defined backup path for such route.
|
DoubleMatrix1D |
getVectorRouteFirstBackupRouteNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with one element per route, containing the number of links of the first defined backup path for such route.
|
DoubleMatrix1D |
getVectorRouteLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with the length in km per route, at the given layer.
|
DoubleMatrix1D |
getVectorRouteNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with the number of links per route, at the given layer.
|
DoubleMatrix1D |
getVectorRouteOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the occupied capacity traffic per route, at the given layer.
|
DoubleMatrix1D |
getVectorRouteOfferedTrafficOfAssociatedDemand(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic (from its associated demand) per route at the given layer.
|
DoubleMatrix1D |
getVectorRoutePropagationDelayInMiliseconds(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation delay in seconds per route, at the given layer.
|
DoubleMatrix1D |
getVectorSRGAvailability()
Returns a vector with the availability per Shared Risk Group (SRG).
|
boolean |
hasDemands(NetworkLayer... optionalLayerParameter)
Returns
true if the network has one or more demands at the given layer. |
boolean |
hasForwardingRules(NetworkLayer... optionalLayerParameter)
Returns
true if the network has at least one non-zero forwarding rule splitting ratio in any demand-link pair, in the given layer. |
boolean |
hasLinks(NetworkLayer... optionalLayerParameter)
Returns
true if the network has one or more links at the given layer. |
boolean |
hasMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns
true if the network has one or more multicast demands at the given layer. |
boolean |
hasMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns
true if the network has one or more multicast trees at the given layer. |
boolean |
hasNodes()
Returns
true if the network has nodes. |
boolean |
hasResources()
Returns
true if the network has one or more resources (Resource) defined. |
boolean |
hasRoutes(NetworkLayer... optionalLayerParameter)
Returns
true if the network has one or moreroutes at the given layer. |
boolean |
hasSRGs()
Returns
true if the network has one or more shared risk groups (SRGs) defined. |
boolean |
hasUnicastRoutingLoops(NetworkLayer... optionalLayerParameter)
Returns
true if the network has at least one routing cycle at the given layer. |
boolean |
isDeepCopy(NetPlan np2)
Returns true if the given NetPlan object contains the same network than this, meaning that all the network elements
are a copy in every aspect.
|
boolean |
isLayerCouplingValid(NetworkLayer lowerLayer,
NetworkLayer upperLayer)
Indicates whether or not a further coupling between two layers would be valid.
|
boolean |
isModifiable() |
boolean |
isMulticastRoutingBifurcated(NetworkLayer... optionalLayerParameter)
Returns
true if in the given layer, the traffic of any multicast demand is carried by more than one multicast tree. |
boolean |
isMultilayer()
Returns
true if the network has more than one layer. |
boolean |
isSingleLayer()
Returns
true if the network has just one layer |
boolean |
isUnicastRoutingBifurcated(NetworkLayer... optionalLayerParameter)
Returns
true if in the given layer, the traffic of any demand is carried by more than one route (in SOURCE_ROUTING ),
or a node sends traffic of a demand to more than
one link (in HOP_BY_HOP_ROUTING ). |
boolean |
isUp(Collection<? extends NetworkElement> col)
Indicates whether or not a path, multicast tree or arbitrary collection of links and/or resources and/or nodes is up and belonging to this netPlan object (so they were not removed), and false otherwise
|
static NetPlan |
loadFromFile(File file)
Static factory method to get a
NetPlan object from a .n2p file. |
NetPlan |
mergeIntoThisDesign(NetPlan otherDesign)
Replaces the partition of the current design by this design.
|
void |
removeAllDemands(NetworkLayer... optionalLayerParameter)
Removes all the demands defined in the given layer.
|
void |
removeAllForwardingRules(NetworkLayer... optionalLayerParameter)
Removes all the forwarding rules in the given layer.
|
void |
removeAllLinks(NetworkLayer... optionalLayerParameter)
Removes all the links defined in the given layer.
|
void |
removeAllLinksUnused(double toleranceCapacityValueToConsiderUnusedLink,
NetworkLayer... optionalLayerParameter)
Removes all the unsused links (those whith lesser capacity than
toleranceCapacityValueToConsiderUnusedLink ) defined in the given layer. |
void |
removeAllMulticastDemands(NetworkLayer... optionalLayerParameter)
Removes all the multicast demands defined in the given layer.
|
void |
removeAllMulticastTrees(NetworkLayer... optionalLayerParameter)
Removes all the multicast trees defined in the given layer.
|
void |
removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree,
NetworkLayer... optionalLayerParameter)
Removes all the multicast trees carrying no traffic and occupying no link capacity (even in the no failure state) defined in the given layer.
|
void |
removeAllNetworkLayers()
Removes all the network layers (everything but the nodes and the SRGs).
|
void |
removeAllNodes()
Removes all the network nodes.
|
void |
removeAllResources()
Removes all the resources.
|
void |
removeAllRoutes(NetworkLayer... optionalLayerParameter)
Removes all the routes defined in the given layer.
|
void |
removeAllRoutesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedRoute,
NetworkLayer... optionalLayerParameter)
Removes all the routes defined in the given layer that do not carry traffic nor occupy link capacity in the given layer
(even in a no-failure state).
|
void |
removeAllSRGs()
Removes all the shared risk groups.
|
void |
removeAllUnicastRoutingInformation(NetworkLayer... optionalLayerParameter)
Removes all the routing information (unicast and multicast) for the given layer, irrespective of the routing type
setting.
|
void |
removeGlobalPlanningDomain(String planningDomain)
Removes a global planning domain, if no elements have it assigned, and there is left at least one planning domain
|
void |
removeNetworkLayer(NetworkLayer... optionalLayerParameter)
Removes a layer, and any associated link, demand, route, or forwarding rule.
|
void |
removePlotNodeLayout(String plotLayoutToRemove)
Removes the indicated layout, that cannot be the currently active layout, nor the default layout
|
void |
renameGlobalPlanningDomain(String oldName,
String newName)
Change globally the name of a planning domain, updating the information in all the elements
|
void |
reset()
Resets the state of the network to an empty
NetPlan . |
NetPlan |
restrictDesign(SortedSet<Node> selectedNodes)
First computes the nodes to keep in the planning: these are the selected nodes,
the nodes involved in the demands/mDemands between them in this layer,
the nodes involved in the links at this layer that carry traffic between the selected nodes,
and the nodes associated to the links/demands at lower layers,
that carry the traffic between the selected nodes in the given layer, or carry traffic
at lower layers, of the links at this layer between the selected nodes.
|
void |
saveToFile(File file)
Saves the current network plan to a given file.
|
void |
saveToOutputStream(OutputStream outputStream)
Saves the current network plan to a given output stream.
|
void |
setAllLinksFailureState(boolean setAsUp,
NetworkLayer... optionalLayerParameter)
Sets the failure state (up or down) for all the links in the given layer.
|
void |
setAllNodesFailureState(boolean setAsUp)
Sets the failure state (up or down) for all the nodes.
|
void |
setDemandTrafficUnitsName(String demandTrafficUnitsName,
NetworkLayer... optionalLayerParameter)
Sets the name of the units in which the offered traffic is measured (e.g.
|
double |
setForwardingRule(Demand demand,
Link link,
double splittingRatio)
Adds a new forwarding rule (or override an existing one), to the layer of the demand and link (must be in the same layer).
|
void |
setForwardingRules(Collection<Demand> demands,
Collection<Link> links,
Collection<Double> splittingFactors,
boolean removePreviousRulesAffectedDemands)
Adds a set of forwarding rules (or override existing ones).
|
void |
setForwardingRules(DoubleMatrix2D f_de,
Set<Demand> demandsToUpdate,
NetworkLayer... optionalLayerParameter)
Sets the forwarding rules for the given design, only for the demands that are hop-by-hop.
|
void |
setLinkCapacityUnitsName(String name,
NetworkLayer... optionalLayerParameter)
Sets the name of the units in which the link capacity is measured (e.g.
|
void |
setLinksAndNodesFailureState(Collection<Link> linksToSetAsUp,
Collection<Link> linksToSetAsDown,
Collection<Node> nodesToSetAsUp,
Collection<Node> nodesToSetAsDown)
Changes the failure state of the links and updates the routes/trees (they do not carry traffic nor occupy capacity), and hop-by-hop routing
(no traffic is forwarded in links down)
|
boolean |
setModifiableState(boolean isModifiable)
Sets the
NetPlan so it cannot be modified |
void |
setNetworkLayerDefault(NetworkLayer layer)
Sets the default network layer.
|
void |
setPlotNodeLayoutCurrentlyActive(String newCurrentPlotNodeLayout)
Returns all the names (identifiers) of the current node layout
|
void |
setRoutingFromDemandLinkCarriedTraffic(DoubleMatrix2D x_de,
boolean xdeValueAsFractionsRespectToDemandOfferedTraffic,
boolean removeCycles,
Set<Demand> demandsToSetRouting,
NetworkLayer... optionalLayerParameter)
Adds traffic routes (or forwarding rules, depending on the routing type) from demand-link routing at the given layer.
|
void |
setRoutingFromDestinationLinkCarriedTraffic(DoubleMatrix2D x_te,
boolean removeCycles,
NetworkLayer... optionalLayerParameter)
Adds traffic routes (or forwarding rules, depending on the routing type) from destination-link routing at the given layer.
|
void |
setRoutingTypeAllDemands(Constants.RoutingType newRoutingType,
NetworkLayer... optionalLayerParameter)
Sets the routing type at the given layer.
|
void |
setTrafficMatrix(DoubleMatrix2D trafficMatrix,
Constants.RoutingType routingTypeDemands,
NetworkLayer... optionalLayerParameter)
Sets the traffic demands at the given layer from a given traffic matrix, removing any previous
demand.
|
void |
setVectorAttributeValues(Collection<? extends NetworkElement> collection,
String attributeKey,
DoubleMatrix1D values)
Sets the given attributes values to all the given network elements.
|
void |
setVectorDemandOfferedTraffic(DoubleMatrix1D offeredTrafficVector,
NetworkLayer... optionalLayerParameter)
Sets the vector of the offered traffic per demand, at the given layer.
|
void |
setVectorLinkCapacity(DoubleMatrix1D linkCapacities,
NetworkLayer... optionalLayerParameter)
Sets the vector of the link capacities, at the given layer.
|
void |
setVectorMulticastDemandOfferedTraffic(DoubleMatrix1D offeredTrafficVector,
NetworkLayer... optionalLayerParameter)
Sets the vector of the offered traffic per multicast demand, at the given layer.
|
void |
setVectorMulticastTreeCarriedTrafficAndOccupiedLinkCapacities(DoubleMatrix1D carriedTraffic,
DoubleMatrix1D occupiedLinkCapacity,
NetworkLayer... optionalLayerParameter)
Sets the vector of the multicast trees carried traffics and occupied link capacities, at the given layer.
|
void |
setVectorRouteCarriedTrafficAndOccupiedLinkCapacities(DoubleMatrix1D carriedTraffic,
DoubleMatrix1D occupiedLinkCapacity,
NetworkLayer... optionalLayerParameter)
Sets the vector of the route carried traffics and occupied link capacities, at the given layer.
|
String |
toString()
Returns a
String representation of the network design. |
String |
toString(Collection<NetworkLayer> layers)
Returns a
String representation of the network design only for the
given layers. |
addTag, checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, compareTo, equals, getAttribute, getAttribute, getAttributeAsDouble, getAttributeAsDoubleList, getAttributeAsDoubleMatrix, getAttributeAsDoubleMatrix, getAttributeAsStringList, getAttributeAsStringMatrix, getAttributes, getDescription, getId, getIndex, getName, getNetPlan, getNeType, getTags, hasTag, removeAllAttributes, removeAttribute, removeTag, setAttribute, setAttribute, setAttributeAsNumberList, setAttributeAsNumberMatrix, setAttributeAsNumberMatrix, setAttributeAsStringList, setAttributeAsStringMatrix, setAttributeMap, setDescription, setName, wasRemoved
public static final String PLOTLAYTOUT_DEFAULTNODELAYOUTGUINAME
public static final String PLOTLAYTOUT_DEFAULTNODELAYOUTNAME
public NetPlan()
Default constructor. Creates an empty design
public NetPlan(File file)
Generates a new network design from a given .n2p
file.
file
- .n2p
filepublic NetPlan(InputStream inputStream)
Generates a new network design from an input stream.
inputStream
- Input streampublic Demand addDemand(Node ingressNode, Node egressNode, double offeredTraffic, Constants.RoutingType routingType, Map<String,String> attributes, NetworkLayer... optionalLayerParameter)
Adds a new traffic demand.
Important: Self-demands are not allowed.
ingressNode
- Ingress nodeegressNode
- Egress nodeofferedTraffic
- Offered traffic by this demand. It must be greater or equal than zeroattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueroutingType
- Routing typeoptionalLayerParameter
- Network layer to which add the demand (optional)public Pair<Demand,Demand> addDemandBidirectional(Node ingressNode, Node egressNode, double offeredTraffic, Constants.RoutingType routingType, Map<String,String> attributes, NetworkLayer... optionalLayerParameter)
Adds two demands, one in each direction,.
Important: Self-demands are not allowed.
ingressNode
- Identifier of the ingress nodeegressNode
- Identifier of the egress nodeofferedTraffic
- Offered traffic by this demand. It must be greater or equal than zeroattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueoptionalLayerParameter
- Network layer to which add the demand (optional)routingType
- Routing typeDemand
,
Pair
public List<Demand> addDemandsFromTrafficMatrix(DoubleMatrix2D trafficMatrix, Constants.RoutingType routingType, NetworkLayer... optionalLayerParameter)
Adds new traffic demands froma traffic matrix given as a DoubleMatrix2D
object. Previous demands are not removed.
trafficMatrix
- Traffix matrix where i-th row is the ingress node, the j-th column the egress node and each entry the offered trafficroutingType
- Routing typeoptionalLayerParameter
- Network layer to which to add the demands (optional)public void addGlobalPlanningDomain(String planningDomain)
planningDomain
- the name of the planning domainpublic NetworkLayer addLayer(String name, String description, String linkCapacityUnitsName, String demandTrafficUnitsName, URL defaultNodeIconURL, Map<String,String> attributes)
Adds a new layer.
name
- Layer name (null
means empty)description
- Layer description (null
means empty)linkCapacityUnitsName
- Textual description of link capacity units (null
means empty)demandTrafficUnitsName
- Textual description of demand traffic units (null
means empty)defaultNodeIconURL
- The URL of the default icon for the layer nodesattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valuepublic NetworkLayer addLayerFrom(NetworkLayer origin)
Creates a new layer and adds the links, routes etc. from the input layer. The number of nodes in the two designs must be the same (the unique ids may differ). Any coupling information in the origin layer is omitted. Links, demands, multicast demands, routes and multicast trees will have the same index within the layer in the origin and in the copied layers, but may have different unique ids.
origin
- Layer to be copiedNetworkLayer
,
Node
public Link addLink(Node originNode, Node destinationNode, double capacity, double lengthInKm, double propagationSpeedInKmPerSecond, Map<String,String> attributes, NetworkLayer... optionalLayerParameter)
Adds a new link.
Important: Self-links are not allowed.
originNode
- Link origin nodedestinationNode
- Link destination nodecapacity
- Link capacity. It must be greather or equal to zerolengthInKm
- Link length. It must be greater or equal than zero. Physical distance between node pais can be otainer through the getNodePairEuclideanDistance
(for Euclidean distance) or getNodePairHaversineDistanceInKm
(for airlinea distance) methods.propagationSpeedInKmPerSecond
- Link propagation speed in km/s. It must be greater than zero (Double.MAX_VALUE
means no propagation delay, a non-positive value is changed into
200000 km/seg, a typical speed of light in the wires)attributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueoptionalLayerParameter
- Network layer to which add the link (optional)Link
,
Node
public Pair<Link,Link> addLinkBidirectional(Node originNode, Node destinationNode, double capacity, double lengthInKm, double propagationSpeedInKmPerSecond, Map<String,String> attributes, NetworkLayer... optionalLayerParameter)
Adds two links, one in each direction.
Important: Self-links are not allowed.
originNode
- Link origin nodedestinationNode
- Link destination nodecapacity
- Link capacity. It must be greather or equal to zerolengthInKm
- Link length. It must be greater or equal than zero. Physical distance between node pais can be otainer through the getNodePairEuclideanDistance
(for Euclidean distance) or getNodePairHaversineDistanceInKm
(for airlinea distance) methods.propagationSpeedInKmPerSecond
- Link propagation speed in km/s. It must be greater than zero (Double.MAX_VALUE
means no propagation delay, a non-positive value is changed into
200000 km/seg, a typical speed of light in the wires)attributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueoptionalLayerParameter
- Network layer to which add the links (optional)Pair
object with the two newly created linksLink
,
Pair
,
Node
public MulticastDemand addMulticastDemand(Node ingressNode, Set<Node> egressNodes, double offeredTraffic, Map<String,String> attributes, NetworkLayer... optionalLayerParameter)
Adds a new multicast traffic demand.
Important: Ingress node cannot be also an egress node.
ingressNode
- Ingress nodeegressNodes
- Egress nodeofferedTraffic
- Offered traffic of the demand. It must be greater or equal than zeroattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueoptionalLayerParameter
- Network layer to which add the demand (optional)MulticastDemand
,
Node
public MulticastTree addMulticastTree(MulticastDemand demand, double carriedTraffic, double occupiedLinkCapacity, Set<Link> linkSet, Map<String,String> attributes)
Adds a new traffic multicast tree.
Important: Routing type must be SOURCE_ROUTING
.
demand
- Multi cast demand to be associated with the treecarriedTraffic
- Carried traffic. It must be greater or equal than zerooccupiedLinkCapacity
- Occupied link capacity. If -1, it will be assumed to be equal to the carried traffic. Otherwise, it must be greater or equal than zerolinkSet
- SortedSet
of links of the multicast treeattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueMulticastTree
,
MulticastDemand
,
Link
public void addMulticastTreesFromCandidateTreeList(SortedMap<MulticastDemand,List<SortedSet<Link>>> cpl)
Adds multiple multicast trees from a Candidate Tree list.
cpl
- SortedMap
where the keys are multicast demands and the values lists of link setsMulticastDemand
,
Link
public Node addNode(double xCoord, double yCoord, String name, Map<String,String> attributes)
Adds a new node to the network. Nodes are associated to all layers.
xCoord
- Node position in x-axisyCoord
- Node position in y-axisname
- Node name (null
will be converted to "Node " + node identifier)attributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueNode
public void addPlotNodeLayout(String newPlotNodeLayoutName)
newPlotNodeLayoutName
- the new layout idpublic Resource addResource(String type, String name, Optional<Node> hostNode, double capacity, String capacityMeasurementUnits, Map<Resource,Double> capacityIOccupyInBaseResource, double processingTimeToTraversingTrafficInMs, Map<String,String> attributes)
Adds a new Resource to the network. Resources are associated to a node, and have no layer associated to it.
type
- The resource typename
- The resource namehostNode
- The node hosting the resourcecapacity
- The capacity of the resourcecapacityMeasurementUnits
- The units in which the resource capacity is measuredcapacityIOccupyInBaseResource
- A map with a key per base resource (a resource in the same node in which this resource occupies capacity), and the value the capacity that this resource occupies in the base resource (key), in base resource capacity unitsprocessingTimeToTraversingTrafficInMs
- The time in ms that takes the traffic traverse this resourceattributes
- The resource attributespublic Route addRoute(Demand demand, double carriedTraffic, double occupiedLinkCapacity, List<Link> sequenceOfLinks, Map<String,String> attributes)
Adds a new traffic route
Important: Routing type must be SOURCE_ROUTING
.
demand
- Demand associated to the routecarriedTraffic
- Carried traffic. It must be greater or equal than zerooccupiedLinkCapacity
- Occupied link capacity, it must be greater or equal than zero.sequenceOfLinks
- Sequence of links traversed by the routeattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueRoute
,
Demand
,
Link
public void addRoutesAndBackupRoutesFromCandidate11PathList(SortedMap<Pair<Node,Node>,List<Pair<List<Link>,List<Link>>>> cpl11, NetworkLayer... optionalLayer)
cpl11
- a map with the path infooptionalLayer
- the layer (optional)public void addRoutesFromCandidatePathList(SortedMap<Pair<Node,Node>,List<List<Link>>> cpl, NetworkLayer... optionalLayer)
Adds multiples routes for each demand of the given layer, using the paths in an input Candidate Path List. The paths should use the links of the same layer
cpl
- SortedMap
where the keys are the node pairs and the values a list of sequence of links (each sequence is a route)optionalLayer
- the layer (optional)public Route addServiceChain(Demand demand, double carriedTraffic, List<Double> occupiedLinkAndResourceCapacities, List<? extends NetworkElement> sequenceOfLinksAndResources, Map<String,String> attributes)
Adds a new traffic service chain, which is a route which also traverses and occupied resources.
Important: Routing type must be SOURCE_ROUTING
.
demand
- Demand associated to the routecarriedTraffic
- Carried traffic. It must be greater or equal than zerooccupiedLinkAndResourceCapacities
- Occupied link capacity, it must be greater or equal than zero.sequenceOfLinksAndResources
- Sequence of Link and Resource objects defining the sequence traversed by the routeattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valuepublic SharedRiskGroup addSRG(double mttfInHours, double mttrInHours, Map<String,String> attributes)
Adds a new SRG.
mttfInHours
- Mean Time To Fail (in hours). Must be greater than zeromttrInHours
- Mean Time To Repair (in hours). Must be greater than zeroattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valueSharedRiskGroup
public SharedRiskGroup addSRGDynamic(double mttfInHours, double mttrInHours, String className, String dynamicInitializationString, Map<String,String> attributes)
Adds a new dynamic SRG. This is a SRG for which the set of links and nodes affected are dynamically computed everytime the get methods asking for them are called.
mttfInHours
- Mean Time To Fail (in hours). Must be greater than zeromttrInHours
- Mean Time To Repair (in hours). Must be greater than zeroclassName
- the name of the class implementing the dynamic SRG functionalitydynamicInitializationString
- the initialization string to be consumed by the dynami SRG implementationattributes
- SortedMap for user-defined attributes (null
means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute valuepublic void assignFrom(NetPlan netPlan)
Assigns the information from the input NetPlan
.
Important: A shadow copy is made, an the object netPlan used as parameter cannot be longer used,
since all their nodes, links etc. are now assigned to the returned object.
For having a deep copy of a net2plan object use copyFrom()
netPlan
- Network plan to be assignedpublic void checkCachesConsistency()
For debug purposes: Checks the consistency of the internal cache (nodes, srgs, resources, layers, links, demands, multicast demands, multicast trees, routes). If any inconsistency is found an exception is thrown.
public NetworkLayer checkContiguousPath(List<Link> links, NetworkLayer layer, Node originNode, Node destinationNode)
Checks that the input sequence of links belong to the same layer and follow a contiguous path. Throws an exception if the path is not contiguous or the sequence of links is empty.
links
- Sequence of linkslayer
- Network layeroriginNode
- Origin nodedestinationNode
- Destination nodepublic NetworkLayer checkInThisNetPlanOptionalLayerParameter(NetworkLayer... optionalLayer)
Checks if the given layer is valid and belongs to this NetPlan
design. Throws and exception if the input is invalid.
optionalLayer
- Network layer (optional)public DoubleMatrix1D checkMatrixDemandLinkCarriedTrafficFlowConservationConstraints(DoubleMatrix2D x_de, boolean xdeValueAsFractionsRespectToDemandOfferedTraffic, NetworkLayer... optionalLayerParameter)
Checks the flow conservation constraints, and returns the traffic carried per demand.
x_de
- Amount of traffic from demand d
(i-th row) transmitted through link e (j-th column) in traffic unitsxdeValueAsFractionsRespectToDemandOfferedTraffic
- If true
, x_de
values are measured as fractions [0,1] instead of traffic unitsoptionalLayerParameter
- Network layer (optional)public DoubleMatrix2D checkMatrixDestinationLinkCarriedTrafficFlowConservationConstraints(DoubleMatrix2D x_te, NetworkLayer... optionalLayerParameter)
Checks the flow conservation constraints, and returns the traffic carried per input output node pair.
x_te
- Amount of traffic targeted to node t
(i-th row) transmitted through link e (j-th column) in traffi unitsoptionalLayerParameter
- Network layer (optional)public SortedMap<MulticastDemand,List<SortedSet<Link>>> computeMulticastCandidatePathList(DoubleMatrix1D costs, String solverName, String solverLibraryName, double maxSolverTimeInSecondsPerTree, String... candidateTreeListParamValuePairs)
computeMulticastCandidatePathList
for the default layercosts
- see computeMulticastCandidatePathList
solverName
- see computeMulticastCandidatePathList
solverLibraryName
- see computeMulticastCandidatePathList
maxSolverTimeInSecondsPerTree
- see computeMulticastCandidatePathList
candidateTreeListParamValuePairs
- see computeMulticastCandidatePathList
computeMulticastCandidatePathList
public SortedMap<MulticastDemand,List<SortedSet<Link>>> computeMulticastCandidatePathList(NetworkLayer layer, DoubleMatrix1D linkCosts, String solverName, String solverLibraryName, double maxSolverTimeInSecondsPerTree, String... candidateTreeListParamValuePairs)
Adds multicast trees specified by those trees that satisfy the options described below. Existing multicast trees will not be removed.
The candidate tree list elaborated contains a set of multicast trees (each one is a set of links) computed for each multicast demand in the network. To compute it, a ILP formulation is solved for each new multicast tree. In general, for every multicast demand k trees are computed ranked according to its cost (weight) according to some link weights.
The computation of paths can be configured via "parameter=value"
options. There are several options to
configure, which can be combined:
K
: Number of desired multicast trees per demand (default: 3). If K'<K
different trees are found for the multicast demand, then only K' are
included in the candidate listmaxCopyCapability
: the maximum number of copies of an input traffic a node can make. Then, a node can have at most this number of ouput links carrying traffic of a multicast tree (default: Double.MAX_VALUE)maxE2ELengthInKm
: Maximum path length measured in kilometers allowed for any tree, from the origin node, to any destination node (default: Double.MAX_VALUE)maxE2ENumHops
: Maximum number of hops allowed for any tree, from the origin node, to any destination node (default: Integer.MAX_VALUE)maxE2EPropDelayInMs
: Maximum propagation delay in miliseconds allowed in a path, for any tree, from the origin node, to any destination node (default: Double.MAX_VALUE)maxTreeCost
: Maximum tree weight allowed, summing the weights of the links (default: Double.MAX_VALUE)maxTreeCostFactorRespectToMinimumCostTree
: Trees with higher weight (cost) than the cost of the minimum cost tree, multiplied by this factor, are not returned (default: Double.MAX_VALUE)maxTreeCostRespectToMinimumCostTree
: Trees with higher weight (cost) than the cost of the minimum cost tree, plus this factor, are not returned (default: Double.MAX_VALUE). While the previous one is a multiplicative factor, this one is an additive factorlayer
- the layer for which the candidate multicast tree list is computedlinkCosts
- Link weight vector for the shortest path algorithm. If null
, a vector of ones is assumedsolverName
- the name of the solver to call for the internal formulation of the algorithmsolverLibraryName
- the solver library namemaxSolverTimeInSecondsPerTree
- the maximum time the solver is allowed for each of the internal formulations (one for each new tree).
The best solution found so far is returned. If non-positive, no time limit is setcandidateTreeListParamValuePairs
- Parameters to be passed to the class to tune its operation. An even number of String
is to be passed. For each String
pair, first String
must be the name of the parameter, second a String
with its value. If no name-value pairs are set, default values are usedpublic DoubleMatrix1D computeMulticastTreeCostVector(double[] costs, NetworkLayer... optionalLayerParameter)
Returns an array with the cost of each multicast tree in the layer. The cost of a multicast tree is given by the sum
of the costs in its links, given by the provided cost vector. If the cost vector provided is null
,
all links have cost one.
costs
- Costs arrayoptionalLayerParameter
- Network layer (optional)MulticastTree
public DoubleMatrix1D computeRouteCostVector(double[] costs, NetworkLayer... optionalLayerParameter)
Returns an array with the cost of each route in the layer. The cost of a route is given by the sum
of the costs of its links, given by the provided cost vector. If the cost vector provided is null
,
all links have cost one.
costs
- Costs arrayoptionalLayerParameter
- Network layer (optional)Route
public static SortedMap<Pair<Node,Node>,List<Pair<List<Link>,List<Link>>>> computeUnicastCandidate11PathList(Map<Pair<Node,Node>,List<List<Link>>> cpl, int disjointType)
Computes a list of disjoint path pairs for each node pair, using the paths in the input candidate path list given.
cpl
- Candidate path list per demanddisjointType
- Type of disjointness: 0 for SRG-disjoint, 1 for link and node disjoint, other value means link disjointpublic static SortedMap<Demand,List<Pair<List<NetworkElement>,List<NetworkElement>>>> computeUnicastCandidate11ServiceChainList(SortedMap<Demand,List<List<NetworkElement>>> cpl, int disjointType)
Computes a list of disjoint service chain pairs for each demand (service chain requests), using the service chain paths in the input candidate path list given.
cpl
- Candidate path list per demanddisjointType
- Type of disjointness: 0 for SRG-disjoint, 1 for link and node disjoint, other value means link disjointpublic SortedMap<Pair<Node,Node>,List<List<Link>>> computeUnicastCandidatePathList(DoubleMatrix1D linkCosts, int K, double maxLengthInKm, int maxNumHops, double maxPropDelayInMs, double maxRouteCost, double maxRouteCostFactorRespectToShortestPath, double maxRouteCostRespectToShortestPath, SortedSet<Pair<Node,Node>> nodePairs, NetworkLayer... optionalLayerParameter)
Computes for all the node pairs, a candidate path list in the given layer, composed of the k shortest paths according with the options indicated below.
linkCosts
- the cost of each link (if null, all links have cost one), all numbers must be strictly positiveK
- Desired nummber of paths (a lower number of paths may be returned if there are less than K
loop-less paths admissible)maxLengthInKm
- Maximum length of the path. If non-positive, no maximum limit is assumedmaxNumHops
- Maximum number of hops. If non-positive, no maximum limit is assumedmaxPropDelayInMs
- Maximum propagation delay of the path. If non-positive, no maximum limit is assumedmaxRouteCost
- Maximum route cost. If non-positive, no maximum limit is assumedmaxRouteCostFactorRespectToShortestPath
- Maximum route cost factor respect to the shortest path. If non-positive, no maximum limit is assumedmaxRouteCostRespectToShortestPath
- Maximum route cost respect to the shortest path. If non-positive, no maximum limit is assumednodePairs
- if this parameter is not null, the paths are computed only for this node pairsoptionalLayerParameter
- the layer (optional)public SortedMap<Demand,List<List<NetworkElement>>> computeUnicastCandidateServiceChainList(DoubleMatrix1D linkCosts, DoubleMatrix1D resourceCosts, int K, double maxCostServiceChain, double maxLengthInKmPerSubpath, int maxNumHopsPerSubpath, double maxPropDelayInMsPerSubpath, NetworkLayer... optionalLayerParameter)
linkCosts
- the cost of each link (if null, all links have cost one), all numbers must be strictly positiveresourceCosts
- a vector with the cost of each resource (if null, all resources have cost zero). All costs must be nonnegative. If a resource has a cost of Double.MAX_VALUE, it is as if it did not existed (cannot be traversed)K
- The maximum number of service chains to return (less than K may be returned if there are no different paths).maxCostServiceChain
- Service chains with a cost higher than this are not enumeratedmaxLengthInKmPerSubpath
- The maximum length in km in each subpath. Service chains not satisfying this are not enumeratedmaxNumHopsPerSubpath
- The maximum number of traversed links in each subpath. Service chains not satisfying this are not enumeratedmaxPropDelayInMsPerSubpath
- The propagation delay summing the links in each subpath. Service chains not satisfying this are not enumeratedoptionalLayerParameter
- the optional layer parameterpublic NetPlan copy()
Returns a deep copy of the current design.
public void copyFrom(NetPlan originNetPlan)
Removes all information from the current NetPlan
and copy the information from the input NetPlan
.
originNetPlan
- Network plan to be copied frompublic SortedMap<Link,SortedMap<String,Pair<Double,Double>>> getAllLinksPerQosOccupationAndQosViolationMap(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- see abovepublic SortedSet<String> getAllPlotNodeLayoutsDefined()
public static SortedMap<NetworkElement,String> getAttributes(Collection<? extends NetworkElement> collection, String attribute)
Returns the values of a given attribute for all the provided network elements.
collection
- Collection of network elementsattribute
- Attribute namenull
if not definedNetworkElement
public static DoubleMatrix1D getAttributeValues(Collection<? extends NetworkElement> collection, String attributeName, double defaultValue)
Returns the values of a given attribute for all the provided network elements, as a DoubleMatrix1D
vector.
collection
- Collection of network elementsattributeName
- Attribute namedefaultValue
- If an element has value for the attribute, or it is not a double (it fails in the Double.parseDouble
conversion), then this value is setNetworkElement
, in the same order as the input Collection
.NetworkElement
public Demand getDemand(int index, NetworkLayer... optionalLayerParameter)
Returns the demand with the given index.
index
- Demand indexoptionalLayerParameter
- Network layer (optional)null
if nonexistent, index lower than 0 or greater than the number of elements minus one)Demand
public Demand getDemandFromId(long uid)
Returns the demand with the given unique identifier.
uid
- Demand unique idnull
if nonexistent)Demand
public ArrayList<Long> getDemandIds(NetworkLayer... optionalLayerParameter)
Returns the array of demand unique ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is used.
optionalLayerParameter
- Network layer (optional)Demand
public List<Demand> getDemands(NetworkLayer... optionalLayerParameter)
Returns the array of demands for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is used.
optionalLayerParameter
- Network layer (optional)Demand
public List<Demand> getDemandsBlocked(NetworkLayer... optionalLayerParameter)
Returns the demands that have blocked traffic in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)Demand
public SortedSet<Demand> getDemandsCoupled(NetworkLayer... optionalLayerParameter)
Returns the set of unicast demands that are coupled.
optionalLayerParameter
- Network layer (optional)SortedSet
of unicast demands that have blocked traffic for the given layer (or the defaukt layer if no input was provided)public List<Demand> getDemandsHopByHopRouted(NetworkLayer... optionalLayerParameter)
Returns the array of demands in the given layer that are hop-by-hop routed, ordered by its index.
optionalLayerParameter
- Network layer (optional)public List<Demand> getDemandsSourceRouted(NetworkLayer... optionalLayerParameter)
Returns the array of demands in the given layer that are source routed, ordered by its index.
optionalLayerParameter
- Network layer (optional)public String getDemandTrafficUnitsName(NetworkLayer... optionalLayerParameter)
Returns the name of the traffic units of the demands of the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)String
with the traffic units name of the demandspublic double getForwardingRuleCarriedTraffic(Demand demand, Link link)
Returns the traffic that is carried using a forwarding rule, in the given layer. If no layer is provided, the default layer is assumed.
Important: Routing type must be HOP_BY_HOP_ROUTING
.
demand
- Outgoing demandlink
- Linkpublic SortedMap<Pair<Demand,Link>,Double> getForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the forwarding rules for the given layer. If no layer is provided, the default layer is assumed.
Important: Routing type must be HOP_BY_HOP_ROUTING
.
optionalLayerParameter
- Network layer (optional)Pair
public double getForwardingRuleSplittingFactor(Demand demand, Link link)
Returns the splitting factor of the forwarding rule of the given demand and link, which must be of the same layer.
demand
- Outgoing demandlink
- Linkpublic SortedSet<Node> getGlobalPlanningDomainNodes(String planningDomain)
planningDomain
- the planning domainpublic SortedSet<String> getGlobalPlanningDomains()
public static Collection<Long> getIds(Collection<? extends NetworkElement> collection)
Returns the unique ids of the provided network elements.
collection
- Network elementsCollection
is a SortedSet
, the returned collection is a TreeSet
. If the input
Collection
is a List
, an ArrayList
is returned}.public static Collection<Integer> getIndexes(Collection<? extends NetworkElement> collection)
Returns the indexes of the provided network elements.
collection
- Network elementsCollection
is a SortedSet
, the returned collection is a TreeSet
. If the input
Collection
is a List
, an ArrayList
is returned}.public Link getLink(int index, NetworkLayer... optionalLayerParameter)
Returns the link with the given index in the given layer. If no layer is provided, default layer is assumed.
index
- Link indexoptionalLayerParameter
- Network layer (optional)null
if it does not exist, index islower than 0, or greater than the number of links minus onepublic String getLinkCapacityUnitsName(NetworkLayer... optionalLayerParameter)
Returns the name of the capacity units of the links of the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public Link getLinkFromId(long uid)
Returns the link with the given unique identifier.
uid
- Link unique idnull
if it does not existpublic ArrayList<Long> getLinkIds(NetworkLayer... optionalLayerParameter)
Returns the array of link ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optionalpublic List<Link> getLinks(NetworkLayer... optionalLayerParameter)
Return a list of all the links in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Link> getLinksAreBottleneck(NetworkLayer... optionalLayerParameter)
Returns the set of links that are a bottleneck, i.e the fraction of occupied capacity respect to the total is highest. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of bottleneck linkspublic SortedSet<Link> getLinksCoupledToMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of links that are coupled to a multicast demand in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of links coupled to a multicast demandMulticastDemand
public SortedSet<Link> getLinksCoupledToUnicastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of links that are couple to a unicast demand in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of links coupled to a unicast demandDemand
public SortedSet<Link> getLinksDown(NetworkLayer... optionalLayerParameter)
Returns the set of links that are down in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of links that are downpublic SortedSet<Link> getLinksDownAllLayers()
Returns the set of links that are down in all layers.
SortedSet
of links downpublic SortedSet<Link> getLinksOversubscribed(NetworkLayer... optionalLayerParameter)
Returns the set of links oversuscribed: the total occupied capacity exceeds the link capacity. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of oversubscribed linkspublic SortedSet<Link> getLinksUp(NetworkLayer... optionalLayerParameter)
Returns the set of links that are up in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer )optional)SortedSet
of links that are uppublic SortedSet<Link> getLinksUpAllLayers()
Returns the set of links that are up in all layers.
SortedSet
of links that are uppublic SortedSet<Link> getLinksWithZeroCapacity(NetworkLayer... optionalLayerParameter)
Returns the set of links that have zero capacity in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)SortedSet
of links with zero capacitypublic DoubleMatrix2D getMatrixDemand2LinkAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-link incidence matrix (a DxE matrix in which an element δde is equal to the number of times which traffic routes carrying traffic from demand d traverse link e). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDemand2LinkTrafficCarried(SortedSet<Demand> demandsOfInterest, NetworkLayer... optionalLayerParameter)
Returns the demand-link incidence matrix (DxE in which an element δde is equal to the amount of traffic of each demand carried in each link). Rows and columns are in increasing order of demand and link identifiers, respectively. If no layer is provided, the default layer is assumed
Important: Routing type must be HOP_BY_HOP_ROUTING
.
demandsOfInterest
- List of demandsoptionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDemand2ResourceAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-resource incidence matrix, with as many rows as demands of the given layer, and a many colmns as resources, coordinate (d,r) equals the number of times that traffic routes of the demand d, traverse resource r. Demands that are hop-by-hop routed have zeros If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDemand2ResourceOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns the demand-resource matrix, with as many rows as demands of the given layer, and as many columns as resources, coordinate (d,r) is the resource capacity that demand d currently occupies in resource r (recall that failed routes do not occupy capacity in the traversed resources). If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDemand2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns the demand-route incidence matrix (a DxR matrix in which an element δdr is equal to 1 if traffic route r is able to carry traffic from demand d). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDemandBasedForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the splitting ratio matrix (fractions of traffic entering a node from demand 'd', leaving that node through link 'e'). Rows and columns are in increasing order of demand and link identifiers, respectively. If no layer is provided, the default layer is assumed. For the demands that are SOURCE ROUTING, the routes are internally converted into forwarding rules, using the carried traffic of the routes (the link occupation information is not used)
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixDestination2LinkTrafficCarried(NetworkLayer... optionalLayerParameter)
public DoubleMatrix2D getMatrixDestinationBasedForwardingRules(NetworkLayer... optionalLayer)
A destination-based routing in the form of fractions fte (fraction of the traffic targeted to node t that arrives (or is generated in) node a(e) (the initial node of link e), that is forwarded through link e). If no layer is provided, the default layer is assumed.
optionalLayer
- Network layer (optional)public DoubleMatrix2D getMatrixLink2LinkBidirectionalityMatrix(NetworkLayer... optionalLayerParameter)
Returns the link-link bidirectionality matrix (a ExE matrix where the element δee' equals 1 when each position e and e' represent a bidirectional link at the given layer. If no layer is provided, default layer is assumed
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixLink2MulticastTreeAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-multicast incidence matrix (an ExT matrix in which an element δet is equal to the number of times a multicast tree t traverse link e. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixLink2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-route incidence matrix (an ExR matrix in which an element δep is equal to the number of times which traffic route r traverses link e). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixLink2RouteFirstBackupRouteAssignment(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixLink2SRGAssignment(NetworkLayer... optionalLayerParameter)
Returns the link-srg assignment matrix (an ExS matrix in which an element δes equals 1 if link e fails when SRG s is affected. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixMulticastDemand2LinkAssignment(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-link incidence matrix (a DxE matrix in which an element δde is equal to the number of times which multicast trees carrying traffic from demand d traverse link e). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixMulticastDemand2LinkTrafficCarried(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-link incidence matrix (DxE in which an element δde is equal to the amount of traffic of each multicast demand carried in each link). Rows and columns are in increasing order of demand and link identifiers, respectively. If no layer is provided, the default layer is assumed
Important: Routing type must be HOP_BY_HOP_ROUTING
.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixMulticastDemand2MulticastTreeAssignment(NetworkLayer... optionalLayerParameter)
Returns the multicast demand-multicast tree incidence matrix (a DxT matrix in which an element δdt is equal to 1 if multicast tree t is able to carry traffic from multicast demand d). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixMulticastTree2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns the multicast tree-srg incidence matrix (an TxS matrix in which an element δts equals 1 when multicast tree t fails when SRG s is affected. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNode2NodeEuclideanDistance()
Returns the NxN Euclidean distance matrix (derived from node coordinates), where N is the number of nodes within the network.
public DoubleMatrix2D getMatrixNode2NodeHaversineDistanceInKm()
Returns the NxN Haversine distance matrix (derived from node coordinates, where 'xCoord' is equal to longitude and 'yCoord' is equal to latitude), where N is the number of nodes within the network.
public DoubleMatrix2D getMatrixNode2NodeOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the traffic matrix, where rows and columns represent the ingress node and the egress node, respectively, in increasing order of identifier. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeDemandAdjacency(NetworkLayer... optionalLayerParameter)
Returns a NxN matrix where each position accounts from the humber of demands that node i (row) as ingress node and j (column) as egress node. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeDemandIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand incidence matrix (a NxD in which an element δnd equals 1 if n is the ingress node of d, -1 if n is the egress node of d and 0 otherwise). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layerpublic DoubleMatrix2D getMatrixNodeDemandIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand incoming incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is terminated in node n and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeDemandOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-demand outgoing incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is initiated in node n and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeLinkAdjacency(NetworkLayer... optionalLayerParameter)
Returns the node-link adjacency matrix (a NxN matrix in which element δij is equals to the number of links from node i to node j. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeLinkIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link incidence matrix (a NxE matrix in which element δne equals 1 if link e is initiated in node n, -1 if link e ends in node n, and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeLinkIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link incoming incidence matrix (a NxE matrix in which element δne equals 1 if link e is terminated in node n, and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeLinkOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-link outgoing incidence matrix (a NxE matrix in which element δne equals 1 if link e is initiated in node n, and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeMulticastDemandAdjacency(NetworkLayer... optionalLayerParameter)
Returns a NxN matrix where each position accounts from the humber of multicast demands that node i (row) as ingress node and j (column) as an egress node. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeMulticastDemandIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand incidence matrix (a NxD in which an element δnd equals 1 if n is the ingress node of d, -1 if n is an egress node of d and 0 otherwise). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layerpublic DoubleMatrix2D getMatrixNodeMulticastDemandIncomingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand incoming incidence matrix (a NxD matrix in which element δnd equals 1 if multicast demand d is terminated in node n and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixNodeMulticastDemandOutgoingIncidence(NetworkLayer... optionalLayerParameter)
Returns the node-multicast demand outgoing incidence matrix (a NxD matrix in which element δnd equals 1 if demand d is initiated in node n and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixResource2NodeAssignment()
Returns a matrix with as many rows resources, and columns as nodes. Coordinate (res,n) is 1 if resource res is hosted in node n
public DoubleMatrix2D getMatrixResource2ResourceType(String type)
Returns a matrix with as many rows resources as resources of the given type (ordered in an arbitrary form), and as many columns as resources in the network. It is constructed by taking the diagonal matrix, and keeping only the rows associated to resources of the given type. When left multiplied to a matrix with as many rows as resources, it keeps the rows associated to the resources of the given type, removing the rest.
type
- the resource typepublic DoubleMatrix2D getMatrixResource2ResourceUpperToBaseAssignment()
Returns a matrix with as many rows and columns as resources. Coordinate (r1,r2) is 1 if r1 is an upper resource respect to r2, even if currently 0 capacity units are occupied in base resource r2 because of r1
public DoubleMatrix2D getMatrixResource2ResourceUpperToBaseOccupation()
Returns a matrix with as many rows and columns as resources, coordinate (r1,r2) contains the capacity that resource r1 currently occupies in r2. If r2 is not a base resource of r1, coordinate is zero
public DoubleMatrix2D getMatrixResource2RouteAssignment(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer, coordinate (res,rou) contains the number times that route rou traverses resource res. If no layer is provided, default layer is assumed
optionalLayerParameter
- the layer (optional)public Pair<List<Resource>,DoubleMatrix2D> getMatrixResource2RouteAssignment(String type, NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer, coordinate (res,rou) contains the number times that route rou traverses resource res. If no layer is provided, default layer is assumed
type
- The resource typeoptionalLayerParameter
- the layer (optional)public DoubleMatrix2D getMatrixResource2RouteOccupation(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows resources, and columns as routes in the given layer, and coordinate (res,rou) contains the capacity occupied by route rou in resource res (note that if a route is down, its occupied capacity in a resource becomes zero). If no layer is provided, default layer is assumed
optionalLayerParameter
- the layer (optional)public DoubleMatrix2D getMatrixResource2SRGAssignment()
Returns a matrix with as many rows resources, and columns as SRGs. Coordinate (res,srg) is 1 if resource res fails when srg fails
public DoubleMatrix2D getMatrixRoute2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns the route-srg incidence matrix (an RxS matrix in which an element δrs equals 1 if route r fails when SRG s is affected. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix2D getMatrixRouteFirstBackupRoute2SRGAffecting(NetworkLayer... optionalLayerParameter)
Returns a matrix with as many rows as routes of the given layer, and as many columns as SRGS. The position (r,s) is 1 if the first backup route defined for route r is affected by SRG s (fails if s fails), and 0 otherwise. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public MulticastDemand getMulticastDemand(int index, NetworkLayer... optionalLayerParameter)
Returns the multicast demand with the given index in the given layer. If no layer is provided, default layer is assumed.
index
- Multicast demand indexoptionalLayerParameter
- Network layer (optional)null
if it does not exist, or index is lower than 0, or greater the number of elements minus one).public MulticastDemand getMulticastDemandFromId(long uid)
Returns the multicast demand with the given unique identifier.
uid
- Multicast demand unique idnull
if it does not existpublic ArrayList<Long> getMulticastDemandIds(NetworkLayer... optionalLayerParameter)
Returns the array of multicast demand ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)ArrayList
of multicast demand unique idspublic List<MulticastDemand> getMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the list of multicast demands for the given layer (i-th position, corresponds to multicast demand with index i). If no layer is provided, the default layer is used
optionalLayerParameter
- Network layer (optional)public List<MulticastDemand> getMulticastDemandsBlocked(NetworkLayer... optionalLayerParameter)
Returns the multicast demands that have blocked traffic in the given layer. If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layer (optional)public MulticastTree getMulticastTree(int index, NetworkLayer... optionalLayerParameter)
Returns the multicast tree with the given index in the given layer. if no layer is provided, default layer is assumed.
index
- Multicast tree indexoptionalLayerParameter
- Network layer (optional)null
if it does not exist, index islower than 0, or greater than the number of elements minus one)public MulticastTree getMulticastTreeFromId(long uid)
Returns the multicast tree with the given unique identifier.
uid
- Multicast tree unique idnull
if it does not existpublic ArrayList<Long> getMulticastTreeIds(NetworkLayer... optionalLayerParameter)
Returns the array of multicast tree ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)ArrayList
of multicast trees unique idspublic List<MulticastTree> getMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the array of multicast trees for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)List
of multicast treespublic SortedSet<MulticastTree> getMulticastTreesDown(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that are down (i.e. that traverse a link or node that has failed).
optionalLayerParameter
- Network layer (optional)SortedSet
of multicast trees that are downpublic SortedSet<MulticastTree> getMulticastTreesTraversingZeroCapLinks(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that are down (i.e. that traverse a link or node that has failed).
optionalLayerParameter
- Network layer (optional)SortedSet
of multicast trees that are downpublic NetworkElement getNetworkElement(long id)
Return the network element with the given unique id.
id
- Unique idnull
if it does not exist)NetworkElement
public static NetworkElement getNetworkElementByAttribute(Collection<? extends NetworkElement> listOfElements, String attribute, String value)
Returns the first network element among the ones passed as input parameters, that has the given key-value as attribute.
listOfElements
- Lit of network elementsattribute
- Attribute namevalue
- Attribute valuenull
if no network element matches or the input null
or emptyNetworkElement
public long getNetworkElementNextId()
public static Collection<? extends NetworkElement> getNetworkElementsByAttribute(Collection<? extends NetworkElement> listOfElements, String attribute, String value)
Returns all the network elements among the ones passed as input parameters, that have the given key-value as attribute. Returns an empty list if no network element mathces this, the input list of elements is null or empty
listOfElements
- List of network elementsattribute
- Attribute namevalue
- Attribute valuepublic NetworkLayer getNetworkLayer(int index)
Returns the network layer with the given unique identifier.
index
- Network layer indexnull
if it does not exist)public NetworkLayer getNetworkLayer(String name)
Returns the network layer with the given name.
name
- Network layer namenull
if it does not exist)public NetworkLayer getNetworkLayerDefault()
Return the default network layer.
public NetworkLayer getNetworkLayerFromId(long uid)
Returns the network layer with the given unique identifier.
uid
- Network layer unique idnull
if it does not exist)public ArrayList<Long> getNetworkLayerIds()
Returns the array of layer ids (i-th position, corresponds to index i).
ArraList
of network layerspublic List<NetworkLayer> getNetworkLayerInTopologicalOrder()
Returns network layers in bottom-up order, that is, starting from the lower layers to the upper layers following coupling relationships. For layers at the same hierarchical level, no order is guaranteed.
SortedSet
of network layers in topological orderpublic List<NetworkLayer> getNetworkLayers()
Returns the array of network layers (i-th position, corresponds to index i).
List
of network layerspublic Node getNode(int index)
Returns the node with the given index.
index
- Node indexnull
if it does not exist, index iss lesser than zero or greater than the number of elements minus one)public Node getNodeByName(String name)
Returns the first node with the given name.
name
- Node namenull
if it does not exist)public List<Node> getNodeByNameAllNodes(String name)
Returns a list with all the nodes with the given name, or an empty list if none.
name
- Node namepublic Node getNodeFromId(long uid)
Returns the node with the given unique identifier.
uid
- Node unique idnull
if it does not exist)public ArrayList<Long> getNodeIds()
Returns the array of node ids (i-th position, corresponds to index i)
ArrayList
of nodespublic SortedSet<Demand> getNodePairDemands(Node originNode, Node destinationNode, boolean returnDemandsInBothDirections, NetworkLayer... optionalLayerParameter)
Gets the set of demands at the given layer from the input nodes (if returnDemandsInBothDirections
is true
, also the reversed links are included). If no layer is provided, the default layer is assumed.
originNode
- Origin nodedestinationNode
- Destination nodereturnDemandsInBothDirections
- Assume both directionsoptionalLayerParameter
- network layer (optional)SortedSet
of demands that have the origin and destination for the given inputpublic double getNodePairEuclideanDistance(Node originNode, Node destinationNode)
Gets the Euclidean distance for a node pair.
originNode
- Origin nodedestinationNode
- Destination nodepublic double getNodePairHaversineDistanceInKm(Node originNode, Node destinationNode)
Gets the Haversine distance for a node pair.
originNode
- Origin nodedestinationNode
- Destination nodepublic SortedSet<Link> getNodePairLinks(Node originNode, Node destinationNode, boolean returnLinksInBothDirections, NetworkLayer... optionalLayerParameter)
Gets the set of links at the given layer from the given nodes (if returnLinksInBothDirections
is true
, also the reversed links are included). If no layer is provided, the default layer is assumed.
originNode
- Origin nodedestinationNode
- Destination nodereturnLinksInBothDirections
- Include links in both directionoptionalLayerParameter
- Network layer (optional)SortedSet
of links between a pair of nodespublic SortedSet<Route> getNodePairRoutes(Node originNode, Node destinationNode, boolean returnRoutesInBothDirections, NetworkLayer... optionalLayerParameter)
Gets the set of routes at the given layer from the given nodes (if returnRoutesInBothDirections
is true
, also the reversed routes are included).
If no layer is provided, the default layer is assumed.
originNode
- Origin nodedestinationNode
- Destination nodereturnRoutesInBothDirections
- Include routes in both directionsoptionalLayerParameter
- Network layer (optional)SortedSet
of routes between a pair of nodespublic List<Node> getNodes()
Returns the array of nodes (i-th position, corresponds to index i).
List
of nodespublic SortedSet<Node> getNodesDown()
Returns the set of nodes that are down (iteration order corresponds to ascending order of indexes).
SortedSet
of nodes that are downpublic SortedSet<Node> getNodesUp()
Returns the set of nodes that are up (iteration order correspond to ascending order of indexes).
SortedSet
of nodes that are uppublic int getNumberOfDemands(NetworkLayer... optionalLayerParameter)
Returns the number of demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)public int getNumberOfForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the number of non-zero forwarding rules at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)public int getNumberOfLayers()
Returns the number of layers defined.
public int getNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns the number of links at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layerpublic int getNumberOfMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the number of multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public int getNumberOfMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the number of multicast trees at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public int getNumberOfNodePairs()
Returns the number of node pairs.
public int getNumberOfNodes()
Returns the number of network nodes,
public int getNumberOfResources()
Returns the number of resources (Resource) defined
public int getNumberOfRoutes(NetworkLayer... optionalLayerParameter)
Returns the number of routes at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)public int getNumberOfSRGs()
Returns the number of shared risk groups (SRGs) defined
public String getPlotNodeLayoutCurrentlyActive()
public String getPlotNodeLayoutDefaultLayoutName()
public Resource getResource(int index)
Returns the resource with the given index
index
- Resource indexnull
if it does not exist, index is lesser than zero or greater than the number of elements minus one)public Resource getResourceFromId(long uid)
Returns the resource with the given unique identifier.
uid
- Resource unique idpublic ArrayList<Long> getResourceIds()
Returns the array of resource ids (i-th position, corresponds to index i)
ArrayList
of Resource unique idspublic List<Resource> getResources()
Returns the array of resources (i-th position, corresponds to index i).
List
of Resource obejectspublic SortedSet<Resource> getResources(String type)
type
- the typepublic SortedSet<Resource> getResourcesAttachedToAnyNode()
Returns the set of resources which are attached to any node (that is, not unattached)
public Route getRoute(int index, NetworkLayer... optionalLayerParameter)
Returns the route with the given index in the given layer. if no layer is provided, default layer is assumed
index
- Route indexoptionalLayerParameter
- network layer (optional)null
if it does not exist, index is lesser than zero or greater than the number of elements minus one)public Route getRouteFromId(long uid)
Returns the route with the given unique identifier.
uid
- Rute unique idnull
if it does not exist)public ArrayList<Long> getRouteIds(NetworkLayer... optionalLayerParameter)
Returns the array of route ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layer (optional)ArrayList
of route idespublic List<Route> getRoutes(NetworkLayer... optionalLayerParameter)
Returns the array of route ids for the given layer (i-th position, corresponds to index i). If no layer is provided, the default layer is assumed
optionalLayerParameter
- network layer (optional)List
of routespublic List<Route> getRoutesAreBackup(NetworkLayer... optionalLayerParameter)
Returns the list of routes which are not backup of any other route
optionalLayerParameter
- network layer (optional)List
of routespublic List<Route> getRoutesAreNotBackup(NetworkLayer... optionalLayerParameter)
Returns the list of routes which are backup of any other route
optionalLayerParameter
- network layer (optional)List
of routespublic SortedSet<Route> getRoutesDown(NetworkLayer... optionalLayerParameter)
Returns the set of routes that are down (traverse a link or node that is failed). If no layer is provided, default layer is assumed
optionalLayerParameter
- network layer (optional)SortedSet
of routes that are downpublic SortedSet<Route> getRoutesTraversingZeroCapacityLinks(NetworkLayer... optionalLayerParameter)
Returns the set of routes that are traversing a link with zero capacity. If no layer is provided, default layer is assumed
optionalLayerParameter
- network layer (optional)public SortedSet<String> getSiteNames()
public SortedSet<Node> getSiteNodes(String siteName)
siteName
- the namepublic SharedRiskGroup getSRG(int index)
Returns the shared risk group with the given index
index
- SRG indexnull
if it does not exist, index is lesser than zero or greater than the number of elements minus one)public SharedRiskGroup getSRGFromId(long uid)
Returns the shared risk group with the given unique identifier.
uid
- SRG unique idpublic ArrayList<Long> getSRGIds()
Returns the array of shared risk group ids (i-th position, corresponds to index i)
ArrayList
of Shared Risk Groups unique idspublic List<SharedRiskGroup> getSRGs()
Returns the array of shared risk groups (i-th position, corresponds to index i).
List
of Shared Risk Groupspublic SortedSet<SharedRiskGroup> getSrgsDynamic()
public SortedSet<Demand> getTaggedDemands(String tag, NetworkLayer... optionalLayerParameter)
tag
- the tagoptionalLayerParameter
- the layer (optional)public SortedSet<NetworkLayer> getTaggedLayers(String tag)
tag
- the tagpublic SortedSet<Link> getTaggedLinks(String tag, NetworkLayer... optionalLayerParameter)
tag
- the tagoptionalLayerParameter
- the layer (optional)public SortedSet<MulticastDemand> getTaggedMulticastDemands(String tag, NetworkLayer... optionalLayerParameter)
tag
- the tagoptionalLayerParameter
- the layer (optional)public SortedSet<MulticastTree> getTaggedMulticastTrees(String tag, NetworkLayer... optionalLayerParameter)
tag
- the tagoptionalLayerParameter
- the layer (optional)public SortedSet<Node> getTaggedNodes(String tag)
tag
- the tagpublic SortedSet<Resource> getTaggedResources(String tag)
tag
- the tagpublic SortedSet<Route> getTaggedRoutes(String tag, NetworkLayer... optionalLayerParameter)
tag
- the tagoptionalLayerParameter
- the layer (optional)public SortedSet<SharedRiskGroup> getTaggedSrgs(String tag)
tag
- the tagpublic SortedSet<Resource> getUnattachedResources()
Returns the set of resources which are not attached to any node
public DoubleMatrix1D getVectorAttributeValues(Collection<? extends NetworkElement> collection, String attributeKey)
Retuns a vector with the values of all given network elements for the given attribute key.
Important: Each element must have the attribute set and value must be of type double
collection
- Network elementsattributeKey
- Attribute namepublic DoubleMatrix1D getVectorDemandBlockedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the blocked traffic per demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorDemandCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorDemandOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorDemandTraversesOversubscribedLink(NetworkLayer... optionalLayerParameter)
Returns a vector where each index equals the demand index and the value is 1 if said demand traverses oversubscrined links, 0 otherwise. If no layer is provided, default layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorDemandWorseCasePropagationTimeInMs(NetworkLayer... optionalLayerParameter)
Returns the vector with the worst propagation time (in ms) per demand at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the capacity per link, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorLinkCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the total carried traffic per link, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with the length in km in the links, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the total occupied capacity in the links, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkOversubscribedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the oversubscibed traffic (oversubscribed traffic being the sum of all carried traffic, minus the capacity, or 0 if such substraction is negative) in each link at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, default layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorLinkPropagationDelayInMiliseconds(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation delay in milliseconds in the links, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkPropagationSpeedInKmPerSecond(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation speed in km/s in the links, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorLinkSpareCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the spare capacity (available minus occupied, or zero if oversubscribed) per link, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkUpState(NetworkLayer... optionalLayerParameter)
Returns a vector with the up/down state in the links (1 up, 0 down), at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorLinkUtilization(NetworkLayer... optionalLayerParameter)
Returns a vector with the utilization per link, at the given layer. Utilization is measured as the total link occupied capacity by the link traffic divided by the total link capacity. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorMulticastDemandBlockedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the blocked traffic per multicast demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastDemandCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per multicast demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastDemandOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per multicast demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastDemandTraversesOversubscribedLink(NetworkLayer... optionalLayerParameter)
Returns the vector indicating wheter a multicast demnd traverses (1) or not (0) oversubscribes links at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastDemandWorseCasePropagationTimeInMs(NetworkLayer... optionalLayerParameter)
Returns the vector with the worst propagation time (in ms) per multicast demand at the given layer. i-th vector corresponds to i-th index of the element.. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorMulticastTreeAverageNumberOfHops(NetworkLayer... optionalLayerParameter)
Returns a vector with the avergage number of hops per multicast tree at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastTreeCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per multicast tree, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastTreeNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with the number of links per multicast tree, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorMulticastTreeOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the occupied capacity traffic per multicast tree, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorMulticastTreeOfferedTrafficOfAssociatedMulticastDemand(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic per multicast tree from its associated multicast demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorNodeEgressUnicastTraffic(NetworkLayer... optionalLayerParameter)
Returns the vector with the total incoming offered traffic per node at the given layer. i-th vector corresponds to i-th index of the element. if no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorNodeIngressUnicastTraffic(NetworkLayer... optionalLayerParameter)
Returns the vector with the total outgoing offered traffic per node at the given layer. i-th vector corresponds to i-th index of the element. if no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorNodePopulation()
Returns a vector with the population of the nodes. i-th vector corresponds to i-th index of the element
public DoubleMatrix1D getVectorNodeUpState()
Returns a vector with the up/down state of the nodes (1 up, 0 down). i-th vector corresponds to i-th index of the element
public DoubleMatrix1D getVectorResourceCapacity()
Returns a vector with as many elements as resources, containing the capacity (in the own resource capacity units), for each resource.
public DoubleMatrix1D getVectorResourceIsOfType(String type)
Returns a vector with as many elements as resources, containing a 1 in coordinate of index i if the resource of index i is of the given type, a 0 if not.
type
- the resource typepublic DoubleMatrix1D getVectorResourceOccupiedCapacity()
Returns a vector with as many elements as resources, containing the currently occupied capacity (in the own resource capacity units), for each resource.
public DoubleMatrix1D getVectorResourceProcessingTimeInMs()
Returns a vector with as many elements as resources, containing the processing time in ms for the traversig traffic, for each resource.
public DoubleMatrix1D getVectorRouteCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns a vector with the carried traffic per route, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorRouteFirstBackupRouteLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with one element per route, containing the length in km of the first defined backup path for such route. If a route has no backup path defined, an exception is thrown. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorRouteFirstBackupRouteNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with one element per route, containing the number of links of the first defined backup path for such route. If a route has no backup path defined, an exception is thrown. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorRouteLengthInKm(NetworkLayer... optionalLayerParameter)
Returns a vector with the length in km per route, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorRouteNumberOfLinks(NetworkLayer... optionalLayerParameter)
Returns a vector with the number of links per route, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorRouteOccupiedCapacity(NetworkLayer... optionalLayerParameter)
Returns a vector with the occupied capacity traffic per route, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorRouteOfferedTrafficOfAssociatedDemand(NetworkLayer... optionalLayerParameter)
Returns a vector with the offered traffic (from its associated demand) per route at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- Network layer (optional)public DoubleMatrix1D getVectorRoutePropagationDelayInMiliseconds(NetworkLayer... optionalLayerParameter)
Returns a vector with the propagation delay in seconds per route, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
optionalLayerParameter
- network layer (optional)public DoubleMatrix1D getVectorSRGAvailability()
Returns a vector with the availability per Shared Risk Group (SRG).
public boolean hasDemands(NetworkLayer... optionalLayerParameter)
Returns true
if the network has one or more demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)True
if the network has demands at the given layer, false
otherwisepublic boolean hasForwardingRules(NetworkLayer... optionalLayerParameter)
Returns true
if the network has at least one non-zero forwarding rule splitting ratio in any demand-link pair, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- network layer (optional)True
if the network has at least one forwarding rule, false
otherwisepublic boolean hasLinks(NetworkLayer... optionalLayerParameter)
Returns true
if the network has one or more links at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if the network has one or more links, false
otherwisepublic boolean hasMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns true
if the network has one or more multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if the network has one or more multicast demand, false
otherwisepublic boolean hasMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns true
if the network has one or more multicast trees at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if the network has one or more multicast trees, false
otherwisepublic boolean hasNodes()
Returns true
if the network has nodes.
True
if the network has nodes, false
otherwisepublic boolean hasResources()
Returns true
if the network has one or more resources (Resource) defined.
True
if the network has resources defined, false
otherwisepublic boolean hasRoutes(NetworkLayer... optionalLayerParameter)
Returns true
if the network has one or moreroutes at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if the network has one or more routes, false
otherwisepublic boolean hasSRGs()
Returns true
if the network has one or more shared risk groups (SRGs) defined.
True
if the network has SRGs defined, false
otherwisepublic boolean hasUnicastRoutingLoops(NetworkLayer... optionalLayerParameter)
Returns true
if the network has at least one routing cycle at the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if there is at least one routing cycle, false
otherwisepublic boolean isDeepCopy(NetPlan np2)
Returns true if the given NetPlan object contains the same network than this, meaning that all the network elements are a copy in every aspect. In particular, saving in disk a design and then loading it again, should produce a network that is a deep copy of the original. Also, creating a new network using the copy method, should be also a deep copy
np2
- The NetPlan object to compare topublic boolean isLayerCouplingValid(NetworkLayer lowerLayer, NetworkLayer upperLayer)
Indicates whether or not a further coupling between two layers would be valid. This can be used to check if a new coupling would create cycles in the topology of layers, that is, if layer hierarchy is not broken.
lowerLayer
- Network lower layerupperLayer
- Network upper layerTrue
if coupling between both input layers is valid, false
otherwisepublic boolean isModifiable()
public boolean isMulticastRoutingBifurcated(NetworkLayer... optionalLayerParameter)
Returns true
if in the given layer, the traffic of any multicast demand is carried by more than one multicast tree. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)True
if traffic from at least one multicast demand is carried trhough two or more multicast trees, false
otherwisepublic boolean isMultilayer()
Returns true
if the network has more than one layer.
True
if the network has two or more layers, false
otherwisepublic boolean isSingleLayer()
Returns true
if the network has just one layer
True
if network has only one layer, false
otherwisepublic boolean isUnicastRoutingBifurcated(NetworkLayer... optionalLayerParameter)
Returns true
if in the given layer, the traffic of any demand is carried by more than one route (in SOURCE_ROUTING
),
or a node sends traffic of a demand to more than
one link (in HOP_BY_HOP_ROUTING
). If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layer (optional)True
if unicast traffic is bifurcated (see description), false
otherwisepublic boolean isUp(Collection<? extends NetworkElement> col)
Indicates whether or not a path, multicast tree or arbitrary collection of links and/or resources and/or nodes is up and belonging to this netPlan object (so they were not removed), and false otherwise
col
- the collectionpublic static NetPlan loadFromFile(File file)
Static factory method to get a NetPlan
object from a .n2p
file.
file
- Input filepublic NetPlan mergeIntoThisDesign(NetPlan otherDesign)
otherDesign
- The design to merge withpublic void removeAllDemands(NetworkLayer... optionalLayerParameter)
Removes all the demands defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllForwardingRules(NetworkLayer... optionalLayerParameter)
Removes all the forwarding rules in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllLinks(NetworkLayer... optionalLayerParameter)
Removes all the links defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllLinksUnused(double toleranceCapacityValueToConsiderUnusedLink, NetworkLayer... optionalLayerParameter)
Removes all the unsused links (those whith lesser capacity than toleranceCapacityValueToConsiderUnusedLink
) defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)toleranceCapacityValueToConsiderUnusedLink
- Tolerance capacity to consider a link unsusedpublic void removeAllMulticastDemands(NetworkLayer... optionalLayerParameter)
Removes all the multicast demands defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllMulticastTrees(NetworkLayer... optionalLayerParameter)
Removes all the multicast trees defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllMulticastTreesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedTree, NetworkLayer... optionalLayerParameter)
Removes all the multicast trees carrying no traffic and occupying no link capacity (even in the no failure state) defined in the given layer. If no layer is provided, default layer is used.
toleranceTrafficAndCapacityValueToConsiderUnusedTree
- Tolerance capacity to consider a link unsusedoptionalLayerParameter
- Network layer (optional)public void removeAllNetworkLayers()
Removes all the network layers (everything but the nodes and the SRGs). Removes all the links, demands and multicast demands of the defualt layer, it does not remove it
public void removeAllNodes()
Removes all the network nodes.
public void removeAllResources()
Removes all the resources.
public void removeAllRoutes(NetworkLayer... optionalLayerParameter)
Removes all the routes defined in the given layer. If no layer is provided, default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeAllRoutesUnused(double toleranceTrafficAndCapacityValueToConsiderUnusedRoute, NetworkLayer... optionalLayerParameter)
Removes all the routes defined in the given layer that do not carry traffic nor occupy link capacity in the given layer (even in a no-failure state). If no layer is provided, default layer is assumed.
toleranceTrafficAndCapacityValueToConsiderUnusedRoute
- Tolerance traffic to consider a route unusedoptionalLayerParameter
- Network layer (optional)public void removeAllSRGs()
Removes all the shared risk groups.
public void removeAllUnicastRoutingInformation(NetworkLayer... optionalLayerParameter)
Removes all the routing information (unicast and multicast) for the given layer, irrespective of the routing type setting. For source routing, all routes are removed. For hop-by-hop routing, all forwarding rules are removed. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public void removeGlobalPlanningDomain(String planningDomain)
planningDomain
- The name of the planning domainpublic void removeNetworkLayer(NetworkLayer... optionalLayerParameter)
Removes a layer, and any associated link, demand, route, or forwarding rule. If this layer is the default, the new default layer is the one with index 0 (the smallest identifier)
optionalLayerParameter
- Network layer (optional)public void removePlotNodeLayout(String plotLayoutToRemove)
plotLayoutToRemove
- see abovepublic void renameGlobalPlanningDomain(String oldName, String newName)
oldName
- the old name (should exist)newName
- the new name (should not exist)public void reset()
Resets the state of the network to an empty NetPlan
.
public NetPlan restrictDesign(SortedSet<Node> selectedNodes)
selectedNodes
- the selected nodespublic void saveToFile(File file)
Saves the current network plan to a given file. If extension .n2p
is not in the file name, it will be added automatically.
file
- Output filepublic void saveToOutputStream(OutputStream outputStream)
Saves the current network plan to a given output stream.
outputStream
- Output streampublic void setAllLinksFailureState(boolean setAsUp, NetworkLayer... optionalLayerParameter)
Sets the failure state (up or down) for all the links in the given layer. If no layer is provided, the default layer is assumed.
setAsUp
- true
up, false
downoptionalLayerParameter
- Network layer (optional)public void setAllNodesFailureState(boolean setAsUp)
Sets the failure state (up or down) for all the nodes.
setAsUp
- true
up, false
downpublic void setDemandTrafficUnitsName(String demandTrafficUnitsName, NetworkLayer... optionalLayerParameter)
Sets the name of the units in which the offered traffic is measured (e.g. "Gbps") at the given layer. If no layer is provided, default layer is assumed.
demandTrafficUnitsName
- Traffic units nameoptionalLayerParameter
- Network layer (optional)public double setForwardingRule(Demand demand, Link link, double splittingRatio)
Adds a new forwarding rule (or override an existing one), to the layer of the demand and link (must be in the same layer).
Important: Routing type must be HOP_BY_HOP_ROUTING
.
demand
- Demandlink
- LinksplittingRatio
- Splitting ratio (fraction of traffic from demand 'd' entering to the origin node of link 'e', going through link 'e').
Must be equal or greater than 0 and equal or lesser than 1.public void setForwardingRules(Collection<Demand> demands, Collection<Link> links, Collection<Double> splittingFactors, boolean removePreviousRulesAffectedDemands)
Adds a set of forwarding rules (or override existing ones). Demands, links and ratio are processed sequentially. All the elements must be in the same layer.
Important: Routing type must be HOP_BY_HOP_ROUTING
.
demands
- Demandslinks
- LinkssplittingFactors
- Splitting ratios (fraction of traffic from demand 'd' entering to the origin node of link 'e', going through link 'e').
Each value must be equal or greater than 0 and equal or lesser than 1.removePreviousRulesAffectedDemands
- Inclue true
or not false
unused rulespublic void setForwardingRules(DoubleMatrix2D f_de, Set<Demand> demandsToUpdate, NetworkLayer... optionalLayerParameter)
Sets the forwarding rules for the given design, only for the demands that are hop-by-hop. Source routed demands are untouched.
f_de
- For each demand d (d = 0 refers to the first demand in demandIds
, d = 1
refers to the second one, and so on), and each link e (e = 0 refers to the first link in NetPlan
object, e = 1
refers to the second one, and so on), f_de[d][e]
sets the fraction of the traffic from demand d that arrives (or is generated in) node a(e) (the origin node of link e), that is forwarded through link e. It must hold that for every node n different of b(d), the sum of the fractions fte along its outgoing links must be lower or equal than 1demandsToUpdate
- Demands to updateoptionalLayerParameter
- Network layer (optional)public void setLinkCapacityUnitsName(String name, NetworkLayer... optionalLayerParameter)
Sets the name of the units in which the link capacity is measured (e.g. "Gbps") at the given layer. If no ayer is provided, the default layer is assumed.
name
- Capacity units nameoptionalLayerParameter
- Network layer (optional)public void setLinksAndNodesFailureState(Collection<Link> linksToSetAsUp, Collection<Link> linksToSetAsDown, Collection<Node> nodesToSetAsUp, Collection<Node> nodesToSetAsDown)
Changes the failure state of the links and updates the routes/trees (they do not carry traffic nor occupy capacity), and hop-by-hop routing (no traffic is forwarded in links down)
linksToSetAsUp
- Links to set as uplinksToSetAsDown
- Links to set as downnodesToSetAsUp
- Nodes to set as upnodesToSetAsDown
- Nodes to set as downpublic boolean setModifiableState(boolean isModifiable)
Sets the NetPlan
so it cannot be modified
isModifiable
- }If true
, the object can be modified, false
otherwisepublic void setNetworkLayerDefault(NetworkLayer layer)
Sets the default network layer.
layer
- The default network layerpublic void setPlotNodeLayoutCurrentlyActive(String newCurrentPlotNodeLayout)
newCurrentPlotNodeLayout
- see abovepublic void setRoutingFromDemandLinkCarriedTraffic(DoubleMatrix2D x_de, boolean xdeValueAsFractionsRespectToDemandOfferedTraffic, boolean removeCycles, Set<Demand> demandsToSetRouting, NetworkLayer... optionalLayerParameter)
Adds traffic routes (or forwarding rules, depending on the routing type) from demand-link routing at the given layer.
If no layer is provided, default layer is assumed. If the routing is SOURCE-ROUTING, the new routing will have no closed nor open loops. If the routing is
HOP-BY-HOP routing, the new routing can have open loops. However, if the routing has closed loops (which were not removed), a ClosedCycleRoutingException
will be thrown.
x_de
- Matrix containing the amount of traffic from demand d (rows) which traverses link e (columns)xdeValueAsFractionsRespectToDemandOfferedTraffic
- If true
, {code x_de} contains the fraction of the carried traffic (between 0 and 1)removeCycles
- If true, the open and closed loops are eliminated from the routing before any processing is done. The form in which this is done guarantees that the resulting
routing uses the same or less traffic in the links for each destination than the original routing. For removing the cycles,
the method calls to removeCyclesFrom_xte
using the default ILP solver defined in Net2Plan, and no limit in the maximum solver running time.optionalLayerParameter
- Network layer (optional)demandsToSetRouting
- Demands to set routingpublic void setRoutingFromDestinationLinkCarriedTraffic(DoubleMatrix2D x_te, boolean removeCycles, NetworkLayer... optionalLayerParameter)
Adds traffic routes (or forwarding rules, depending on the routing type) from destination-link routing at the given layer.
If no layer is provided, default layer is assumed. If the routing is SOURCE-ROUTING, the new routing will have no closed nor open loops. If the routing is
HOP-BY-HOP routing, the new routing can have open loops. However, if the routing has closed loops (which were not removed), a ClosedCycleRoutingException
will be thrown
x_te
- For each destination node t (rows), and each link e (columns), f_te[t][e]
represents the traffic targeted to node t that arrives (or is generated
in) node a(e) (the origin node of link e), that is forwarded through link eremoveCycles
- If true, the open and closed loops are eliminated from the routing before any processing is done. The form in which this is done guarantees that the resulting
routing uses the same or less traffic in the links for each destination than the original routing. For removing the cycles,
the method calls to removeCyclesFrom_xte
using the default ILP solver defined in Net2Plan, and no limit in the maximum solver running time.optionalLayerParameter
- Network layer (optional)public void setRoutingTypeAllDemands(Constants.RoutingType newRoutingType, NetworkLayer... optionalLayerParameter)
Sets the routing type at the given layer. If there is some previous routing information, it will be converted to the new type. If no layer is provided, default layer is assumed. In the conversion from HOP-BY-HOP to SOURCE-ROUTING: (i) the demands with open loops are routed so these loops are removed, and the resulting routing consumes the same or less bandwidth in the demand traversed links, (ii) the demands with closed loops are routed so that the traffic that enters the closed loops is not carried. These modifications are done since open or close loops would require routes with an infinite number of links to be fairly represented.
In the conversion to HOP-BY-HOP: An exception is thrown if a demand is service chain demand (since this information would be lost in the hop-by-bop representation). Also, in this conversion, some information can be lost (so a conversion back to SOURCE ROUTING will not produce the original network): the conversion uses the route carried traffics, and discards the information of the the routes occupied capacities in the links. A conversion back will put all the occupied capacities of the routes, equal to the carried traffics (so the original occupied links capacities would be lost, if different).
optionalLayerParameter
- Network layer (optional)newRoutingType
- RoutingType
public void setTrafficMatrix(DoubleMatrix2D trafficMatrix, Constants.RoutingType routingTypeDemands, NetworkLayer... optionalLayerParameter)
Sets the traffic demands at the given layer from a given traffic matrix, removing any previous demand. If no layer is provided, default layer is assumed.
Important: Matrix values must be strictly non-negative and matrix size have to be NxN (where N is the number of nodes)
routingTypeDemands
- Routing typeoptionalLayerParameter
- Network layer (optionaltrafficMatrix
- Traffic matrixpublic void setVectorAttributeValues(Collection<? extends NetworkElement> collection, String attributeKey, DoubleMatrix1D values)
Sets the given attributes values to all the given network elements.
collection
- Network elementsattributeKey
- Attribute namevalues
- Attribute values (must have the same size as collection
public void setVectorDemandOfferedTraffic(DoubleMatrix1D offeredTrafficVector, NetworkLayer... optionalLayerParameter)
Sets the vector of the offered traffic per demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
offeredTrafficVector
- Offered traffic vectoroptionalLayerParameter
- Network layer (optional)public void setVectorLinkCapacity(DoubleMatrix1D linkCapacities, NetworkLayer... optionalLayerParameter)
Sets the vector of the link capacities, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
linkCapacities
- Link capacitiesoptionalLayerParameter
- Network layer (optional)public void setVectorMulticastDemandOfferedTraffic(DoubleMatrix1D offeredTrafficVector, NetworkLayer... optionalLayerParameter)
Sets the vector of the offered traffic per multicast demand, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.
offeredTrafficVector
- Offered traffic vectoroptionalLayerParameter
- Network layer (optional)public void setVectorMulticastTreeCarriedTrafficAndOccupiedLinkCapacities(DoubleMatrix1D carriedTraffic, DoubleMatrix1D occupiedLinkCapacity, NetworkLayer... optionalLayerParameter)
Sets the vector of the multicast trees carried traffics and occupied link capacities, at the given layer. i-th vector corresponds to i-th index of the element.
If occupied link capacities are null
, the same amount as the carried traffic is assumed. If no layer is provided, the defaulf layer is assumed.
carriedTraffic
- Carried traffic vectoroccupiedLinkCapacity
- Occupied link capacity vectoroptionalLayerParameter
- Network layer (optional)public void setVectorRouteCarriedTrafficAndOccupiedLinkCapacities(DoubleMatrix1D carriedTraffic, DoubleMatrix1D occupiedLinkCapacity, NetworkLayer... optionalLayerParameter)
Sets the vector of the route carried traffics and occupied link capacities, at the given layer. i-th vector corresponds to i-th index of the element.
If occupied link capacities are null
, the same amount as the carried traffic is assumed. If no layer is provided, the defaulf layer is assumed,
carriedTraffic
- Carried traffic vectoroccupiedLinkCapacity
- Occupied link capacity vectoroptionalLayerParameter
- Network layer (optional)public String toString()
String
representation of the network design.toString
in class NetworkElement
public String toString(Collection<NetworkLayer> layers)
String
representation of the network design only for the
given layers.layers
- Network layersCopyright © 2018. All rights reserved.