public class SharedRiskGroup extends NetworkElement
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.
|
boolean |
affectsAnyOf(Collection<? extends NetworkElement> col)
Returns true if any element of the given collection of links, nodes and resources is affected by te SRG (fails if the SRG fails), false otherwise
|
SortedSet<Link> |
getAffectedLinks(NetworkLayer layer)
Returns all the links affected by this SRG, but only those at a particular layer.
|
SortedSet<Link> |
getAffectedLinksAllLayers()
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
|
SortedSet<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)
|
SortedSet<MulticastTree> |
getAffectedMulticastTreesAllLayers()
Returns the set of multicast trees affected by the SRG (fail, when the SRG is in failure state).
|
SortedSet<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)
|
SortedSet<Route> |
getAffectedRoutesAllLayers()
Returns the set of routes affected by the SRG (fail, when the SRG is in failure state).
|
double |
getAvailability()
Returns the availability (between 0 and 1) of the SRG.
|
static SharedRiskGroup |
getDummyEmptyStaticSrg(NetPlan np) |
DynamicSrgImplementation |
getDynamicSrgImplementation()
Returns the object implementing the dynamic decision of which nodes/links belong to this SRG
|
SortedSet<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.
|
SortedSet<Link> |
getLinksAllLayers()
Returns the set of links associated to the SRG (fail, when the SRG is in failure state).
|
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.
|
SortedSet<Node> |
getNodes()
Returns the set of nodes associated to the SRG (fail, when the SRG is in failure state)
|
static SortedSet<SharedRiskGroup> |
getSrgListCompletedWithDummyNoFailureStateIfNeeded(Collection<SharedRiskGroup> sourceSrgs,
NetPlan np) |
boolean |
isDynamicCurrentlyEmptySrg() |
boolean |
isDynamicSrg() |
boolean |
isStaticEmptySrg() |
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 |
setAsUp()
Sets nodes and links associated to the SRG as up (in case they are not yet).
|
void |
setDynamicImplementation(DynamicSrgImplementation impl) |
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. |
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 addLink(Link link)
Adds a link to the SRG. If the link is already part of the srg, no action is taken.
link
- Link to addpublic void addNode(Node node)
Adds a node to the SRG. If the node is already part of the SRG, no action is taken
node
- Node to addpublic boolean affectsAnyOf(Collection<? extends NetworkElement> col)
col
- the collectionpublic SortedSet<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 SortedSet<Link> getAffectedLinksAllLayers()
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 SortedSet<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 SortedSet<MulticastTree> getAffectedMulticastTreesAllLayers()
Returns the set of multicast trees affected by the SRG (fail, when the SRG is in failure state).
public SortedSet<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 SortedSet<Route> getAffectedRoutesAllLayers()
Returns the set of routes affected by the SRG (fail, when the SRG is in failure state).
public 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 static SharedRiskGroup getDummyEmptyStaticSrg(NetPlan np)
public DynamicSrgImplementation getDynamicSrgImplementation()
public SortedSet<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 SortedSet<Link> getLinksAllLayers()
Returns the set of links associated to the SRG (fail, when the SRG is in failure state).
public 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 SortedSet<Node> getNodes()
Returns the set of nodes associated to the SRG (fail, when the SRG is in failure state)
public static SortedSet<SharedRiskGroup> getSrgListCompletedWithDummyNoFailureStateIfNeeded(Collection<SharedRiskGroup> sourceSrgs, NetPlan np)
public boolean isDynamicCurrentlyEmptySrg()
public boolean isDynamicSrg()
public boolean isStaticEmptySrg()
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 setAsUp()
Sets nodes and links associated to the SRG as up (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 setDynamicImplementation(DynamicSrgImplementation impl)
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 SRGCopyright © 2018. All rights reserved.