Class CartesianRoutingService<TObstacle>
The
CartesianRoutingService
can find a shortest route between points by using the generated
routing points as supporting points for its route search.
Inheritance
System.Object
CartesianRoutingService<TObstacle>
Namespace: Mars.Components.Environments.Cartesian.Routing
Assembly: Mars.Components.dll
Syntax
public class CartesianRoutingService<TObstacle> : object where TObstacle : IObstacle
Type Parameters
Name | Description |
---|---|
TObstacle |
Constructors
CartesianRoutingService(BoundingBox, IDictionary<TObstacle, Geometry>, IRoutingPointsGenerator, Int32)
Creates the routing service.
Declaration
public CartesianRoutingService(BoundingBox boundingBox, IDictionary<TObstacle, Geometry> obstacles, IRoutingPointsGenerator pointsGenerator, int edgesPerNode = 10)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | boundingBox | Describes the spatial extent. |
IDictionary<TObstacle, Geometry> | obstacles | Holds all obstacles that may influence the route. |
IRoutingPointsGenerator | pointsGenerator | Generates supporting points for the route searching graph. |
System.Int32 | edgesPerNode | Defines the density of the route searching graph. |
Methods
FindRoute(ICharacter, Position)
Finds a route of routing positions from start to goal.
Declaration
public IEnumerable<Position> FindRoute(ICharacter character, Position goal)
Parameters
Type | Name | Description |
---|---|---|
ICharacter | character | The characters position is used as start point for the route search. The start point is not included in the result. The character might be used to check if obstacles can be passed. |
Position | goal | Goal position for the route search. Is included in the result. |
Returns
Type | Description |
---|---|
IEnumerable<Position> | An enumerable of positions that lead to the goal avoiding collisions with geometries. |
ToGeoJson()
Declaration
public string ToGeoJson()
Returns
Type | Description |
---|---|
System.String |