Table of Contents

Class NetworkState<TNodeId, TEdgeId>

Namespace
SpatialNET.Network
Assembly
SpatialNET.Network.dll

Deviations from the normal switching state for one or more searches, kept in small sets (ADR 0049): "switch 4711 is open today". The network itself does not change.

public sealed class NetworkState<TNodeId, TEdgeId> : INetworkState<TNodeId, TEdgeId> where TNodeId : notnull, IEquatable<TNodeId> where TEdgeId : notnull, IEquatable<TEdgeId>

Type Parameters

TNodeId
TEdgeId

Inheritance

Implements

Inherited Members

Remarks

Not thread-safe while it is changed; reading it from several searches at once is safe.

Methods

Block(TNodeId)

Blocks the node, whatever its normal state.

public NetworkState<TNodeId, TEdgeId> Block(TNodeId node)

Parameters

node TNodeId

Returns

NetworkState<TNodeId, TEdgeId>

Disable(TEdgeId)

Disables the edge, whatever its normal state.

public NetworkState<TNodeId, TEdgeId> Disable(TEdgeId edge)

Parameters

edge TEdgeId

Returns

NetworkState<TNodeId, TEdgeId>

Enable(TEdgeId)

Enables the edge, whatever its normal state.

public NetworkState<TNodeId, TEdgeId> Enable(TEdgeId edge)

Parameters

edge TEdgeId

Returns

NetworkState<TNodeId, TEdgeId>

GetDirection(in GraphEdge<TNodeId, TEdgeId>)

The direction in which the edge may be walked. The normal state is SpatialNET.Network.GraphEdge`2.Direction.

public EdgeDirection GetDirection(in GraphEdge<TNodeId, TEdgeId> edge)

Parameters

edge GraphEdge<TNodeId, TEdgeId>

Returns

EdgeDirection

IsBlocked(in GraphNode<TNodeId>)

Whether the node is blocked: reached, but not passed. The normal state is SpatialNET.Network.GraphNode`1.Blocked.

public bool IsBlocked(in GraphNode<TNodeId> node)

Parameters

node GraphNode<TNodeId>

Returns

bool

IsDisabled(in GraphEdge<TNodeId, TEdgeId>)

Whether the edge is disabled: it does not exist for the search. The normal state is SpatialNET.Network.GraphEdge`2.Disabled.

public bool IsDisabled(in GraphEdge<TNodeId, TEdgeId> edge)

Parameters

edge GraphEdge<TNodeId, TEdgeId>

Returns

bool

SetDirection(TEdgeId, EdgeDirection)

Sets the direction of the edge instead of its normal direction.

public NetworkState<TNodeId, TEdgeId> SetDirection(TEdgeId edge, EdgeDirection direction)

Parameters

edge TEdgeId
direction EdgeDirection

Returns

NetworkState<TNodeId, TEdgeId>

Exceptions

ArgumentOutOfRangeException

direction is not a defined value.

Unblock(TNodeId)

Makes the node passable, whatever its normal state.

public NetworkState<TNodeId, TEdgeId> Unblock(TNodeId node)

Parameters

node TNodeId

Returns

NetworkState<TNodeId, TEdgeId>