Class Route
Represents the common route object keeping all path information's of
an individual ISpatialGraphEnvironment entity.
Implements
IEquatable<Route>
Namespace: Mars.Interfaces.Environments
Assembly: Mars.Interfaces.dll
Syntax
public sealed class Route : IEnumerable<EdgeStop>, IEquatable<Route>
Constructors
Route(Route)
Declaration
public Route(Route route)
Parameters
Type | Name | Description |
---|---|---|
Route | route | The route from which to create new one. |
Route(Boolean)
Creates an empty route without any stops.
Declaration
public Route(bool useGabBuffer = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useGabBuffer |
Properties
Count
Gets the amount of stops of this route.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Goal
The goal position of the route.
Declaration
public Position Goal { get; }
Property Value
Type | Description |
---|---|
Position |
GoalReached
Gets the flag indicating whether the goal on this route was reached when the corresponding
edge
, the desired lane
and the position
on this edge has been arrived.
Declaration
public bool GoalReached { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Int32]
Gets the EdgeStop at the desired index.
When moving actions was already be performed this access
will give the current not passed stop.
Declaration
public EdgeStop this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the rest route. |
Property Value
Type | Description |
---|---|
EdgeStop |
PassedStops
Gets the rest amount of stops to pass to reach the goal.
Declaration
public int PassedStops { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
RemainingRouteDistanceToGoal
Gets the rest distance to pass until the goal is reached on the last EdgeStop.
Declaration
public double RemainingRouteDistanceToGoal { get; }
Property Value
Type | Description |
---|---|
System.Double |
RouteLength
Gets the whole length of this route from start to end.
Declaration
public double RouteLength { get; }
Property Value
Type | Description |
---|---|
System.Double |
Stops
The ordered path of all stops, planed by the routing component.
Declaration
public IList<EdgeStop> Stops { get; }
Property Value
Type | Description |
---|---|
IList<EdgeStop> |
Methods
Add(ISpatialEdge, Int32)
Adds a new edge stop to the route
Declaration
public void Add(ISpatialEdge edge, int lane = null)
Parameters
Type | Name | Description |
---|---|---|
ISpatialEdge | edge | The underlying road segment |
System.Int32 | lane | The lane which shall be used. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<EdgeStop> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<EdgeStop> | An enumerator that can be used to iterate through the collection of EdgeStop. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current route. |
InsertFirst(ISpatialEdge, Int32, Nullable<DirectionType>)
Inserts a new edge to the beginning of the route.
Declaration
public void InsertFirst(ISpatialEdge edge, int lane = null, DirectionType? directionType = null)
Parameters
Type | Name | Description |
---|---|---|
ISpatialEdge | edge | The underlying road segment |
System.Int32 | lane | The lane which shall be used. |
System.Nullable<DirectionType> | directionType | The direction to take (up, down, ...) |
JumpToGoal()
Directly finished the route and move to goal.
Declaration
public void JumpToGoal()
Implements
IEquatable<>