Class DefaultWeightHandler
A default weight handler.
Inherited Members
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
Infinite
Returns the weight that represents 'infinite'.
Declaration
public override sealed float Infinite { get; }
Property Value
System.Single
|
Overrides
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
Zero
Returns the weight that represents 'zero'.
Declaration
public override sealed float Zero { get; }
Property Value
System.Single
|
Overrides
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
|