Table of Contents

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

Id int

The id that the values on the edges refer to.

Name string

The name, for messages.

Kind WeightKind

How a value turns into a cost.

Fallback double?

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

double?

Id

The id that the values on the edges refer to.

public int Id { get; init; }

Property Value

int

Kind

How a value turns into a cost.

public WeightKind Kind { get; init; }

Property Value

WeightKind

Length

The built-in weight "length": the cost of an edge is its length.

public static WeightDefinition Length { get; }

Property Value

WeightDefinition

Name

The name, for messages.

public string Name { get; init; }

Property Value

string