public class SharedRiskGroup extends NetworkElement
This class contains a representation of a Shared Risk Group (SRG). This is a concept representing a risk of failure in the network, such that if this risk becomes true, a particular set of links and/or nodes simultaneously fail. For instance, a SRG can be the risk of accidentally cutting a duct containing multiple links. Its associated failiing resources would be all the links contained in the duct.
The SRG is characterized by the links/nodes failing, and the MTTF (meen time to fail) and MTTR (mean time to repair) values that describe statistically the average time between a reparation of the risk effects and a new risk occurrence (MTTF), and the time between a risk occurrence until it is repaired (MTTR).
Modifier and Type | Method and Description |
---|---|
void |
addLink(Link link)
Adds a link to the SRG.
|
void |
addNode(Node node)
Adds a node to the SRG.
|
Set<Link> |
getAffectedLinks()
Returns all the links affected by the SRG at all the layers: the links affected, and the input and output links of the affected nodes
|
Set<Link> |
getAffectedLinks(NetworkLayer layer)
Returns all the links affected by this SRG, but only those at a particular layer.
|
Set<MulticastTree> |
getAffectedMulticastTrees()
Returns the set of multicast trees affected by the SRG (fail, when the SRG is in failure state).
|
Set<MulticastTree> |
getAffectedMulticastTrees(NetworkLayer layer)
Returns the set of multicast trees in the given layer affected by the SRG (fail, when the SRG is in failure state)
|
Set<ProtectionSegment> |
getAffectedProtectionSegments()
Returns the set of protection segments affected by the SRG (fail, when the SRG is in failure state).
|
Set<ProtectionSegment> |
getAffectedProtectionSegments(NetworkLayer layer)
Returns the set of protection segments in the given layer affected by the SRG (fail, when the SRG is in failure state)
|
Set<Route> |
getAffectedRoutes()
Returns the set of routes affected by the SRG (fail, when the SRG is in failure state).
|
Set<Route> |
getAffectedRoutes(NetworkLayer layer)
Returns the set of routes in the given layer affected by the SRG (fail, when the SRG is in failure state)
|
double |
getAvailability()
Returns the availability (between 0 and 1) of the SRG.
|
Set<Link> |
getLinks()
Returns the set of links associated to the SRG (fail, when the SRG is in failure state).
|
Set<Link> |
getLinks(NetworkLayer layer)
Returns the set of links associated to the SRG (fail, when the SRG is in failure state), but only those belonging to the given layer.
|
double |
getMeanTimeToFailInHours()
Returns the mean time to fail (MTTF) in hours of the SRG, that is, the average time between when it is repaired, and its next failure.
|
double |
getMeanTimeToRepairInHours()
Returns the mean time to repair (MTTR) of the SRG, that is, the average time between a failure occurs, and it is repaired.
|
Set<Node> |
getNodes()
Returns the set of nodes associated to the SRG (fail, when the SRG is in failure state)
|
void |
remove()
Removes this SRG.
|
void |
removeLink(Link e)
Removes a link from the set of links of the SRG.
|
void |
removeNode(Node n)
Removes a node from the set of nodes of the SRG.
|
void |
setAsDown()
Sets nodes and links associated to the SRG as down (in case they are not yet).
|
void |
setMeanTimeToFailInHours(double value)
Sets the mean time to fail (MTTF) in hours of the SRG, that is, the average time between it is repaired, and the next failure.
|
void |
setMeanTimeToRepairInHours(double value)
Sets the mean time to repair (MTTR) in hours of the SRG, that is, the average time between a failure occurs, and it is repaired.
|
String |
toString()
Returns a
String representation of the Shared Risk Group. |
checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, equals, getAttribute, getAttributes, getId, getIndex, getNetPlan, removeAllAttributes, removeAttribute, setAttribute, setAttributeMap, wasRemoved
public void addLink(Link link)
Adds a link to the SRG. The object cannot be a protection segment (recall that segments are subclasses of Link).
link
- Link to addpublic void addNode(Node node)
Adds a node to the SRG.
node
- Node to addpublic Set<Link> getAffectedLinks()
Returns all the links affected by the SRG at all the layers: the links affected, and the input and output links of the affected nodes
public Set<Link> getAffectedLinks(NetworkLayer layer)
Returns all the links affected by this SRG, but only those at a particular layer. This includes the links involved, and the input and output links of the affected nodes
layer
- Network layerpublic Set<MulticastTree> getAffectedMulticastTrees()
Returns the set of multicast trees affected by the SRG (fail, when the SRG is in failure state).
public Set<MulticastTree> getAffectedMulticastTrees(NetworkLayer layer)
Returns the set of multicast trees in the given layer affected by the SRG (fail, when the SRG is in failure state)
layer
- Network layerpublic Set<ProtectionSegment> getAffectedProtectionSegments()
Returns the set of protection segments affected by the SRG (fail, when the SRG is in failure state).
public Set<ProtectionSegment> getAffectedProtectionSegments(NetworkLayer layer)
Returns the set of protection segments in the given layer affected by the SRG (fail, when the SRG is in failure state)
layer
- Network layerpublic Set<Route> getAffectedRoutes()
Returns the set of routes affected by the SRG (fail, when the SRG is in failure state).
public Set<Route> getAffectedRoutes(NetworkLayer layer)
Returns the set of routes in the given layer affected by the SRG (fail, when the SRG is in failure state)
layer
- Network layerpublic double getAvailability()
Returns the availability (between 0 and 1) of the SRG. That is, the fraction of time that the SRG is in non failure state.
Availability is computed as: MTTF/ (MTTF + MTTR)
public Set<Link> getLinks()
Returns the set of links associated to the SRG (fail, when the SRG is in failure state).
public Set<Link> getLinks(NetworkLayer layer)
Returns the set of links associated to the SRG (fail, when the SRG is in failure state), but only those belonging to the given layer.
layer
- the layerpublic double getMeanTimeToFailInHours()
Returns the mean time to fail (MTTF) in hours of the SRG, that is, the average time between when it is repaired, and its next failure.
public double getMeanTimeToRepairInHours()
Returns the mean time to repair (MTTR) of the SRG, that is, the average time between a failure occurs, and it is repaired.
public Set<Node> getNodes()
Returns the set of nodes associated to the SRG (fail, when the SRG is in failure state)
public void remove()
Removes this SRG.
public void removeLink(Link e)
Removes a link from the set of links of the SRG. If the link is not in the SRG, no action is taken
e
- Link to be removedpublic void removeNode(Node n)
Removes a node from the set of nodes of the SRG. If the node is not in the SRG, no action is taken
n
- Node to be removedpublic void setAsDown()
Sets nodes and links associated to the SRG as down (in case they are not yet). The network state is updated with the affected routes, segments, trees and hop-by-hop routing associated to the new nodes/links down
public void setMeanTimeToFailInHours(double value)
Sets the mean time to fail (MTTF) in hours of the SRG, that is, the average time between it is repaired, and the next failure.
value
- The new MTTF (it must be greater than zero)public void setMeanTimeToRepairInHours(double value)
Sets the mean time to repair (MTTR) in hours of the SRG, that is, the average time between a failure occurs, and it is repaired.
value
- the nnew MTTR (negative values are not accepted)public String toString()
Returns a String
representation of the Shared Risk Group.
toString
in class NetworkElement
String
representation of the SRG