Class WeightDefinition
- Namespace
- SpatialNET.Network
- Assembly
- SpatialNET.Network.dll
A weight that a search can use (ADR 0049). The values are on the edges (SpatialNET.Network.GraphEdge`2.Weights); the cost of a path is the sum of the costs of its edges. Units are converted by the host.
public sealed record WeightDefinition : IEquatable<WeightDefinition>Inheritance
Implements
Inherited Members
Constructors
WeightDefinition(int, string, WeightKind, double?)
A weight that a search can use (ADR 0049). The values are on the edges (SpatialNET.Network.GraphEdge`2.Weights); the cost of a path is the sum of the costs of its edges. Units are converted by the host.
public WeightDefinition(int Id, string Name, WeightKind Kind, double? Fallback = null)Parameters
Idint-
The id that the values on the edges refer to.
Namestring-
The name, for messages.
KindWeightKind-
How a value turns into a cost.
Fallbackdouble?-
The value for an edge without a value of this weight; without a fallback such an edge is an SpatialNET.Network.InvalidGraphException when a search reaches it.
Properties
Fallback
The value for an edge without a value of this weight; without a fallback such an edge is an SpatialNET.Network.InvalidGraphException when a search reaches it.
public double? Fallback { get; init; }Property Value
Id
The id that the values on the edges refer to.
public int Id { get; init; }Property Value
Kind
How a value turns into a cost.
public WeightKind Kind { get; init; }Property Value
Length
The built-in weight "length": the cost of an edge is its length.
public static WeightDefinition Length { get; }Property Value
Name
The name, for messages.
public string Name { get; init; }