• MARS Website
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Show / Hide Table of Contents
  • Mars.Components
    • DependencyRegistrationModelling
  • Mars.Components.Agents
    • AbstractAgent
    • AbstractEntity
    • Agent
  • Mars.Components.Environments
    • AbstractEnvironment
    • AbstractGraphElement
    • AlwaysPassingNodeGuard
    • EntityLane<TEntity>
    • GeoEnvironment
    • GeoHashEnvironment<T>
    • IEnvironmentMediator
    • IModalChoiceResolver
    • PathHeuristics
    • SpatialEdge
    • SpatialGraphEntityExtensions
    • SpatialGraphEnvironment
    • SpatialGraphHelper
    • SpatialHashEnvironment<TEntity>
    • SpatialLane
    • SpatialNode
    • WorldIndexExtensions
  • Mars.Components.Environments.Cartesian
    • CartesianEnvironment<TEntity>
    • CollisionEnvironment<TCharacter, TObstacle>
    • CollisionKind
    • ConeExplorationView
    • ExplorationView
    • GeometryFactory
    • ICartesianEnvironment<TEntity>
    • ICharacter
    • ICollidable
    • ICollisionEnvironment<TCharacter, TObstacle>
    • IObstacle
    • IVisible
    • RayExplorationView
    • TrapezoidExploration
    • VisibilityKind
  • Mars.Components.Environments.Cartesian.Routing
    • CartesianRoutingService<TObstacle>
    • GeometryCoordinatesRoutingPointsGenerator
    • HomogenousRoutingPointsGenerator
    • IRoutingPointsGenerator
    • RandomRoutingPointsGenerator
    • SectionalRandomRoutingPointsGenerator
  • Mars.Components.Layers
    • AbstractActiveLayer
    • AbstractEnvelopedLayer
    • AbstractLayer
    • AbstractVectorFeature
    • AgentSchedulerLayer<TAgent, TLayer>
    • QuerySourceLoader
    • RasterLayer
    • SchedulerEntry
    • SchedulerLayer
    • VectorFeature
    • VectorLayer
    • VectorLayer<T>
    • VectorLayerHelper
  • Mars.Components.Layers.Temporal
    • IQueryFieldProvider
    • ITemporalObjectCatalog
    • ITemporalObjectIterator
    • TemporalCatalogFeature<TKey>
    • TemporalFeatureKind
    • TemporalMetadataLoader
  • Mars.Components.Services
    • AgentManager
  • Mars.Components.Services.Explorations
    • BoltzmannExploration
    • EpsilonGreedyExploration
    • IExplorationPolicy
    • RouletteWheelExploration
    • TabuSearchExploration
  • Mars.Components.Services.Learning
    • InfiniteQLearning
    • QLearning
    • Sarsa
  • Mars.Components.Services.Planning
    • ActionPlanResult
    • GoapAction
    • GoapAgentStates
    • GoapGoal
    • GoapPlanner
    • GoapStateKey<T>
    • GoapStateProperty
    • GoapStateProperty<TElement>
    • IGoapAction
    • IGoapAgentStates
    • IGoapGoal
    • IGoapPlanner
    • IGoapStateKey
    • StatesCommons
  • Mars.Components.Services.Planning.ActionCommons
    • AllGoalsSatisfiedAction
    • NoGoalReachableAction
  • Mars.Components.Starter
    • Command
    • CommandArgumentContainer
    • CommandParser
    • CommandSet
    • HelpCommand
    • Option
    • OptionContext
    • OptionException
    • OptionSet
    • OptionValueCollection
    • OptionValueType
    • SimulationStarter
  • Mars.Components.Starter.Exceptions
    • SimulationStartupException
  • Mars.Interfaces
    • IModelObject
    • ISimulationContainer
    • ISimulationContext
    • ISimulationModule
    • ISimulationState
    • IStepExecutionContext
    • SimulationContext
    • SimulationContext.WorkflowStateType
    • StepExecutionContext
  • Mars.Interfaces.Agents
    • IAgent
    • IAgent<TLayer>
    • IEntity
    • IMarsDslAgent
    • IModalCapabilitiesAgent
    • ISpatialGraphEntity
    • ITickClient
  • Mars.Interfaces.Annotations
    • ActiveConstructor
    • PropertyDescription
  • Mars.Interfaces.Data
    • AbstractDomainData
    • GeometryData
    • IDomainData
    • IGeometryData
    • IIdentifiableData
    • IMarsFeature
    • IRasterBandData
    • ISource
    • IStringData
    • IStringStructuredData
    • IStructuredData
    • IStructuredDataGeometry
    • IValueData
    • LayerInitData
    • RasterBandData
    • StringDataDto
    • StructuredData
    • VectorStructuredData
  • Mars.Interfaces.Environments
    • BoundingBox
    • DirectionType
    • EdgeExploreResult
    • EdgeStop
    • ExploreDirection
    • GeoPositionExtension
    • HighwayType
    • IEdge<TEdge, TNode>
    • IEntityLane<TEntity>
    • IEnvironment
    • IEnvironment<TEntity>
    • IGeoGridEnvironment<T>
    • IGraphEntity
    • IGraphEnvironment<TEdge, TNode>
    • INode<TEdge, TNode>
    • INodeGuard
    • IPositionable
    • IRoutePlanner
    • ISpatialEdge
    • ISpatialGraphEnvironment
    • ISpatialLane
    • ISpatialNode
    • LaneExploreResult
    • ModalChoice
    • MultimodalRoute
    • NodeIntegrationKind
    • Position
    • Route
    • RouteStop
    • Size
    • SpatialGraphExploreResult
    • SpatialModalityType
    • TrafficLightPhase
  • Mars.Interfaces.Layers
    • FinallySimulationStep
    • IChangingLayer
    • IDataContainer
    • IDataLayer
    • IDataSet
    • IEnvelopDataLayer
    • ILayer
    • IMarsDslLayer
    • IModalChoiceConsumer
    • InitSimulationStep
    • INotifyChangedSource<T>
    • IRaster<TValue>
    • IRasterLayer
    • ISteppedActiveLayer
    • IVectorFeature
    • IVectorLayer
    • IVectorLayer<T>
    • IVectorNode<TEntity>
    • RegisterAgent
    • UnregisterAgent
  • Mars.Interfaces.Model
    • ActiveTypeMapping
    • AgentMapping
    • AgentType
    • ConstructorType
    • ContainsOperator
    • DataContainer
    • DataType
    • EntityMapping
    • EntityType
    • Execution
    • FeatureType
    • Globals
    • IdentifiableElement
    • IndividualMapping
    • Input
    • InputConfiguration
    • LayerMapping
    • LayerType
    • ModelDescription
    • ModelElement
    • ObjectType
    • Output
    • OutputConfiguration
    • OutputFilter
    • OutputKind
    • OutputTargetType
    • ParameterMapping
    • Processing
    • ProcessingConfiguration
    • ProcessingTargetType
    • PropertyType
    • SimulationConfig
    • TimeSpanUnit
    • TimeSpanUnitExtensions
    • TypeElement
    • TypeMapping
  • Mars.Interfaces.Model.Converters
    • CultureConverter
    • SerializationTypeConverter
    • TimeSpanUnitConverter
  • Mars.Interfaces.Model.Exceptions
    • InvalidTypeException
    • MissingTypeException
  • Mars.Interfaces.Model.Options
    • AbstractEndpointOptions
    • AbstractFileOptions
    • AbstractOptions
    • AscOptions
    • CsvOptions
    • GeoJsonOptions
    • MongoOptions
    • MqttOptions
    • PostgresSqlOptions
    • RedisOptions
    • RelationalEndpointOptions
    • SerializationType
    • SocketOutputOptions
    • SpatialGraphOptions
    • SqLiteOptions
    • TripsOptions

Class SpatialGraphEnvironment

The geometric graph environment for entities. Provides exploration and movement queries to change the internal positioning of entities along edges and node. In addition provides a routing component to find paths.
Inheritance
System.Object
SpatialGraphEnvironment
Implements
ISpatialGraphEnvironment
IGraphEnvironment<ISpatialEdge, ISpatialNode>
IEnvironment
IModelObject
IRoutePlanner
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Components.Environments
Assembly: Mars.Components.dll
Syntax
public class SpatialGraphEnvironment : ISpatialGraphEnvironment, IGraphEnvironment<ISpatialEdge, ISpatialNode>, IEnvironment, IModelObject, IRoutePlanner

Constructors

| Improve this Doc View Source

SpatialGraphEnvironment()

Create a new instance of the ISpatialGraphEnvironment which has no source associated to it and where the graph can be constructed by the user itself.
Declaration
public SpatialGraphEnvironment()
| Improve this Doc View Source

SpatialGraphEnvironment(SpatialGraph)

Creates a new SpatialGraphEnvironment from the given underlying network.
Declaration
public SpatialGraphEnvironment(SpatialGraph existingSpatialGraph)
Parameters
Type Name Description
SpatialGraph existingSpatialGraph Existing graph structure.
| Improve this Doc View Source

SpatialGraphEnvironment(Input)

Creates and imports a new SpatialGraphEnvironment from a single source.
Declaration
public SpatialGraphEnvironment(Input import)
Parameters
Type Name Description
Input import The source referencing objects or files.
| Improve this Doc View Source

SpatialGraphEnvironment(SpatialGraphOptions)

Creates and imports a new SpatialGraphEnvironment with a set of graph associated and options specified by the SpatialGraphOptions.
Declaration
public SpatialGraphEnvironment(SpatialGraphOptions options)
Parameters
Type Name Description
SpatialGraphOptions options The options object containing all configurations for the ISpatialGraphEnvironment
Exceptions
Type Condition
System.ArgumentNullException The import is null.
| Improve this Doc View Source

SpatialGraphEnvironment(String)

Create a new instance of the ISpatialGraphEnvironment which uses the passed graphName as the data source and constructs the graph from that.
Declaration
public SpatialGraphEnvironment(string graphName)
Parameters
Type Name Description
System.String graphName The graph file to import from.

Properties

| Improve this Doc View Source

BoundingBox

Gets the bounding box covering the whole network with including the farthest nodes and edges.
Declaration
public BoundingBox BoundingBox { get; set; }
Property Value
Type Description
BoundingBox
| Improve this Doc View Source

Edges

Set of all nodes in the graph
Declaration
[IgnoreMember]
public IDictionary<int, ISpatialEdge> Edges { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, ISpatialEdge>
| Improve this Doc View Source

EdgesInternal

Gets or sets the internal collection of all SpatialEdges used for serialization and deserialization.
Declaration
public IDictionary<int, SpatialEdge> EdgesInternal { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, SpatialEdge>
| Improve this Doc View Source

Entities

Gets all entities stored in this environment
Declaration
[IgnoreMember]
public IDictionary<ISpatialGraphEntity, IGraphEntity> Entities { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<ISpatialGraphEntity, IGraphEntity>
| Improve this Doc View Source

FeatureCollection

Gets the vector feature collection of this network and environment
Declaration
[IgnoreMember]
public FeatureCollection FeatureCollection { get; }
Property Value
Type Description
NetTopologySuite.Features.FeatureCollection
| Improve this Doc View Source

Graph

Gets the underlying graph data model representing the modality network.
Declaration
public SpatialGraph Graph { get; }
Property Value
Type Description
SpatialGraph
| Improve this Doc View Source

Modalities

Holds all
SpatialModalityType
s that occur in the environments lanes.
Declaration
public ISet<SpatialModalityType> Modalities { get; }
Property Value
Type Description
System.Collections.Generic.ISet<SpatialModalityType>
| Improve this Doc View Source

Nodes

Set of all nodes in the graph
Declaration
[IgnoreMember]
public ICollection<ISpatialNode> Nodes { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<ISpatialNode>
| Improve this Doc View Source

NodesInternal

Gets or sets the internal collection of all SpatialNodes used for serialization and deserialization.
Declaration
public IDictionary<int, SpatialNode> NodesInternal { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, SpatialNode>
| Improve this Doc View Source

NodesMap

Gets the mapping of each node index to their concrete node instance.
Declaration
[IgnoreMember]
public IDictionary<int, ISpatialNode> NodesMap { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, ISpatialNode>
| Improve this Doc View Source

NodeTree

Gets all nodes ordered by their geographic position
Declaration
[IgnoreMember]
public K2DTree<int> NodeTree { get; }
Property Value
Type Description
K2DTree<System.Int32>
| Improve this Doc View Source

Options

Gets the used settings for this environment, with inputs, index configurations and modality restrictions.
Declaration
public SpatialGraphOptions Options { get; }
Property Value
Type Description
SpatialGraphOptions
| Improve this Doc View Source

ShortestPathDatabase

Gets or creates the compressed path database when.
Declaration
[IgnoreMember]
public CompressedPathDatabase ShortestPathDatabase { get; set; }
Property Value
Type Description
CompressedPathDatabase
| Improve this Doc View Source

World

Gets or created the node spatial k-NN graph to resolve ISpatialNodes by using NearestNode(Position, Nullable<SpatialModalityType>, Nullable<SpatialModalityType>, Double).
Declaration
[IgnoreMember]
public KnnGraph<double[], double> World { get; set; }
Property Value
Type Description
KnnGraph<System.Double[], System.Double>

Methods

| Improve this Doc View Source

AddEdge(ISpatialNode, ISpatialNode, IDictionary<String, Object>)

Creates a new edge and add references in the affected nodes.
Declaration
public ISpatialEdge AddEdge(ISpatialNode origin, ISpatialNode destination, IDictionary<string, object> attributes = null)
Parameters
Type Name Description
ISpatialNode origin the node where the edge starts.
ISpatialNode destination the node where the edge ends.
System.Collections.Generic.IDictionary<System.String, System.Object> attributes All associated data to this edge e.g., the amount of lanes the length or maximum speed constraints.
Returns
Type Description
ISpatialEdge Returns the new created edge.
| Improve this Doc View Source

AddEdge(ISpatialNode, ISpatialNode, Double, IDictionary<String, Object>, SpatialModalityType)

Create a new edge with specified length overwriting the optional containing attributes and add references in the affected nodes.
Declaration
public ISpatialEdge AddEdge(ISpatialNode origin, ISpatialNode destination, double length, IDictionary<string, object> attributes, SpatialModalityType modalityTypes)
Parameters
Type Name Description
ISpatialNode origin The ISpatialNode where the edge starts.
ISpatialNode destination The ISpatialNode where the edge ends.
System.Double length the length of this edge.
System.Collections.Generic.IDictionary<System.String, System.Object> attributes All associated data to this edge e.g., the amount of lanes the length or maximum speed constraints.
SpatialModalityType modalityTypes The modality types supported by this edge.
Returns
Type Description
ISpatialEdge Returns the newly created ISpatialEdge.
| Improve this Doc View Source

AddEdge(ISpatialNode, ISpatialNode, Double, IDictionary<String, Object>, SpatialModalityType[])

Create a new edge with specified length overwriting the optional containing attributes and add references in the affected nodes.
Declaration
public ISpatialEdge AddEdge(ISpatialNode origin, ISpatialNode destination, double length, IDictionary<string, object> attributes = null, SpatialModalityType[] modalityTypes = null)
Parameters
Type Name Description
ISpatialNode origin The ISpatialNode where the edge starts.
ISpatialNode destination The ISpatialNode where the edge ends.
System.Double length the length of this edge.
System.Collections.Generic.IDictionary<System.String, System.Object> attributes All associated data to this edge e.g., the amount of lanes the length or maximum speed constraints.
SpatialModalityType[] modalityTypes The optional collection of modality types supported by this edge.
Returns
Type Description
ISpatialEdge the newly created edge
| Improve this Doc View Source

AddNode(IDictionary<String, Object>)

Creates a new node and adds it to the set of nodes
Declaration
public ISpatialNode AddNode(IDictionary<string, object> attributes = null)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.Object> attributes All associated data to this edge (e.g., the amount of lanes the length or maximum speed constraints).
Returns
Type Description
ISpatialNode Returns the created ISpatialNode.
| Improve this Doc View Source

AddNode(Double, Double)

Add a new spatial node with specified longitude/x and latitude/y coordinate.
Declaration
public ISpatialNode AddNode(double x, double y)
Parameters
Type Name Description
System.Double x The x or longitude component of the source coordinate.
System.Double y The y or latitude component of the source coordinate.
Returns
Type Description
ISpatialNode Returns a new ISpatialNode with the specified source coordinate.
| 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
public 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
Type Description
SpatialGraphExploreResult Returns a full SpatialGraphExploreResult which includes all explored entities along the path separated by each lane in forward or backward direction.
| 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
public 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

FindFastestRoute(ISpatialNode, ISpatialNode, Func<ISpatialEdge, Boolean>)

Calculates a Route in which the whole length is the fastest (as travel time in seconds) under consideration of max speed. When no route was found null will be returned.
Declaration
public Route FindFastestRoute(ISpatialNode source, ISpatialNode target, Func<ISpatialEdge, bool> filter = null)
Parameters
Type Name Description
ISpatialNode source The source ISpatialNode
ISpatialNode target The target ISpatialNode
System.Func<ISpatialEdge, System.Boolean> filter The edge filter to construct a subgraph based on a condition.
Returns
Type Description
Route Returns a common Route container, containing the path from from to target which is the fastest (travel time) or null when no route was found.
| Improve this Doc View Source

FindRoute(ISpatialNode, ISpatialNode, Func<ISpatialNode, ISpatialEdge, ISpatialNode, Double>, Func<ISpatialEdge, Boolean>)

Calculates a route from a given from node to a specified to node and constructed using the passed heuristic function applying a cost on each visited edge e.g. the length or travel-time. Using the optional filter the whole network can first be filtered out for all edges evaluate to true.
Declaration
public Route FindRoute(ISpatialNode from, ISpatialNode to, Func<ISpatialNode, ISpatialEdge, ISpatialNode, double> heuristic = null, Func<ISpatialEdge, bool> filter = null)
Parameters
Type Name Description
ISpatialNode from INode where the search starts
ISpatialNode to INode where the search ends
System.Func<ISpatialNode, ISpatialEdge, ISpatialNode, System.Double> heuristic The heuristic function which receives an input start node, the actual visited edge associated with from an to and the goal node
System.Func<ISpatialEdge, System.Boolean> filter The subgraph predicate to filter only those next edges which are evaluate to true.
Returns
Type Description
Route Returns a common Route container responsible for all route updates and the underlying path of edges and nodes.
| Improve this Doc View Source

FindShortestHopRoute(ISpatialNode, ISpatialNode, SpatialModalityType)

Calculates a route which has the minimum number of intermediate edge between source and target and is applicable for the specified modality.
Declaration
public Route FindShortestHopRoute(ISpatialNode source, ISpatialNode target, SpatialModalityType modality)
Parameters
Type Name Description
ISpatialNode source The source ISpatialNode node.
ISpatialNode target The target ISpatialNode node.
SpatialModalityType modality The modality network on which to process the calculation.
Returns
Type Description
Route Returns a new Route with minimum amount of intermediate edge or null when no path was found.
| Improve this Doc View Source

FindShortestHopRoute(ISpatialNode, ISpatialNode, Func<ISpatialEdge, Boolean>)

Get a route using iterative deepening depth search
Declaration
public Route FindShortestHopRoute(ISpatialNode source, ISpatialNode target, Func<ISpatialEdge, bool> filter = null)
Parameters
Type Name Description
ISpatialNode source INode<TEdge, TNode> where the search starts
ISpatialNode target INode<TEdge, TNode> where the search ends
System.Func<ISpatialEdge, System.Boolean> filter Predicate to select only subset of edges to find the route on.
Returns
Type Description
Route List of edges on that route
| Improve this Doc View Source

FindShortestRoute(ISpatialNode, ISpatialNode, Func<ISpatialEdge, Boolean>)

Calculates a Route in which the whole length is the shortest to the desired destination or null if no rout to the target was found.
Declaration
public Route FindShortestRoute(ISpatialNode source, ISpatialNode target, Func<ISpatialEdge, bool> filter = null)
Parameters
Type Name Description
ISpatialNode source The source ISpatialNode
ISpatialNode target The target ISpatialNode
System.Func<ISpatialEdge, System.Boolean> filter The edge filter to construct a subgraph based on a condition.
Returns
Type Description
Route Returns a common Route container, containing the path from from to target which is the shortest (minimum length) or null when no route was found.
| Improve this Doc View Source

GetRandomNode()

Returns a random selected nod of this environment. Often be helpful for testing purposes.
Declaration
public ISpatialNode GetRandomNode()
Returns
Type Description
ISpatialNode Returns a concrete ISpatialNode
| Improve this Doc View Source

GetRandomNode(SpatialModalityType)

Returns a random selected node of this environment that is reachable by given modality type.
Declaration
public ISpatialNode GetRandomNode(SpatialModalityType spatialModalityType)
Parameters
Type Name Description
SpatialModalityType spatialModalityType Filter criteria for nodes.
Returns
Type Description
ISpatialNode Returns a concrete ISpatialNode
| 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
public 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)

Insert 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
public 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
public 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
public 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
Type Description
ISpatialNode Returns the nearest ISpatialNode in the graph or null if nothing was found..
| Improve this Doc View Source

NearestNode(Double[], Nullable<SpatialModalityType>, Nullable<SpatialModalityType>, Double)

Resolves the passed position to find the top nearest ISpatialNode within the radiusInMeter.
Declaration
public ISpatialNode NearestNode(double[] position, SpatialModalityType? incomingModality = null, SpatialModalityType? outgoingModality = null, double radiusInMeter = 1.7976931348623157E+308)
Parameters
Type Name Description
System.Double[] position The source position for the query.
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 exploration radius in meter.
Returns
Type Description
ISpatialNode Returns the nearest node within the radiusInMeter or null if nothing was found.
| Improve this Doc View Source

NearestNodes(Position, Double, Nullable<Int32>)

Resolve the passed coordinate and returns the nearest ISpatialNode.
Declaration
public 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

NearestNodesByHops(ISpatialNode, Int32)

Retrieve all nodes within the range of x hops
Declaration
public List<ISpatialNode> NearestNodesByHops(ISpatialNode start, int hops)
Parameters
Type Name Description
ISpatialNode start The node where the traversal starts
System.Int32 hops The number of hops or depth
Returns
Type Description
System.Collections.Generic.List<ISpatialNode> Returns a list of nodes visited one by one ordered by their hop distance, starting with start
| Improve this Doc View Source

Remove(ISpatialGraphEntity)

Remove an entity from the environment and updates their PositionOnCurrentEdge CurrentEdge attributes accordingly.
Declaration
public bool Remove(ISpatialGraphEntity entity)
Parameters
Type Name Description
ISpatialGraphEntity entity The entity to remove.
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

RemoveEdge(ISpatialEdge)

Remove an edge and all references to it from the affected nodes
Declaration
public bool RemoveEdge(ISpatialEdge edge)
Parameters
Type Name Description
ISpatialEdge edge the edge to be removed
Returns
Type Description
System.Boolean true if the edge could be removed false if the removal failed
| Improve this Doc View Source

RemoveNode(ISpatialNode)

Remove a node and delete all edges which are affected by this change
Declaration
public bool RemoveNode(ISpatialNode node)
Parameters
Type Name Description
ISpatialNode node the node to be deleted
Returns
Type Description
System.Boolean true if the node could be deleted false if the node couldn't be deleted
| Improve this Doc View Source

Serialize(Stream)

The geometric graph environment for entities. Provides exploration and movement queries to change the internal positioning of entities along edges and node. In addition provides a routing component to find paths.
Declaration
public void Serialize(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
| 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
public 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.

Implements

ISpatialGraphEnvironment
IGraphEnvironment<TEdge, TNode>
IEnvironment
IModelObject
IRoutePlanner

Extension Methods

Serializer.Save<T>(T, out Byte[], SerializerCompression)
Serializer.Save<T>(T, Stream, SerializerCompression)
Serializer.Save<T>(T, BinaryFormatter, Stream, SerializerCompression)
Serializer.Save<T>(T, String, SerializerCompression)
Serializer.Save<T>(T, String)
Matrix.Concatenate<T>(T, T[])
Matrix.Replace<T>(T, Object, Object)
SpatialGraphHelper.ToGeoJson(ISpatialGraphEnvironment)
WorldIndexExtensions.CreateWorldIndex(ISpatialGraphEnvironment, SpatialGraphOptions)
DomainDataImporter.Import(Object, InputConfiguration)
ObjectSerialize.Serialize(Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg