public class Node extends NetworkElement
This class contains a representation of a node.
Modifier and Type | Method and Description |
---|---|
void |
addToPlanningDomain(String planningDomain)
Remove this node from the given planning domain, if it belongs to it
|
SortedSet<MulticastTree> |
getAssociatedMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that start, end or traverse this node, in the given layer.
|
SortedSet<Route> |
getAssociatedRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes that start, end or traverse this node, in the given layer.
|
double |
getEgressCarriedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current multicast carried traffic ending in the node, counting the multicast demands at the given layer.
|
double |
getEgressCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current carried traffic ending in the node, counting the demands at the given layer.
|
double |
getEgressOfferedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total multicast offered traffic ending in the node, counting the multicast demands at the given layer.
|
double |
getEgressOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total unicast offered traffic ending in the node, counting the demands at the given layer.
|
SortedSet<Route> |
getExpressRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes that traverse this node but not as the origin node of the first link, nor
the ending node of the last link
|
SortedMap<Pair<Demand,Link>,Double> |
getForwardingRules(Demand demand)
Returns the set of forwarding rules of links initiated in the node and associated to the given demand (the links are then in the same layer
as the demand), that have a non-zero splitting factor
|
SortedMap<Pair<Demand,Link>,Double> |
getForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the set of forwarding rules of links initiated in the node of the given layer,
which have a non-zero splitting factor.
|
SortedSet<Demand> |
getIncomingDemands(NetworkLayer... optionalLayerParameter)
Returns the set of demands ending in the node, in the given layer.
|
SortedSet<Demand> |
getIncomingDemandsAllLayers()
Returns the set of demands ending in the node, in any layer.
|
SortedSet<Link> |
getIncomingLinks(NetworkLayer... optionalLayerParameter)
Returns the set of links ending in the node, in the given layer.
|
SortedSet<Link> |
getIncomingLinksAllLayers()
Returns the set of links ending in the node at any layer.
|
double |
getIncomingLinksCapacity(NetworkLayer... optionalLayerParameter)
Returns the total capacity in the links of te given layer entering the node.
|
double |
getIncomingLinksTraffic(NetworkLayer... optionalLayerParameter)
Returns the total carried in the links of te given layer entering the node.
|
SortedSet<MulticastDemand> |
getIncomingMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of multicast demands ending in the node, in the given layer.
|
SortedSet<MulticastDemand> |
getIncomingMulticastDemandsAllLayers()
Returns the set of multicast demands ending in the node, in any layer.
|
SortedSet<MulticastTree> |
getIncomingMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees ending in the node, in the given layer.
|
SortedSet<Route> |
getIncomingRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes ending in the node, in the given layer.
|
double |
getIngressCarriedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current multicast carried traffic initiated in the node, counting the multicast demands at the given layer.
|
double |
getIngressCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current carried traffic initiated in the node, counting the demands at the given layer.
|
double |
getIngressOfferedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total multicast offered traffic initiated in the node, counting the multicast demands at the given layer.
|
double |
getIngressOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total unicast offered traffic initited in the node, counting the demands at the given layer.
|
SortedSet<Node> |
getInNeighbors(NetworkLayer... optionalLayerParameter)
Returns the nodes directly connected to this, with links ending in this node at the given layer.
|
SortedSet<Node> |
getInNeighborsAllLayers()
Returns the nodes directly connected to this, with links ending in this node at any layer.
|
double |
getNodeIconRelativeSize(NetworkLayer layer)
Returns the relative size (a number greater than zero), of the icon of this node in the GUI.
|
SortedSet<Demand> |
getOutgoingDemands(NetworkLayer... optionalLayerParameter)
Returns the set of demands initiated in the node, in the given layer.
|
SortedSet<Demand> |
getOutgoingDemandsAllLayers()
Returns the set of demands initiated in the node, in any layer.
|
SortedSet<Link> |
getOutgoingLinks(NetworkLayer... optionalLayerParameter)
Returns the set of links initiated in the node, in the given layer.
|
SortedSet<Link> |
getOutgoingLinksAllLayers()
Returns the set of links initiated in the node in all layer.
|
double |
getOutgoingLinksCapacity(NetworkLayer... optionalLayerParameter)
Returns the total capacity in the links of te given layer entering the node.
|
double |
getOutgoingLinksTraffic(NetworkLayer... optionalLayerParameter)
Returns the total carried in the links of te given layer entering the node.
|
SortedSet<MulticastDemand> |
getOutgoingMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of multicast demands initiated in the node, in the given layer.
|
SortedSet<MulticastDemand> |
getOutgoingMulticastDemandsAllLayers()
Returns the set of multicast demands initiated in the node, in any layer.
|
SortedSet<MulticastTree> |
getOutgoingMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast tree initiated in the node, in the given layer.
|
SortedSet<Route> |
getOutgoingRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes initiated in the node, in the given layer.
|
SortedSet<Node> |
getOutNeighbors(NetworkLayer... optionalLayerParameter)
Returns the nodes directly connected to this, with links initiated in this node at the given layer.
|
SortedSet<Node> |
getOutNeighborsAllLayers()
Returns the nodes directly connected to this, with links initiated in this node at any layer.
|
SortedSet<String> |
getPlanningDomains()
Returns the set of planning domains this node belongs to (could be empty)
|
double |
getPopulation()
Returns the node population
|
SortedSet<Resource> |
getResources(String... type)
Returns the set of resources that this node hosts.
|
String |
getSiteName()
Returns the name of the site this node is associated to (or null if none)
|
SortedSet<SharedRiskGroup> |
getSRGs()
Returns the set of shared risk groups (SRGs) this node belongs to.
|
URL |
getUrlNodeIcon(NetworkLayer layer)
Returns the url of the icon specified by the user to represent this node at the given layer, or null if none
|
SortedSet<NetworkLayer> |
getWorkingLayers()
Returns the layers where this node is working: has at least one link, or demand, or multicast demand at the given layer associated to it.
|
Point2D |
getXYPositionMap(String... layout)
Returns node position in the map, in the given layout (or the currently active if none)
|
boolean |
isDown()
Returns true if the node is down (failure state)
|
boolean |
isIsolated()
Returns true if the node is fully isolated at all layers, with no links nor demands affecting it
|
boolean |
isUp()
Returns true if the node is up (no failure state)
|
boolean |
isWorkingAtLayer(NetworkLayer layer)
Returns true has at least one link, or demand, or multicast demand at the given layer associated to it.
|
void |
remove()
Removes a node, and any associated link, demand, route or forwarding rule.
|
void |
removeAllForwardingRules(NetworkLayer... optionalLayerParameter)
Removes all forwarding rules associated to the node for a given layer (that is, of layer links outgoing from the node).
|
void |
removeFromPlanningDomain(String planningDomain)
Remove this node from the given planning domain, if it belongs to it
|
void |
removeUrlNodeIcon(NetworkLayer layer)
Removes any previous url of the node icon for this layer (if any)
|
boolean |
setFailureState(boolean setAsUp)
SortedSet the failure state of the node: up or down.
|
void |
setPopulation(double population)
Sets the population of the node (must be non-negative)
|
void |
setSiteName(String site)
Sets the name of the site this node is associated to, removing previous site name information.
|
void |
setUrlNodeIcon(NetworkLayer layer,
URL url,
Double relativeSize)
Sets the url of the icon specified by the user to represent this node at the given layer, and the relative size respect to other nodes.
|
void |
setXYPositionMap(Point2D pos,
String... layout)
Sets the node position in the map, in the current layout, used for visualization
|
String |
toString()
Returns a
String representation of the node. |
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 void addToPlanningDomain(String planningDomain)
planningDomain
- Planning domain namepublic SortedSet<MulticastTree> getAssociatedMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees that start, end or traverse this node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optionalpublic SortedSet<Route> getAssociatedRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes that start, end or traverse this node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getEgressCarriedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current multicast carried traffic ending in the node, counting the multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getEgressCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current carried traffic ending in the node, counting the demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getEgressOfferedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total multicast offered traffic ending in the node, counting the multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getEgressOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total unicast offered traffic ending in the node, counting the demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Route> getExpressRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes that traverse this node but not as the origin node of the first link, nor the ending node of the last link
optionalLayerParameter
- Network layer (optional)public SortedMap<Pair<Demand,Link>,Double> getForwardingRules(Demand demand)
Returns the set of forwarding rules of links initiated in the node and associated to the given demand (the links are then in the same layer as the demand), that have a non-zero splitting factor
demand
- The demandpublic SortedMap<Pair<Demand,Link>,Double> getForwardingRules(NetworkLayer... optionalLayerParameter)
Returns the set of forwarding rules of links initiated in the node of the given layer, which have a non-zero splitting factor. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Demand> getIncomingDemands(NetworkLayer... optionalLayerParameter)
Returns the set of demands ending in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Demand> getIncomingDemandsAllLayers()
Returns the set of demands ending in the node, in any layer.
public SortedSet<Link> getIncomingLinks(NetworkLayer... optionalLayerParameter)
Returns the set of links ending in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- the layerpublic SortedSet<Link> getIncomingLinksAllLayers()
Returns the set of links ending in the node at any layer.
public double getIncomingLinksCapacity(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- Network layer (optional)public double getIncomingLinksTraffic(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- Network layer (optional)public SortedSet<MulticastDemand> getIncomingMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of multicast demands ending in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<MulticastDemand> getIncomingMulticastDemandsAllLayers()
Returns the set of multicast demands ending in the node, in any layer.
public SortedSet<MulticastTree> getIncomingMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast trees ending in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Route> getIncomingRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes ending in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layerpublic double getIngressCarriedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current multicast carried traffic initiated in the node, counting the multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getIngressCarriedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total current carried traffic initiated in the node, counting the demands at the given layer. If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layer (optional)public double getIngressOfferedMulticastTraffic(NetworkLayer... optionalLayerParameter)
Returns the total multicast offered traffic initiated in the node, counting the multicast demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public double getIngressOfferedTraffic(NetworkLayer... optionalLayerParameter)
Returns the total unicast offered traffic initited in the node, counting the demands at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Node> getInNeighbors(NetworkLayer... optionalLayerParameter)
Returns the nodes directly connected to this, with links ending in this node at the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Node> getInNeighborsAllLayers()
Returns the nodes directly connected to this, with links ending in this node at any layer.
public double getNodeIconRelativeSize(NetworkLayer layer)
layer
- the layerpublic SortedSet<Demand> getOutgoingDemands(NetworkLayer... optionalLayerParameter)
Returns the set of demands initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Demand> getOutgoingDemandsAllLayers()
Returns the set of demands initiated in the node, in any layer.
public SortedSet<Link> getOutgoingLinks(NetworkLayer... optionalLayerParameter)
Returns the set of links initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Link> getOutgoingLinksAllLayers()
Returns the set of links initiated in the node in all layer.
public double getOutgoingLinksCapacity(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- Network layer (optional)public double getOutgoingLinksTraffic(NetworkLayer... optionalLayerParameter)
optionalLayerParameter
- Network layer (optional)public SortedSet<MulticastDemand> getOutgoingMulticastDemands(NetworkLayer... optionalLayerParameter)
Returns the set of multicast demands initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<MulticastDemand> getOutgoingMulticastDemandsAllLayers()
Returns the set of multicast demands initiated in the node, in any layer.
public SortedSet<MulticastTree> getOutgoingMulticastTrees(NetworkLayer... optionalLayerParameter)
Returns the set of multicast tree initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- The layerpublic SortedSet<Route> getOutgoingRoutes(NetworkLayer... optionalLayerParameter)
Returns the set of routes initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.
optionalLayerParameter
- Network layer (optional)public SortedSet<Node> getOutNeighbors(NetworkLayer... optionalLayerParameter)
Returns the nodes directly connected to this, with links initiated in this node at the given layer. If no layer is provided, the default layer is assumed
optionalLayerParameter
- Network layerpublic SortedSet<Node> getOutNeighborsAllLayers()
Returns the nodes directly connected to this, with links initiated in this node at any layer.
public SortedSet<String> getPlanningDomains()
public double getPopulation()
public SortedSet<Resource> getResources(String... type)
type
- one or more optional types (optional)public String getSiteName()
public SortedSet<SharedRiskGroup> getSRGs()
Returns the set of shared risk groups (SRGs) this node belongs to.
public URL getUrlNodeIcon(NetworkLayer layer)
layer
- the layerpublic SortedSet<NetworkLayer> getWorkingLayers()
public Point2D getXYPositionMap(String... layout)
Returns node position in the map, in the given layout (or the currently active if none)
layout
- see abovepublic boolean isDown()
Returns true if the node is down (failure state)
public boolean isIsolated()
public boolean isUp()
Returns true if the node is up (no failure state)
public boolean isWorkingAtLayer(NetworkLayer layer)
layer
- Network layerpublic void remove()
Removes a node, and any associated link, demand, route or forwarding rule.
public void removeAllForwardingRules(NetworkLayer... optionalLayerParameter)
Removes all forwarding rules associated to the node for a given layer (that is, of layer links outgoing from the node). If no layer is provided, the default layer is assumed.
optionalLayerParameter
- the layerpublic void removeFromPlanningDomain(String planningDomain)
planningDomain
- Planning domain namepublic void removeUrlNodeIcon(NetworkLayer layer)
layer
- the layerpublic boolean setFailureState(boolean setAsUp)
SortedSet the failure state of the node: up or down. Returns the previous failure state. The routing is automatically updated, making the traffic of the traversing routes as zero, and the hop-by-hop routing is updated as if the forwarding rules of input and output links were zero
setAsUp
- The new failure state (true
up, false
down)public void setPopulation(double population)
population
- the populationpublic void setSiteName(String site)
site
- te site namepublic void setUrlNodeIcon(NetworkLayer layer, URL url, Double relativeSize)
layer
- the layerurl
- the urlrelativeSize
- the relative size (strictly positive number)public void setXYPositionMap(Point2D pos, String... layout)
Sets the node position in the map, in the current layout, used for visualization
pos
- New node positionlayout
- optionally, we can provide the layout where to set the positionpublic String toString()
Returns a String
representation of the node.
toString
in class NetworkElement
String
representation of the nodeCopyright © 2018. All rights reserved.