Show / Hide Table of Contents

Class DefaultWeightHandler

A default weight handler.

Inheritance
System.Object
WeightHandler<System.Single>
DefaultWeightHandler
Inherited Members
WeightHandler<Single>.GetEdgeWeight(Graph.EdgeEnumerator)
WeightHandler<Single>.GetEdgeWeight(Edge)
WeightHandler<Single>.GetEdgeWeight(RoutingEdge)
WeightHandler<Single>.AddPathTree(PathTree, UInt32, WeightAndDir<Single>, UInt32)
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class DefaultWeightHandler : WeightHandler<float>

Constructors

DefaultWeightHandler(Func<UInt16, Factor>)

Creates a new default weight handler.

Declaration
public DefaultWeightHandler(Func<ushort, Factor> getFactor)
Parameters
Func<System.UInt16, Factor> getFactor

Properties

DynamicSize

Gets the size of the fixed parth in a dynamic directed graph when using this weight.

Declaration
public override sealed int DynamicSize { get; }
Property Value
System.Int32

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.DynamicSize

Infinite

Returns the weight that represents 'infinite'.

Declaration
public override sealed float Infinite { get; }
Property Value
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Infinite

MetaSize

Gets the size of the meta-data in a directed meta graph when using this weight.

Declaration
public override sealed int MetaSize { get; }
Property Value
System.Int32

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.MetaSize

Zero

Returns the weight that represents 'zero'.

Declaration
public override sealed float Zero { get; }
Property Value
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Zero

Methods

Add(Single, Single)

Adds the two weights.

Declaration
public override sealed float Add(float weight1, float weight2)
Parameters
System.Single weight1

System.Single weight2

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Add(System.Single, System.Single)

Add(Single, UInt16, Single, out Factor)

Adds weight to given weight based on the given distance and profile.

Declaration
public override sealed float Add(float weight, ushort edgeProfile, float distance, out Factor factor)
Parameters
System.Single weight

System.UInt16 edgeProfile

System.Single distance

Factor factor

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Add(System.Single, System.UInt16, System.Single, Factor)

AddEdge(DirectedDynamicGraph, UInt32, UInt32, Nullable<Boolean>, Single)

Adds a new edge with the given direction and weight.

Declaration
public override sealed void AddEdge(DirectedDynamicGraph graph, uint vertex1, uint vertex2, bool ? direction, float weight)
Parameters
DirectedDynamicGraph graph

System.UInt32 vertex1

System.UInt32 vertex2

System.Nullable<System.Boolean> direction

System.Single weight

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.AddEdge(DirectedDynamicGraph, System.UInt32, System.UInt32, System.Nullable<System.Boolean>, System.Single)

AddEdge(DirectedMetaGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Single)

Adds a new edge with the given direction and weight.

Declaration
public override sealed void AddEdge(DirectedMetaGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, float weight)
Parameters
DirectedMetaGraph graph

System.UInt32 vertex1

System.UInt32 vertex2

System.UInt32 contractedId

System.Nullable<System.Boolean> direction

System.Single weight

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.AddEdge(DirectedMetaGraph, System.UInt32, System.UInt32, System.UInt32, System.Nullable<System.Boolean>, System.Single)

AddOrUpdateEdge(DirectedDynamicGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Single, UInt32[], UInt32[])

Adds or updates an edge.

Declaration
public override sealed void AddOrUpdateEdge(DirectedDynamicGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, float weight, uint[] s1, uint[] s2)
Parameters
DirectedDynamicGraph graph

System.UInt32 vertex1

System.UInt32 vertex2

System.UInt32 contractedId

System.Nullable<System.Boolean> direction

System.Single weight

System.UInt32[] s1

System.UInt32[] s2

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.AddOrUpdateEdge(DirectedDynamicGraph, System.UInt32, System.UInt32, System.UInt32, System.Nullable<System.Boolean>, System.Single, System.UInt32[], System.UInt32[])

AddOrUpdateEdge(DirectedMetaGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Single)

Adds or updates an edge.

Declaration
public override sealed void AddOrUpdateEdge(DirectedMetaGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, float weight)
Parameters
DirectedMetaGraph graph

System.UInt32 vertex1

System.UInt32 vertex2

System.UInt32 contractedId

System.Nullable<System.Boolean> direction

System.Single weight

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.AddOrUpdateEdge(DirectedMetaGraph, System.UInt32, System.UInt32, System.UInt32, System.Nullable<System.Boolean>, System.Single)

AddPathTree(PathTree, UInt32, Single, UInt32)

Adds a vertex to the path tree.

Declaration
public override uint AddPathTree(PathTree tree, uint vertex, float weight, uint previous)
Parameters
PathTree tree

System.UInt32 vertex

System.Single weight

System.UInt32 previous

Returns
System.UInt32

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.AddPathTree(PathTree, System.UInt32, System.Single, System.UInt32)

Calculate(UInt16, Single, out Factor)

Calculates the weight for the given edge and distance.

Declaration
public override sealed float Calculate(ushort edgeProfile, float distance, out Factor factor)
Parameters
System.UInt16 edgeProfile

System.Single distance

Factor factor

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Calculate(System.UInt16, System.Single, Factor)

CalculateWeightAndDir(UInt16, Single)

Calculates the weight and direction for the given edge profile.

Declaration
public override sealed WeightAndDir<float> CalculateWeightAndDir(ushort edgeProfile, float distance)
Parameters
System.UInt16 edgeProfile

System.Single distance

Returns
WeightAndDir<System.Single>

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.CalculateWeightAndDir(System.UInt16, System.Single)

CalculateWeightAndDir(UInt16, Single, out Boolean)

Calculates the weight and direction for the given edge profile.

Declaration
public override sealed WeightAndDir<float> CalculateWeightAndDir(ushort edgeProfile, float distance, out bool accessible)
Parameters
System.UInt16 edgeProfile

System.Single distance

System.Boolean accessible

Returns
WeightAndDir<System.Single>

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.CalculateWeightAndDir(System.UInt16, System.Single, System.Boolean)

CanUse(ContractedDb)

Returns true if the given contracted db can be used.

Declaration
public override sealed bool CanUse(ContractedDb db)
Parameters
ContractedDb db

Returns
System.Boolean

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.CanUse(ContractedDb)

GetEdgeWeight(DirectedDynamicGraph.EdgeEnumerator, out Nullable<Boolean>)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed float GetEdgeWeight(DirectedDynamicGraph.EdgeEnumerator edge, out bool ? direction)
Parameters
DirectedDynamicGraph.EdgeEnumerator edge

System.Nullable<System.Boolean> direction

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(DirectedDynamicGraph.EdgeEnumerator, System.Nullable<System.Boolean>)

GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed WeightAndDir<float> GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator edge)
Parameters
DirectedMetaGraph.EdgeEnumerator edge

Returns
WeightAndDir<System.Single>

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator)

GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator, out Nullable<Boolean>)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed float GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator edge, out bool ? direction)
Parameters
DirectedMetaGraph.EdgeEnumerator edge

System.Nullable<System.Boolean> direction

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator, System.Nullable<System.Boolean>)

GetEdgeWeight(DynamicEdge, out Nullable<Boolean>)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed float GetEdgeWeight(DynamicEdge edge, out bool ? direction)
Parameters
DynamicEdge edge

System.Nullable<System.Boolean> direction

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(DynamicEdge, System.Nullable<System.Boolean>)

GetEdgeWeight(MetaEdge)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed WeightAndDir<float> GetEdgeWeight(MetaEdge edge)
Parameters
MetaEdge edge

Returns
WeightAndDir<System.Single>

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(MetaEdge)

GetEdgeWeight(MetaEdge, out Nullable<Boolean>)

Gets the weight from the given edge and sets the direction.

Declaration
public override sealed float GetEdgeWeight(MetaEdge edge, out bool ? direction)
Parameters
MetaEdge edge

System.Nullable<System.Boolean> direction

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetEdgeWeight(MetaEdge, System.Nullable<System.Boolean>)

GetMetric(Single)

Gets the actual metric the algorithm should be using to determine shortest paths.

Declaration
public override sealed float GetMetric(float weight)
Parameters
System.Single weight

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetMetric(System.Single)

GetPathTree(PathTree, UInt32, out UInt32, out Single, out UInt32)

Gets a vertex from the path tree.

Declaration
public override void GetPathTree(PathTree tree, uint pointer, out uint vertex, out float weight, out uint previous)
Parameters
PathTree tree

System.UInt32 pointer

System.UInt32 vertex

System.Single weight

System.UInt32 previous

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.GetPathTree(PathTree, System.UInt32, System.UInt32, System.Single, System.UInt32)

IsSmallerThanAny(Single, Single)

Returns true if the given weight is smaller than all of fields in max.-

Declaration
public override sealed bool IsSmallerThanAny(float weight, float max)
Parameters
System.Single weight

System.Single max

Returns
System.Boolean

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.IsSmallerThanAny(System.Single, System.Single)

Subtract(Single, Single)

Subtracts the two weights.

Declaration
public override sealed float Subtract(float weight1, float weight2)
Parameters
System.Single weight1

System.Single weight2

Returns
System.Single

Overrides
Itinero.Algorithms.Weights.WeightHandler<System.Single>.Subtract(System.Single, System.Single)
Back to top Built by Itinero, MIT licensed.