Package org.onosproject.net.topology
Class HopCountLinkWeigher
- java.lang.Object
-
- org.onosproject.net.topology.HopCountLinkWeigher
-
- All Implemented Interfaces:
EdgeWeigher<TopologyVertex,TopologyEdge>,LinkWeigher
public class HopCountLinkWeigher extends java.lang.Object implements LinkWeigher
Link weight for measuring link cost as hop count with indirect links being as expensive as traversing the entire graph to assume the worst.
-
-
Field Summary
Fields Modifier and Type Field Description static LinkWeigherDEFAULT_HOP_COUNT_WEIGHER
-
Constructor Summary
Constructors Constructor Description HopCountLinkWeigher()Creates a new hop-count weight.HopCountLinkWeigher(double indirectLinkCost)Creates a new hop-count weight with the specified cost of indirect links.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightgetInitialWeight()Returns initial weight value (i.e.WeightgetNonViableWeight()Returns weight of a link/path that should be skipped (can be considered as an infinite weight).Weightweight(TopologyEdge edge)Returns the weight of the given edge.
-
-
-
Field Detail
-
DEFAULT_HOP_COUNT_WEIGHER
public static final LinkWeigher DEFAULT_HOP_COUNT_WEIGHER
-
-
Method Detail
-
weight
public Weight weight(TopologyEdge edge)
Description copied from interface:EdgeWeigherReturns the weight of the given edge.- Specified by:
weightin interfaceEdgeWeigher<TopologyVertex,TopologyEdge>- Parameters:
edge- edge to be weighed- Returns:
- edge weight
-
getInitialWeight
public Weight getInitialWeight()
Description copied from interface:EdgeWeigherReturns initial weight value (i.e. weight of a "path" starting and terminating in the same vertex; typically 0 value is used).- Specified by:
getInitialWeightin interfaceEdgeWeigher<TopologyVertex,TopologyEdge>- Returns:
- null path weight
-
getNonViableWeight
public Weight getNonViableWeight()
Description copied from interface:EdgeWeigherReturns weight of a link/path that should be skipped (can be considered as an infinite weight).- Specified by:
getNonViableWeightin interfaceEdgeWeigher<TopologyVertex,TopologyEdge>- Returns:
- non viable weight
-
-