Class WeightHandler
A weight handler.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class WeightHandler : WeightHandler<Weight>
Constructors
WeightHandler(Func<UInt16, FactorAndSpeed>)
Creates a new weight handler.
Declaration
public WeightHandler(Func<ushort, FactorAndSpeed> getFactorAndSpeed)
Parameters
|
Func<System.UInt16, FactorAndSpeed>
getFactorAndSpeed
|
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 Weight Infinite { get; }
Property Value
|
Weight
|
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 Weight Zero { get; }
Property Value
|
Weight
|
Overrides
Methods
Add(Weight, Weight)
Adds the two weights.
Declaration
public override sealed Weight Add(Weight weight1, Weight weight2)
Parameters
|
Weight
weight1
|
|
Weight
weight2
|
Returns
|
Weight
|
Overrides
Add(Weight, UInt16, Single, out Factor)
Adds to the given weight based on the given edge profile and distance.
Declaration
public override sealed Weight Add(Weight weight, ushort edgeProfile, float distance, out Factor factor)
Parameters
|
Weight
weight
|
|
System.UInt16
edgeProfile
|
|
System.Single
distance
|
|
Factor
factor
|
Returns
|
Weight
|
Overrides
AddEdge(DirectedDynamicGraph, UInt32, UInt32, Nullable<Boolean>, Weight)
Adds a new edge to a graph with the given direction and weight.
Declaration
public override sealed void AddEdge(DirectedDynamicGraph graph, uint vertex1, uint vertex2, bool ? direction, Weight weight)
Parameters
|
DirectedDynamicGraph
graph
|
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.Nullable<System.Boolean>
direction
|
|
Weight
weight
|
Overrides
AddEdge(DirectedMetaGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Weight)
Adds a new edge to a graph with the given direction and weight.
Declaration
public override sealed void AddEdge(DirectedMetaGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, Weight weight)
Parameters
|
DirectedMetaGraph
graph
|
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.UInt32
contractedId
|
|
System.Nullable<System.Boolean>
direction
|
|
Weight
weight
|
Overrides
AddOrUpdateEdge(DirectedDynamicGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Weight, UInt32[], UInt32[])
Adds or updates and edge.
Declaration
public override void AddOrUpdateEdge(DirectedDynamicGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, Weight weight, uint[] s1, uint[] s2)
Parameters
|
DirectedDynamicGraph
graph
|
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.UInt32
contractedId
|
|
System.Nullable<System.Boolean>
direction
|
|
Weight
weight
|
|
System.UInt32[]
s1
|
|
System.UInt32[]
s2
|
Overrides
AddOrUpdateEdge(DirectedMetaGraph, UInt32, UInt32, UInt32, Nullable<Boolean>, Weight)
Adds or updates and edge.
Declaration
public override void AddOrUpdateEdge(DirectedMetaGraph graph, uint vertex1, uint vertex2, uint contractedId, bool ? direction, Weight weight)
Parameters
|
DirectedMetaGraph
graph
|
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.UInt32
contractedId
|
|
System.Nullable<System.Boolean>
direction
|
|
Weight
weight
|
Overrides
AddPathTree(PathTree, UInt32, Weight, UInt32)
Adds the given vertex and weight to the path tree.
Declaration
public override sealed uint AddPathTree(PathTree tree, uint vertex, Weight weight, uint previous)
Parameters
|
PathTree
tree
|
|
System.UInt32
vertex
|
|
Weight
weight
|
|
System.UInt32
previous
|
Returns
|
System.UInt32
|
Overrides
Calculate(UInt16, Single, out Factor)
Calculates the weight for the given edge.
Declaration
public override sealed Weight Calculate(ushort edgeProfile, float distance, out Factor factor)
Parameters
|
System.UInt16
edgeProfile
|
|
System.Single
distance
|
|
Factor
factor
|
Returns
|
Weight
|
Overrides
CalculateWeightAndDir(UInt16, Single)
Calculates the weight and direction for the given edge profile.
Declaration
public override sealed WeightAndDir<Weight> CalculateWeightAndDir(ushort edgeProfile, float distance)
Parameters
|
System.UInt16
edgeProfile
|
|
System.Single
distance
|
Returns
|
WeightAndDir<Weight>
|
Overrides
CalculateWeightAndDir(UInt16, Single, out Boolean)
Calculates the weight and direction for the given edge profile.
Declaration
public override sealed WeightAndDir<Weight> CalculateWeightAndDir(ushort edgeProfile, float distance, out bool accessible)
Parameters
|
System.UInt16
edgeProfile
|
|
System.Single
distance
|
|
System.Boolean
accessible
|
Returns
|
WeightAndDir<Weight>
|
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 Weight GetEdgeWeight(DirectedDynamicGraph.EdgeEnumerator edge, out bool ? direction)
Parameters
|
DirectedDynamicGraph.EdgeEnumerator
edge
|
|
System.Nullable<System.Boolean>
direction
|
Returns
|
Weight
|
Overrides
GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator)
Gets the weight from the given edge and sets the direction.
Declaration
public override sealed WeightAndDir<Weight> GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator edge)
Parameters
|
DirectedMetaGraph.EdgeEnumerator
edge
|
Returns
|
WeightAndDir<Weight>
|
Overrides
GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator, out Nullable<Boolean>)
Gets the weight from the given edge and sets the direction.
Declaration
public override sealed Weight GetEdgeWeight(DirectedMetaGraph.EdgeEnumerator edge, out bool ? direction)
Parameters
|
DirectedMetaGraph.EdgeEnumerator
edge
|
|
System.Nullable<System.Boolean>
direction
|
Returns
|
Weight
|
Overrides
GetEdgeWeight(DynamicEdge, out Nullable<Boolean>)
Gets the weight from the given edge and sets the direction.
Declaration
public override sealed Weight GetEdgeWeight(DynamicEdge edge, out bool ? direction)
Parameters
|
DynamicEdge
edge
|
|
System.Nullable<System.Boolean>
direction
|
Returns
|
Weight
|
Overrides
GetEdgeWeight(MetaEdge)
Gets the weight from the given edge and sets the direction.
Declaration
public override sealed WeightAndDir<Weight> GetEdgeWeight(MetaEdge edge)
Parameters
|
MetaEdge
edge
|
Returns
|
WeightAndDir<Weight>
|
Overrides
GetEdgeWeight(MetaEdge, out Nullable<Boolean>)
Gets the weight from the given edge and sets the direction.
Declaration
public override sealed Weight GetEdgeWeight(MetaEdge edge, out bool ? direction)
Parameters
|
MetaEdge
edge
|
|
System.Nullable<System.Boolean>
direction
|
Returns
|
Weight
|
Overrides
GetMetric(Weight)
Gets the metric for the given weight.
Declaration
public override sealed float GetMetric(Weight weight)
Parameters
|
Weight
weight
|
Returns
|
System.Single
|
Overrides
GetPathTree(PathTree, UInt32, out UInt32, out Weight, out UInt32)
Gets the path tree.
Declaration
public override sealed void GetPathTree(PathTree tree, uint pointer, out uint vertex, out Weight weight, out uint previous)
Parameters
|
PathTree
tree
|
|
System.UInt32
pointer
|
|
System.UInt32
vertex
|
|
Weight
weight
|
|
System.UInt32
previous
|
Overrides
IsSmallerThanAny(Weight, Weight)
Returns true if the given weight is smaller than all of fields in max.-
Declaration
public override sealed bool IsSmallerThanAny(Weight weight, Weight max)
Parameters
|
Weight
weight
|
|
Weight
max
|
Returns
|
System.Boolean
|
Overrides
Subtract(Weight, Weight)
Subtracts the given weights.
Declaration
public override sealed Weight Subtract(Weight weight1, Weight weight2)
Parameters
|
Weight
weight1
|
|
Weight
weight2
|
Returns
|
Weight
|