Interface ISpatialEdge
Inherited Members
System.Collections.Generic.IEqualityComparer<Mars.Interfaces.Environments.IGraphEntity>.Equals(Mars.Interfaces.Environments.IGraphEntity, Mars.Interfaces.Environments.IGraphEntity)
System.Collections.Generic.IEqualityComparer<Mars.Interfaces.Environments.IGraphEntity>.GetHashCode(Mars.Interfaces.Environments.IGraphEntity)
Assembly: Mars.Interfaces.dll
Syntax
public interface ISpatialEdge : IEdge<ISpatialEdge, ISpatialNode>, IGraphEntity, IEqualityComparer<IGraphEntity>
Properties
|
Improve this Doc
View Source
Entities
List of entities on this edge
Declaration
IReadOnlyCollection<ISpatialGraphEntity> Entities { get; }
Property Value
|
Improve this Doc
View Source
Geometry
Gets or sets the geometry data which is represented by a sequence of geographic coordinates
to represent e.g., curves on a road.
Declaration
Position[] Geometry { get; }
Property Value
|
Improve this Doc
View Source
GeometryLength
Gets the line with each element representing the length until this point.
This collection is a helper collection for Geometry
Declaration
int[] GeometryLength { get; }
Property Value
Type |
Description |
System.Int32[] |
|
|
Improve this Doc
View Source
HighwayType
Gets or sets the highway kind of this road segment.
Declaration
HighwayType HighwayType { get; }
Property Value
|
Improve this Doc
View Source
LaneCount
Gets or set the maximum
amount of lanes on this segment.
When the lane count is being set all remaining entities will be removed.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Lanes
Gets the lanes of this road edge.
Declaration
IEnumerable<ISpatialLane> Lanes { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<ISpatialLane> |
|
|
Improve this Doc
View Source
Length
Gets or sets the edge length
When the length is being set all remaining entities will be removed.
Declaration
double Length { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
MaxSpeed
Gets or sets the max speed to pass this edge in meter per seconds
.
Declaration
double MaxSpeed { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Modalities
Gets or sets the modalities, identified as string to distinguish imported multiple graphs.
Declaration
ISet<SpatialModalityType> Modalities { get; }
Property Value
|
Improve this Doc
View Source
ModalityLaneRanges
Declaration
IDictionary<SpatialModalityType, (int, int)> ModalityLaneRanges { get; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<SpatialModalityType, System.ValueTuple<System.Int32, System.Int32>> |
|
|
Improve this Doc
View Source
TravelTime
Gets the static
travel time in seconds
required to cross this edge
when the max-speed restrictions and the length are considered.
Declaration
double TravelTime { get; }
Property Value
Type |
Description |
System.Double |
|
Methods
|
Improve this Doc
View Source
Clear()
Removes all entities on this edge.
Declaration
|
Improve this Doc
View Source
Explore(ISpatialGraphEntity, Double, ISpatialEdge)
Explore the entities surroundings
Declaration
EdgeExploreResult Explore(ISpatialGraphEntity entity, double distance = 10, ISpatialEdge nextEdge = null)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
the entity around the explore takes place |
System.Double |
distance |
determines which objects the entity see's
objects that are farer ahead than "distance" will not be returned
|
ISpatialEdge |
nextEdge |
the next edge the entity will move to after
traversing the current edge
|
Returns
Type |
Description |
EdgeExploreResult |
an edge explore result which contains the found entities |
|
Improve this Doc
View Source
Explore(ISpatialGraphEntity, Double, Boolean, ExploreDirection, ISpatialEdge, Int32[])
Explore the entities surrounded entities for a specified
distance
in meters and a selected set of lanes
or the whole
ISpatialEdge if nothing was defined. Explored entities will be returned grouped by lane
in the
EdgeExploreResult and ordered by the
distance
to the outgoing source
entity
.
Declaration
EdgeExploreResult Explore(ISpatialGraphEntity entity, double distance, bool onlyNext, ExploreDirection direction = ExploreDirection.Forward, ISpatialEdge nextEdge = null, params int[] lanes)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The outgoing entity specifying the source the exploration. |
System.Double |
distance |
The exploration distance in meters. |
System.Boolean |
onlyNext |
The flag indicating that no the entity behind another
one with different position shall be explored.
Default is false so that each entity also them behind the next one will be collected.
|
ExploreDirection |
direction |
The direction of the exploration. Default is forward same direction as the edge. |
ISpatialEdge |
nextEdge |
The next edge the entity will move to after traversing the current edge. |
System.Int32[] |
lanes |
The selected lanes to explore as indices, starting with 0.
If no lane was passed each lane will be queried.
|
Returns
Type |
Description |
EdgeExploreResult |
An EdgeExploreResult containing a grouping of explores by each lane.
Each lane exploration is ordered by the distance of the object to the source.
|
|
Improve this Doc
View Source
Explore(Double, Double, Boolean, ExploreDirection, ISpatialEdge, Int32[])
Explore the entities surrounded entities for a specified
distance
in meters and a selected set of lanes
or the whole
ISpatialEdge if nothing was defined. Explored entities will be returned grouped by lane
in the
EdgeExploreResult and ordered by the
distance
to the outgoing source
entity
.
Declaration
EdgeExploreResult Explore(double position, double distance, bool onlyNext, ExploreDirection direction = ExploreDirection.Forward, ISpatialEdge nextEdge = null, params int[] lanes)
Parameters
Type |
Name |
Description |
System.Double |
position |
The outgoing source position on the edge. |
System.Double |
distance |
The exploration distance in meters. |
System.Boolean |
onlyNext |
The flag indicating that no the entity behind another
one with different position shall be explored.
Default is false so that each entity also them behind the next one will be collected.
|
ExploreDirection |
direction |
The direction of the exploration. Default is forward same direction as the edge. |
ISpatialEdge |
nextEdge |
The next edge the entity will move to after traversing the current edge. |
System.Int32[] |
lanes |
The selected lanes to explore as indices, starting with 0.
If no lane was passed each lane will be queried.
|
Returns
Type |
Description |
EdgeExploreResult |
An EdgeExploreResult containing a grouping of explores by each lane.
Each lane exploration is ordered by the distance of the object to the source.
|
|
Improve this Doc
View Source
ExploreInLaneOnEdge(ISpatialGraphEntity, Double)
Explore the entities surroundings
Declaration
int ExploreInLaneOnEdge(ISpatialGraphEntity entity, double distance = 15)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
the entity around the explore takes place |
System.Double |
distance |
determines which objects the entity see's
objects that are farer ahead than "distance" will not be returned
|
Returns
Type |
Description |
System.Int32 |
Returns the count of Agents in front of given entity |
|
Improve this Doc
View Source
Insert(ISpatialGraphEntity, Double, Int32)
Add an entity to the edge
Declaration
bool Insert(ISpatialGraphEntity entity, double position, int laneIndex)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
the respective entity to insert |
System.Double |
position |
the position it should be inserted |
System.Int32 |
laneIndex |
the lane it should be inserted |
Returns
Type |
Description |
System.Boolean |
true -> entity was inserted at desired position and lane
false -> the entity was already on the edge
or the desired position is already occupied
or the desired position is ahead of another entity
which would result in an unwanted overtaking maneuver
|
|
Improve this Doc
View Source
IsLaneFree(Int32)
Find out if a certain lane is free (no entities on)
Declaration
bool IsLaneFree(int lane)
Parameters
Type |
Name |
Description |
System.Int32 |
lane |
the lane to be checked |
Returns
Type |
Description |
System.Boolean |
true or false, depending whether there is an entity or not |
|
Improve this Doc
View Source
Move(ISpatialGraphEntity, Double, Int32)
Move an entity on the edge
Declaration
bool Move(ISpatialGraphEntity entity, double distance, int desiredLane)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
the entity to move |
System.Double |
distance |
the distance the entity shall be moved forth |
System.Int32 |
desiredLane |
the lane the entities wants to move on. This can either
be his current lane which or another lane (overtaking maneuver)
|
Returns
Type |
Description |
System.Boolean |
an edge move results which contains information about the movement
like a success statement and the entities new position (if successfully)
|
|
Improve this Doc
View Source
PosAt(ISpatialGraphEntity, Double, Int32)
Position an entity on a specific spot on the edge. Check if there is enough space for the entity to fit
there and only position him then. Otherwise (not enough space) the positioning fails
Declaration
bool PosAt(ISpatialGraphEntity entity, double position, int desiredLaneIndex)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The entity to be put on the new position |
System.Double |
position |
The position the entity wants to be put |
System.Int32 |
desiredLaneIndex |
The lane in which the entity wants to be positioned |
Returns
Type |
Description |
System.Boolean |
Returns true if there was enough space available and the positioning was successful otherwise false.
|
|
Improve this Doc
View Source
Remove(ISpatialGraphEntity)
Remove an entity from the edge and from the respective lane
Declaration
bool Remove(ISpatialGraphEntity entity)
Parameters
Returns
Type |
Description |
System.Boolean |
true -> entity was removed
false -> entity wasn't on the edge
or the remove failed
|
Extension Methods