• Documentation
  • 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>
      • SpatialNode
    • 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
      • AbstractDataLayer
      • AbstractLayer
      • AgentSchedulerLayer<TAgent, TLayer>
      • BoundDataSet
      • DisposeBase
      • MatrixRaster
      • QuerySourceLoader
      • Raster
      • Raster<TValue>
      • 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
    • 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
      • IBoundedDataLayer
      • IChangingLayer
      • IDataContainer
      • IDataLayer
      • IDataSet
      • ILayer
      • IMarsDslLayer
      • IModalChoiceConsumer
      • InitSimulationStep
      • INotifyChangedSource<T>
      • IRaster
      • 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 GeoHashEnvironment<T>

    This class provides a geo-based environment with CRS projected to EPSG:4326 (WGS:84). The environment provides a spatial index in which insert, remove, move (update) and query (read) operations are provided, used on conjunction with concrete entity type implementing IPositionable.
    Inheritance
    System.Object
    AbstractEnvironment
    GeoEnvironment
    GeoHashEnvironment<T>
    Implements
    IGeoGridEnvironment<T>
    IEnvironment<T>
    IEnvironment
    IModelObject
    Inherited Members
    GeoEnvironment.DistanceXDirectionInKm
    GeoEnvironment.DistanceYDirectionInKm
    GeoEnvironment.BoundingBox
    GeoEnvironment.LowerLeft
    GeoEnvironment.UpperRight
    GeoEnvironment.LowerRight
    GeoEnvironment.UpperLeft
    GeoEnvironment.CheckBoundaries
    AbstractEnvironment.ArrayComparer
    AbstractEnvironment.DistanceFunction
    Namespace: Mars.Components.Environments
    Assembly: Mars.Components.dll
    Syntax
    public class GeoHashEnvironment<T> : GeoEnvironment, IGeoGridEnvironment<T>, IEnvironment<T>, IEnvironment, IModelObject where T : IPositionable, IEntity
    Type Parameters
    Name Description
    T

    Properties

    GeoHashPrecision

    Gets the hash precision of this environment.
    Declaration
    public GeoHashPrecision GeoHashPrecision { get; }
    Property Value
    Type Description
    GeoHashPrecision

    Methods

    BuildByBBox(BoundingBox, Double)

    Constructs a new GeoHashEnvironment<T> for the specified bounding box where the BBOX will be slitted into multiple cells by the . E.g. the call
    BuildByBBox(-0.489, 51.28, 0.236, 51.686, 10)
    would create a bounding box over the city of london with a grid size of 10 metres and resulting x-dimension of and y-dimension of .
    Declaration
    public static GeoHashEnvironment<T> BuildByBBox(BoundingBox boundingBox, double cellSizeInM)
    Parameters
    Type Name Description
    BoundingBox boundingBox The bounding box containing the envelopment..
    System.Double cellSizeInM The size of each geohash-cell
    Returns
    Type Description
    GeoHashEnvironment<T>

    BuildByBBox(Double, Double, Double, Double, Boolean)

    Constructs a new GeoHashEnvironment<T> for the specified bounding box E.g. the call
    BuildByBBox(-0.489, 51.28, 0.236, 51.686, 10)
    would create a bounding box over the city of london
    Declaration
    public static GeoHashEnvironment<T> BuildByBBox(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, bool withBoundaries = false)
    Parameters
    Type Name Description
    System.Double minLongitude The longitude or x coordinate of the lower-left corner in degree eg. -0.489.
    System.Double minLatitude The latitude or y coordinate of the lower left corner in degree e.g. 51.28.
    System.Double maxLongitude The longitude or x coordinate of the upper-right corner in degree e.g. 0.236.
    System.Double maxLatitude The latitude or y coordinate of the upper-right corner in degree e.g. 51.686.
    System.Boolean withBoundaries The flag indicating whether the environment shall check the movements outside the boundaries.
    Returns
    Type Description
    GeoHashEnvironment<T> Returns a new GeoHashEnvironment<T> with the specified bounding box as the boundary.

    BuildByBBox(Double, Double, Double, Double, Double)

    Constructs a new GeoHashEnvironment<T> for the specified bounding box where the BBOX will be slitted into multiple cells by the . E.g. the call
    BuildByBBox(-0.489, 51.28, 0.236, 51.686, 10)
    would create a bounding box over the city of london with a grid size of 10 metres and resulting x-dimension of and y-dimension of .
    Declaration
    public static GeoHashEnvironment<T> BuildByBBox(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, double cellSizeInM)
    Parameters
    Type Name Description
    System.Double minLongitude The longitude or x coordinate of the lower-left corner in degree eg. -0.489.
    System.Double minLatitude The latitude or y coordinate of the lower left corner in degree e.g. 51.28.
    System.Double maxLongitude The longitude or x coordinate of the upper-right corner in degree e.g. 0.236.
    System.Double maxLatitude The latitude or y coordinate of the upper-right corner in degree e.g. 51.686.
    System.Double cellSizeInM The size of each geohash-cell
    Returns
    Type Description
    GeoHashEnvironment<T>

    BuildEnvironment(Double, Double, Double, Double, Boolean)

    Declaration
    public static GeoHashEnvironment<T> BuildEnvironment(double topLat, double bottomLat, double leftLong, double rightLong, bool withBoundaries = false)
    Parameters
    Type Name Description
    System.Double topLat
    System.Double bottomLat
    System.Double leftLong
    System.Double rightLong
    System.Boolean withBoundaries
    Returns
    Type Description
    GeoHashEnvironment<T>

    BuildEnvironment(Double, Double, Double, Double, Int32)

    The factory method provides a utility function to construct a geo-based GeoHashEnvironment<T> by giving a bounding box of the considered environment.
    Declaration
    public static GeoHashEnvironment<T> BuildEnvironment(double topLat, double bottomLat, double leftLong, double rightLong, int cellSizeInM)
    Parameters
    Type Name Description
    System.Double topLat The uppermost away latitude (y-value) of the bounding box, anywhere on the upper line.
    System.Double bottomLat The lowest away latitude (y-value) of the bounding box, anywhere on the upper line.
    System.Double leftLong The most left-side away longitude (x-value) of the bounding box, anywhere on the upper line.
    System.Double rightLong The right-side away longitude (x-value) of the bounding box, anywhere on the upper line.
    System.Int32 cellSizeInM The granularity of the environment in meters.
    Returns
    Type Description
    GeoHashEnvironment<T> Returns a new GeoHashEnvironment<T> able to manage points in the given box.

    Explore(Position, Double, Int32, Func<T, Boolean>)

    Queries the a set of nearest entities around the position with with optional specified radius and count for the positioning system of the IEnvironment.
    Declaration
    public IEnumerable<T> Explore(Position position = null, double radius = null, int count = null, Func<T, bool> predicate = null)
    Parameters
    Type Name Description
    Position position The Position from which the exploration shall be started.
    System.Double radius The range of the exploration circle.
    System.Int32 count The amount of entities to find.
    Func<T, System.Boolean> predicate A predicate to select only specific entities based on a condition.
    Returns
    Type Description
    IEnumerable<T> An distance based order from the nearest entity to tha farthest

    Explore(Double, Double, Double, Int32, Func<T, Boolean>)

    Declaration
    public IEnumerable<T> Explore(double latitude, double longitude, double radius = null, int count = null, Func<T, bool> predicate = null)
    Parameters
    Type Name Description
    System.Double latitude Latitude of search point
    System.Double longitude Longitude of search point
    System.Double radius The maximum distance to search to in meters.
    System.Int32 count Define the maximum results wanted. When count lower or equal -1 everything will be returned.
    Func<T, System.Boolean> predicate An optional predicate. Will be evaluated for every found item. Only those items returning true, are returned
    Returns
    Type Description
    IEnumerable<T> List with found items, empty list if none were found.

    Explore(Double[], Double, Int32, Func<T, Boolean>)

    Queries the a set of nearest entities around the with with optional specified radius and count
    Declaration
    public IEnumerable<T> Explore(double[] position, double radius = null, int count = null, Func<T, bool> predicate = null)
    Parameters
    Type Name Description
    System.Double[] position The discrete position from which the exploration shall be calculated
    System.Double radius The radius of exploration range
    System.Int32 count The amount of entities to find
    Func<T, System.Boolean> predicate A predicate to filter specific entities
    Returns
    Type Description
    IEnumerable<T> An distance based order from the nearest entity to tha farthest

    GetNearest(Position, Double, Func<T, Boolean>)

    Declaration
    public T GetNearest(Position gpsCoordinate, double maxDistanceInM = null, Func<T, bool> predicate = null)
    Parameters
    Type Name Description
    Position gpsCoordinate
    System.Double maxDistanceInM
    Func<T, System.Boolean> predicate
    Returns
    Type Description
    T

    GetNearest(Double, Double, Double, Func<T, Boolean>)

    Declaration
    public T GetNearest(double latitude, double longitude, double maxDistanceInM = null, Func<T, bool> predicate = null)
    Parameters
    Type Name Description
    System.Double latitude Latitude of search point
    System.Double longitude Longitude of search point
    System.Double maxDistanceInM Maximum distance to search to in meters.
    Func<T, System.Boolean> predicate An optional predicate. Will be evaluated for the found items. The nearest item returning true will be returned.
    Returns
    Type Description
    T The nearest item or default(T) if not found

    Insert(T)

    Inserts an positionable entity into the environment defined by their
    Declaration
    public bool Insert(T entity)
    Parameters
    Type Name Description
    T entity The entity to passionate.
    Returns
    Type Description
    System.Boolean Returns True if the entity was successfully inserted

    MoveTo(T, Position, Double, Func<Double[], Boolean>)

    Moves an entity to the destination of type Position along an optimal ray path with minimal costs. Note that his method does not guarantee to reach the destination.
    Declaration
    public Position MoveTo(T entity, Position geoCoordinate, double distanceInMeter = null, Func<double[], bool> predicate = null)
    Parameters
    Type Name Description
    T entity The entity to move.
    Position geoCoordinate The target destination coordinate.
    System.Double distanceInMeter The distance in meters to move
    Func<System.Double[], System.Boolean> predicate The predicate along the movement which need to be valid or null
    Returns
    Type Description
    Position Returns the new position of the entity> or null if no positioning happened.

    MoveTo(T, Double, Double, Double, Func<Double[], Boolean>)

    Declaration
    public Position MoveTo(T entity, double x, double y, double distanceInMeter = null, Func<double[], bool> predicate = null)
    Parameters
    Type Name Description
    T entity
    System.Double x
    System.Double y
    System.Double distanceInMeter
    Func<System.Double[], System.Boolean> predicate
    Returns
    Type Description
    Position

    MoveTo(T, Double[], Double, Func<Double[], Boolean>)

    Moves an entity to destination along an optimal path with minimal costs. Note that his method does not guarantee to reach the destination.
    Declaration
    public Position MoveTo(T entity, double[] position = null, double distanceInMeter = null, Func<double[], bool> predicate = null)
    Parameters
    Type Name Description
    T entity
    System.Double[] position The discrete position target
    System.Double distanceInMeter The distance to move
    Func<System.Double[], System.Boolean> predicate The predicate along the movement which need to be valid or null
    Returns
    Type Description
    Position Returns the new position of the entity> or null if no positioning happened.

    MoveToPosition(T, Double, Double)

    Declaration
    public Position MoveToPosition(T objectToMove, double latitudeDestination, double longitudeDestination)
    Parameters
    Type Name Description
    T objectToMove
    System.Double latitudeDestination
    System.Double longitudeDestination
    Returns
    Type Description
    Position

    MoveTowards(T, DirectionType, Double)

    Moves an entity the travelling distance distanceToPass towards the direction with a fixed bearing.
    Declaration
    public Position MoveTowards(T entity, DirectionType direction, double distanceToPass = null)
    Parameters
    Type Name Description
    T entity The entity to move
    DirectionType direction One of the eight direction on a 2D plane, including diagonal
    System.Double distanceToPass The distance units to pass.
    Returns
    Type Description
    Position Returns the new position of the entity or null if no positioning happened.

    MoveTowards(T, Double, Double)

    Moves an entity the travelling distance distanceToPass towards the bearing direction.
    Declaration
    public Position MoveTowards(T entity, double bearing, double distanceToPass = null)
    Parameters
    Type Name Description
    T entity The entity to move
    System.Double bearing The bearing in degree in value range 0-360
    System.Double distanceToPass The distance in meters to pass.
    Returns
    Type Description
    Position Returns the new position of the entity> or null if no positioning happened.

    PosAt(T, Double, Double)

    Declaration
    public Position PosAt(T entity, double longitude, double latitude)
    Parameters
    Type Name Description
    T entity
    System.Double longitude
    System.Double latitude
    Returns
    Type Description
    Position

    PosAt(T, Double[])

    Declaration
    public Position PosAt(T entity, double[] position)
    Parameters
    Type Name Description
    T entity
    System.Double[] position
    Returns
    Type Description
    Position

    Remove(T)

    Removes the entity item from the environment at the defined Position over the IPositionable implementation of entity.
    Declaration
    public bool Remove(T entity)
    Parameters
    Type Name Description
    T entity The entity and position to remove
    Returns
    Type Description
    System.Boolean Returns True if the entity was successfully removed

    Implements

    IGeoGridEnvironment<T>
    IEnvironment<TEntity>
    IEnvironment
    IModelObject
    Back to top © 2022 MARS GROUP