Package org.onosproject.net.topology
Class GeoDistanceLinkWeight
- java.lang.Object
-
- org.onosproject.net.topology.GeoDistanceLinkWeight
-
- All Implemented Interfaces:
EdgeWeigher<TopologyVertex,TopologyEdge>,LinkWeigher
public class GeoDistanceLinkWeight extends java.lang.Object implements LinkWeigher
Link weight for measuring link cost using the geo distance between link vertices as determined by the element longitude/latitude annotation.
-
-
Constructor Summary
Constructors Constructor Description GeoDistanceLinkWeight(DeviceService deviceService)Creates a new link-weight with access to the specified device service.
-
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.
-
-
-
Constructor Detail
-
GeoDistanceLinkWeight
public GeoDistanceLinkWeight(DeviceService deviceService)
Creates a new link-weight with access to the specified device service.- Parameters:
deviceService- device service reference
-
-
Method Detail
-
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
-
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
-
-