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
TNodeIdTEdgeId
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
nodeTNodeId
Returns
- NetworkState<TNodeId, TEdgeId>
Disable(TEdgeId)
Disables the edge, whatever its normal state.
public NetworkState<TNodeId, TEdgeId> Disable(TEdgeId edge)Parameters
edgeTEdgeId
Returns
- NetworkState<TNodeId, TEdgeId>
Enable(TEdgeId)
Enables the edge, whatever its normal state.
public NetworkState<TNodeId, TEdgeId> Enable(TEdgeId edge)Parameters
edgeTEdgeId
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
edgeGraphEdge<TNodeId, TEdgeId>
Returns
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
nodeGraphNode<TNodeId>
Returns
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
edgeGraphEdge<TNodeId, TEdgeId>
Returns
SetDirection(TEdgeId, EdgeDirection)
Sets the direction of the edge instead of its normal direction.
public NetworkState<TNodeId, TEdgeId> SetDirection(TEdgeId edge, EdgeDirection direction)Parameters
edgeTEdgeIddirectionEdgeDirection
Returns
- NetworkState<TNodeId, TEdgeId>
Exceptions
- ArgumentOutOfRangeException
-
directionis not a defined value.
Unblock(TNodeId)
Makes the node passable, whatever its normal state.
public NetworkState<TNodeId, TEdgeId> Unblock(TNodeId node)Parameters
nodeTNodeId
Returns
- NetworkState<TNodeId, TEdgeId>