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 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.
-
-
-
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: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
-
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
-
-