Interface ISpatialGraphEnvironment
Assembly: Mars.Interfaces.dll
Syntax
public interface ISpatialGraphEnvironment : IGraphEnvironment<ISpatialEdge, ISpatialNode>, IEnvironment, IModelObject, IRoutePlanner
Properties
|
Improve this Doc
View Source
BoundingBox
The calculated Bounding Box of the spatial environment based on the GeoCoordinates
within the nodes
Declaration
BoundingBox BoundingBox { get; }
Property Value
|
Improve this Doc
View Source
Entities
Gets a Dictionary containing all agents.
Declaration
IDictionary<ISpatialGraphEntity, IGraphEntity> Entities { get; }
Property Value
|
Improve this Doc
View Source
Modalities
Holds all
SpatialModalityType
s that occur in the environments lanes.
Declaration
ISet<SpatialModalityType> Modalities { get; }
Property Value
|
Improve this Doc
View Source
Options
Gets the used settings for this environment, with inputs,
index configurations and modality restrictions.
Declaration
SpatialGraphOptions Options { get; }
Property Value
Methods
|
Improve this Doc
View Source
Explore(ISpatialGraphEntity, Route, Double, Boolean, ExploreDirection)
Explores multiple edges in front of an entity on forward, backward
or both directions up to the requested distance.
Declaration
SpatialGraphExploreResult Explore(ISpatialGraphEntity entity, Route route, double distance, bool onlyNext = true, ExploreDirection direction = ExploreDirection.Forward)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The already inserted entity in the environment from which to start the query. |
Route |
route |
The route with edges that shall be explored along the path. |
System.Double |
distance |
The distance in meter up to which the explore should go. |
System.Boolean |
onlyNext |
The flag, when true, indicating that only the first explored entity of each edge and
lane shall be returned an nothing more what could also behind the explored one.
|
ExploreDirection |
direction |
The direction whether forward, backward or in both shall be queried for other entities. |
Returns
|
Improve this Doc
View Source
ExploreLazy(ISpatialGraphEntity, Route, Double, ExploreDirection)
Performs a lazy
exploration query on the network with the route
given as the path where along all
entities
within the exploration distance
in meter shall be returned. The exploration is started from the point the
input
entity
and does not include it.
Declaration
IEnumerable<EdgeExploreResult> ExploreLazy(ISpatialGraphEntity entity, Route route, double distance, ExploreDirection direction = ExploreDirection.Forward)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The entity from which to start the exploration. |
Route |
route |
The route with edges and lanes along to explore |
System.Double |
distance |
The distance in meter how far shall be looked. |
ExploreDirection |
direction |
The direction whether forward, backward or in both shall be queried for other entities. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<EdgeExploreResult> |
Returns an System.Collections.Generic.IEnumerable<T> of EdgeExploreResult which are collected lazy
only when an access on the element is required.
|
|
Improve this Doc
View Source
Insert(ISpatialGraphEntity, ISpatialEdge, Double, Int32)
Insert an entity
at the specified edge with the offset (Default is zero) in the environment
and assign them the spatial position of this edge + offset
.
Declaration
bool Insert(ISpatialGraphEntity entity, ISpatialEdge edge, double offset = 0, int lane = 0)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The entity to insert into the environment. |
ISpatialEdge |
edge |
The edge at which the agent shall be inserted. |
System.Double |
offset |
The position offset in meter on the specified edge specifying
at which distance to the source the entity shall be inserted.
|
System.Int32 |
lane |
The lane index on which lane the entity shall be inserted |
Returns
Type |
Description |
System.Boolean |
Returns true if the agent could be inserted or false otherwise
(e.g., caused by collisions with other entities).
|
|
Improve this Doc
View Source
Insert(ISpatialGraphEntity, ISpatialNode)
Inserts an entity
at the specified node in the environment
and assign them the spatial position of this node
and
no edge and zero edge offset.
Declaration
bool Insert(ISpatialGraphEntity entity, ISpatialNode node)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The entity to insert into the environment. |
ISpatialNode |
node |
The node at which the agent shall be inserted in inherit the spatial position. |
Returns
Type |
Description |
System.Boolean |
Returns true if the agent was inserted or false otherwise.
|
|
Improve this Doc
View Source
Move(ISpatialGraphEntity, Route, Double)
Move an
entity
forward using the specified edges and lanes on them
and updates the
ISpatialGraphEntitys respective attributes.
Declaration
bool Move(ISpatialGraphEntity entity, Route route, double distance)
Parameters
Type |
Name |
Description |
ISpatialGraphEntity |
entity |
The entity to be moved |
Route |
route |
The entities route depicting the edge stops and lanes the instance desired. |
System.Double |
distance |
The distance how fare the agents want to move. |
Returns
Type |
Description |
System.Boolean |
Returns true when a movement action was successfully and the entity has been updated. |
|
Improve this Doc
View Source
NearestNode(Position, Nullable<SpatialModalityType>, Nullable<SpatialModalityType>, Double)
Resolve the passed
position
and returns the nearest
ISpatialNode.
Declaration
ISpatialNode NearestNode(Position position, SpatialModalityType? incomingModality = null, SpatialModalityType? outgoingModality = null, double radiusInMeter = 1.7976931348623157E+308)
Parameters
Type |
Name |
Description |
Position |
position |
The coordinate to resolve |
System.Nullable<SpatialModalityType> |
incomingModality |
Filters nodes to only those that have given modality in incoming edges. |
System.Nullable<SpatialModalityType> |
outgoingModality |
Filters nodes to only those that have given modality in outgoing edges. |
System.Double |
radiusInMeter |
The radius to lookup in meter, Default is infinity |
Returns
|
Improve this Doc
View Source
NearestNodes(Position, Double, Nullable<Int32>)
Resolve the passed
coordinate
and returns the nearest
ISpatialNode.
Declaration
IEnumerable<ISpatialNode> NearestNodes(Position coordinate, double radiusInMeter = 1.7976931348623157E+308, int? limit = null)
Parameters
Type |
Name |
Description |
Position |
coordinate |
The coordinate to resolve |
System.Double |
radiusInMeter |
The radius to lookup in meter, Default is infinity |
System.Nullable<System.Int32> |
limit |
The optional upper limit of element to retrieve from the network
otherwise the maximum available element set will be returned.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ISpatialNode> |
Returns the nearest ISpatialNode in the graph or null if nothing was found.. |
|
Improve this Doc
View Source
Remove(ISpatialGraphEntity)
Remove an entity from the environment and updates their
PositionOnCurrentEdge
CurrentEdge
attributes accordingly.
Declaration
bool Remove(ISpatialGraphEntity entity)
Parameters
Returns
Type |
Description |
System.Boolean |
True if agent could be removed (was in the spatial graph environment
false if the agent wasn't in the spatial graph environment.
|
|
Improve this Doc
View Source
Traverse(ISpatialNode, Action<ISpatialNode>, Int32)
Walks through the graph by applying the iterative deepening search
in which the benefits of BFS by visiting all nodes ordered by their hop/edge count and
DFS in which the maximum space consumption is O(n * t), than O(n^t+1)
Declaration
void Traverse(ISpatialNode start, Action<ISpatialNode> callback, int depth = -1)
Parameters
Type |
Name |
Description |
ISpatialNode |
start |
The starting node. |
System.Action<ISpatialNode> |
callback |
The callback function which is invoked when a new ISpatialNode is visited. |
System.Int32 |
depth |
The optional amount of hops or rather depth traverse into. Default is -1 for no restriction. |
Extension Methods