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 LinkWeigher
DEFAULT_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 Weight
getInitialWeight()
Returns initial weight value (i.e.Weight
getNonViableWeight()
Returns weight of a link/path that should be skipped (can be considered as an infinite weight).Weight
weight(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:EdgeWeigher
Returns the weight of the given edge.- Specified by:
weight
in interfaceEdgeWeigher<TopologyVertex,TopologyEdge>
- Parameters:
edge
- edge to be weighed- Returns:
- edge weight
-
getInitialWeight
public Weight getInitialWeight()
Description copied from interface:EdgeWeigher
Returns initial weight value (i.e. weight of a "path" starting and terminating in the same vertex; typically 0 value is used).- Specified by:
getInitialWeight
in interfaceEdgeWeigher<TopologyVertex,TopologyEdge>
- Returns:
- null path weight
-
getNonViableWeight
public Weight getNonViableWeight()
Description copied from interface:EdgeWeigher
Returns weight of a link/path that should be skipped (can be considered as an infinite weight).- Specified by:
getNonViableWeight
in interfaceEdgeWeigher<TopologyVertex,TopologyEdge>
- Returns:
- non viable weight
-
-