• 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 Position

This class is used to store position objects for a 2-dimensional Cartesian plane.

It is the the value type for holding the position information with x and y value. In addition it also used to represent geospatial referenced positions which are enhanced with invariants. The Mars.Interfaces.Environment.IPosittionable ist strongly coupled to this. Unlike objects of type GeoAPI.Geometries.Point (which contain additional information that an entity has position, a Position only contains the ordinate values and properties.

Positions are two-dimensional points.

Inheritance
System.Object
Position
Implements
System.ICloneable
System.IComparable
System.IComparable<Position>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Mars.Interfaces.Environments
Assembly: Mars.Interfaces.dll
Syntax
[Serializable]
[MessagePackObject(false)]
public sealed class Position : ICloneable, IComparable, IComparable<Position>

Constructors

| Improve this Doc View Source

Position()

Creates a Position at (0,0).
Declaration
public Position()
| Improve this Doc View Source

Position(Double, Double, Double)

This class is used to store position objects for a 2-dimensional Cartesian plane.

It is the the value type for holding the position information with x and y value. In addition it also used to represent geospatial referenced positions which are enhanced with invariants. The Mars.Interfaces.Environment.IPosittionable ist strongly coupled to this. Unlike objects of type GeoAPI.Geometries.Point (which contain additional information that an entity has position, a Position only contains the ordinate values and properties.

Positions are two-dimensional points.

Declaration
public Position(double x, double y, double z)
Parameters
Type Name Description
System.Double x
System.Double y
System.Double z
| Improve this Doc View Source

Position(Double, Double)

A protected constructor to create instances of the Position When you want to access this from outside use the factory methods CreatePosition or CreateGeoPosition(Double, Double) for geospatial referenced positions.
Declaration
[JsonConstructor]
public Position(double x, double y)
Parameters
Type Name Description
System.Double x The component of the x-axis.
System.Double y The component of the y-axis.
| Improve this Doc View Source

Position(Double[])

This class is used to store position objects for a 2-dimensional Cartesian plane.

It is the the value type for holding the position information with x and y value. In addition it also used to represent geospatial referenced positions which are enhanced with invariants. The Mars.Interfaces.Environment.IPosittionable ist strongly coupled to this. Unlike objects of type GeoAPI.Geometries.Point (which contain additional information that an entity has position, a Position only contains the ordinate values and properties.

Positions are two-dimensional points.

Declaration
public Position(double[] positionArray)
Parameters
Type Name Description
System.Double[] positionArray

Properties

| Improve this Doc View Source

Bearing

This class is used to store position objects for a 2-dimensional Cartesian plane.

It is the the value type for holding the position information with x and y value. In addition it also used to represent geospatial referenced positions which are enhanced with invariants. The Mars.Interfaces.Environment.IPosittionable ist strongly coupled to this. Unlike objects of type GeoAPI.Geometries.Point (which contain additional information that an entity has position, a Position only contains the ordinate values and properties.

Positions are two-dimensional points.

Declaration
[IgnoreMember]
[JsonIgnore]
public double Bearing { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Item[Int32]

Access the 2-dimensional components x and y over an index access e.g.
position[0]
to get the x-component of the position and
position[1]
to get the y-component of the position
Declaration
public double this[int index] { get; set; }
Parameters
Type Name Description
System.Int32 index The index within the 2-dimensional space
Property Value
Type Description
System.Double
Exceptions
Type Condition
System.IndexOutOfRangeException If the index access lies outside 2D
| Improve this Doc View Source

Latitude

The latitude (y-position) interpreted value of this position in degree within value range -90 to +90
Declaration
[IgnoreMember]
[JsonIgnore]
public double Latitude { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Longitude

The longitude (x-position) interpreted value of this position in degree within value range -180 to +180
Declaration
[IgnoreMember]
[JsonIgnore]
public double Longitude { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

PositionArray

Gets the position with (longitude, latitude) or (x,y) in form of an array
Declaration
[Key(0)]
[JsonProperty("position", NullValueHandling = NullValueHandling.Ignore)]
public double[] PositionArray { get; set; }
Property Value
Type Description
System.Double[]
| Improve this Doc View Source

X

The x-position on a 2D-cartesian plane
Declaration
[IgnoreMember]
[JsonIgnore]
public double X { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Y

The y-position on a 2D-cartesian plane
Declaration
[IgnoreMember]
[JsonIgnore]
public double Y { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

Clone()

Create a new object as copy of this instance.
Declaration
public object Clone()
Returns
Type Description
System.Object A new instance of this position object with the exact same values.
| Improve this Doc View Source

CompareTo(Position)

Compares this object with the specified object for order. Since Coordinates are 2D, this routine focus only on the x and y value for comparison. Returns -1 : this.x lower than other.x || ((this.x == other.x) AND (this.y lower than other.y)) 0 : this.x == other.x AND this.y = other.y 1 : this.x greater than other.x || ((this.x == other.x) AND (this.y greater than other.y))
Declaration
public int CompareTo(Position other)
Parameters
Type Name Description
Position other Position with which this Position is being compared.
Returns
Type Description
System.Int32 A negative integer, zero, or a positive integer as this Coordinate is less than, equal to, or greater than the specified Coordinate.
| Improve this Doc View Source

CompareTo(Object)

Compares this object with the specified object for order. Since Coordinates are 2D, this routine focus only on the x and y value for comparison. Returns -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) 0 : this.x == other.x AND this.y = other.y 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y))
Declaration
public int CompareTo(object obj)
Parameters
Type Name Description
System.Object obj Position with which this Position is being compared.
Returns
Type Description
System.Int32 A negative integer, zero, or a positive integer as this Coordinate is less than, equal to, or greater than the specified Coordinate.
| Improve this Doc View Source

Copy()

Create a new object as copy of this instance.
Declaration
public Position Copy()
Returns
Type Description
Position A new instance of this position object with the exact same values.
| Improve this Doc View Source

CreateGeoPosition(Double, Double)

Creates an instance of the Position with passed geo-referenced position longitude and latitude.
Declaration
public static Position CreateGeoPosition(double longitude, double latitude)
Parameters
Type Name Description
System.Double longitude The longitude value in degree.
System.Double latitude The latitude value in degree.
Returns
Type Description
Position A new Position object
Exceptions
Type Condition
System.ArgumentException The latitude or longitude value is outside their value range.
| Improve this Doc View Source

CreatePosition(Double, Double)

Creates a new instance of the Position with 2D-cartesian position x and y.
Declaration
public static Position CreatePosition(double x, double y)
Parameters
Type Name Description
System.Double x The x position of the position.
System.Double y The y position of the position.
Returns
Type Description
Position A new Position object.
| Improve this Doc View Source

CreatePosition(Double[])

Creates a new instance of the Position with 2D-cartesian position array as input.
Declaration
public static Position CreatePosition(double[] coordinates)
Parameters
Type Name Description
System.Double[] coordinates The 2d-cartesian input
Returns
Type Description
Position
| Improve this Doc View Source

Equals(Object)

Checks whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj The object to compare with the current object.
Returns
Type Description
System.Boolean true if the specified object is equal to the current object; otherwise, false.
Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Serves as the default hash function for value types with no additional garbage.
Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32 An integer hash code for the current object.
Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

ToLatLonString()

Provides a lat-lon-representation for fast usage in other tools.
Declaration
public string ToLatLonString()
Returns
Type Description
System.String string with lat and lon, in this order
| Improve this Doc View Source

ToString()

Returns a string of the form (x,y) .
Declaration
public override string ToString()
Returns
Type Description
System.String string of the form (x,y)
Overrides
System.Object.ToString()

Operators

| Improve this Doc View Source

Addition(Position, Position)

The vector addition operator for 2D position object.s This operation creates a new Position object.
Declaration
public static Position operator +(Position lhs, Position rhs)
Parameters
Type Name Description
Position lhs left hand side of the position vector
Position rhs right hand side of the position vector
Returns
Type Description
Position Returns a new position where the left hand side is added by the right one.
| Improve this Doc View Source

Division(Position, Double)

This class is used to store position objects for a 2-dimensional Cartesian plane.

It is the the value type for holding the position information with x and y value. In addition it also used to represent geospatial referenced positions which are enhanced with invariants. The Mars.Interfaces.Environment.IPosittionable ist strongly coupled to this. Unlike objects of type GeoAPI.Geometries.Point (which contain additional information that an entity has position, a Position only contains the ordinate values and properties.

Positions are two-dimensional points.

Declaration
public static Position operator /(Position lhs, double scalar)
Parameters
Type Name Description
Position lhs
System.Double scalar
Returns
Type Description
Position
| Improve this Doc View Source

Subtraction(Position, Position)

The vector subtraction operator for 2D position object.s This operation creates a new Position object.
Declaration
public static Position operator -(Position lhs, Position rhs)
Parameters
Type Name Description
Position lhs left hand side of the position vector
Position rhs right hand side of the position vector
Returns
Type Description
Position Returns a new position where the left hand side is subtracted by the right one.

Implements

System.ICloneable
System.IComparable
System.IComparable<T>

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)
PositionHelper.CalculateMovementVector(Position, Double, Double, Double)
PositionHelper.CalculateRelativePosition(Position, Double, Double)
PositionHelper.GetBearing(Position, in Position)
PositionHelper.GetBearingCartesian(Position, in Position)
PositionHelper.GetRelativePosition(Position, Double, Double)
PositionHelper.ToCoordinate(Position)
GeoPositionExtension.DistanceInKmTo(Position, Position)
GeoPositionExtension.DistanceInMTo(Position, Position)
GeoPositionExtension.DistanceInMTo(Position, Double, Double)
Matrix.Concatenate<T>(T, T[])
Matrix.Replace<T>(T, Object, Object)
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