• Documentation
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Search Results for

    Show / Hide Table of Contents
    • MARS DSL Language
    • MARS Runtime System
      • Getting started with MARS
      • Basic Concepts
        • Multi-Agent-Simulation
        • Agents
        • Layers
        • Entities
        • Environments
          • SpatialHashEnvironment
          • GeoHashEnvironment
          • SpatialGraphEnvironment
          • CollisionEnvironment
        • Model Setup
      • Model Configuration
        • Agent and Entity Configuration
        • Layer Configuration
        • Output Filter
        • Simulation Configuration Options
        • Simulation Output Formats
      • Data Sources
        • Geospatial Data Sources
        • Geospatial Data Types
        • ASCII grid (.asc)
        • CSV
        • Time-series Data
      • Analysis and Visualization
        • Visualizing Agent Movement Trajectories
        • Simple Live Visualization
        • Analyzing Output Data
      • Tutorials
        • Creating a new MARS C# project
        • Creating a starting point for your model
        • Creating vector and raster layer files
        • Building your first model (wolf-sheep-grass)
        • Common problems and solutions
        • Acquire geo data for layers
        • Build and start your model in Kubernetes cluster
    • SmartOpenHamburg
      • Quick Start
      • Ready to use scenarios (boxes)
        • Ferry Transfer
        • Green4Bikes
        • Results
        • Result Schemas
      • Layer
        • Multimodal Layer
        • Modal Layer
        • Scheduling Layer
        • Vector Layer
      • Agents
        • Behaviour Model
        • Multimodal
        • Multi-Capable
        • Multi-Modality
        • Citizen
        • Traveler
      • Entities
        • Referencing
        • Street Vehicles
        • Bicycle Vehicles
        • Ferry

    Options for Simulation Configuration

    This is a list of all the attributes that can be defined in different sections of the simulation configuration.


    Execution

    The simulation is executed in parallel if multiple processors are available. Sometimes its handy to switch to a sequential execution to evade problems with locks or synchronization.

    Therefore use in top level config option execution the maxProcessCount property and set it to 1.

    {
      "execution": {
        "maxProcessCount": 1
      },
      "globals": {
          // ...
      }
    }
    

    Globals

    The globals options define general settings for the simulation like everything around the simulation time.

    Property Type Default Required Constraints Excludes
    id String model_name + _ + timestamp ☑ No special characters
    steps Integer 1 ☐ value ≥ 0 startTime; endTime
    startTime DateTime now ☐ value > endTime steps
    endTime DateTime null ☐ value > startTime steps
    deltaT Integer 1 ☑ value > 0
    deltaTUnit TimeUnit seconds ☐ one of: milliseconds, seconds, minutes, hours, days, months, years

    Here is an example:

    {
      "globals": {
        "startPoint": "2020-01-01T00:00:00",
        "endPoint": "2020-01-01T01:00:00",
        "deltaT": 1,
        "deltaTUnit": "seconds",
     "console": true,
        "output": "csv",
        "options": {
          "delimiter": ";",
          "numberFormat": "F2"
        }
      }
    }
    

    startPoint: the start time of the simulation

    endPoint: the end time of the simulation

    deltaT: the length of a single time step

    deltaTUnit: the unit of a single time step

    console: if true, the simulation progress is displayed in the terminal

    output: the medium into which simulation output data is stored

    ​ Note: if output is set to csv, then the key options can be used to define further details such as the delimiter and the numberFormat.


    Output

    Property Type Default Required Constraints
    output OutputOption none ☐ one of: none, CSV, MongoDB, redis, postgresql, sqlite

    Output (mongoOptions, npgSqlOptions, redisOptions)

    Property Type Default Required Constraints
    port Integer db specific ☐ value > 0
    host String localhost ☑
    user String ☑
    password String ☑
    connectionTimeout Integer 5 ☐ value > 0
    databaseName String $sim-config-id ☑

    Output (sqLiteOptions)

    Property Type Default Required Constraints
    databaseName String $sim-config-id ☑
    isInMemory Boolean false ☐

    Output (socketOptions) exclude?

    Property Type Default Required Constraints
    socketPath String ☑
    sendingInterval Integer 0 ☐

    Output (csvOptions)

    Property Type Default Required Constraints Notes
    delimiter Delimiter , ☑ one of: ,, ;, \t, \w
    includeHeader Boolean true ☐
    encoding String UTF-8 ☐
    chunkSize Integer ☐ exclude
    appendConfigName Boolean true ☐
    fileSuffix String ☐ overwrites appendConfigName
    numberFormat String g ☐ exclude
    culture String en-EN ☐

    Layer

    Property Type Default Required Constraints
    name String classname in AST ☑
    file Path ☑ path exists
    output OutputOption none ☐
    outputFrequency Integer 1 ☐ value ≥ 0

    The layer section includes a list of configurations for each layer type defined in the model. Here is an example of the configuration for two layers:

     {
       "layers": [
         {
           "name": "TrafficLightLayer",
           "file": "res/traffic_lights/traffic_lights_harburg_zentrum.zip"
         },
         {
           "name": "CitizenLayer",
           "file": "res/networks/harburg_zentrum_walk_graph.geojson",
           "mapping": [
             {
               "parameter": "ParkingOccupancy",
               "value": 0.779
             }
           ]
         }
       ]
     }
    

    name: the name of the layer type. Note: this must match the layer type's name in the model.

    file: the path to a file with geodata that is used to populate the layer.

    mapping: a list of additional mappings for the layer.

    Raster Layer

    Property Type Default Required Constraints
    file Path ☐ allowed file types: asc, csv, zip
    output LayerOutputOption asc ☐ options: asc, csv, none

    <div class="danger", style="background-color:rgba(255,207,145,0.5); color:black; border-radius:5px; padding:1%; margin-right:60%"> (Optional)

    Spatio-Temporal-Layer

    • Set von Dateien auswählen
    • Ordnung der Dateien bestimmen
    • Dateien mit Zeitangaben versehen

    Empty Layer

    • Bounding Box angeben (lower left, upper right)
    • No Data Value mit bspw. -99


    Vector Layer

    Property Type Default Required Constraints
    file Path ☐ allowed file types: geoJSON, ESRI Shapefile
    output VectorLayerOutputOptions asc ☐ options: asc, geoJSON, ESRI Shapefile, none

    Agents

    Property Type Default Required Constraints Excludes
    name String classname provided by AST ☑ agent must exist in model
    frequency Integer 1 ☐ value > 0
    file Path ☐ path exists count
    output OutputOption Global Output Value ☐
    outputFrequency Integer 1 ☐ value ≥ 0
    outputFilter FilterList ☐
    count Integer 0 ☐ value ≥ 0
    mapping Mapping ☑ external variables must be mapped

    The Agents section includes a configuration (an AgentMapping) for each agent type defined in the model. Here is an example:

    {
    "agents": [
     {
       "name": "Citizen",
       "count": 10,
       "file": "res/agent_inits/CitizenInit10k.csv",
       "options": {
         "delimiter": ";"
       },
       "mapping": [
         {
           "parameter" : "CanCycle",
           "value" : true
         },
         {
           "parameter": "resultTrajectory",
           "value": true
         }
       ]
     }
    ]
    }
    

    name: the name of the agent type. Note: this must match the agent type's name in the model.

    count: the number of agents of this agent type that should be spawned at the beginning of the simulation

    file: the path to a csv file that contains a set of attributes and attribute values to parametrize the agents

    ​ Note: if a file is specified, the key options can be used to define further details such as the delimiter.

    mapping: a list of additional mappings for the agents.

    The Output Filter is displayed in the following example. For aggregate output of each multimodal route see also MultiCapableAgent.

    [
        {
            "name": "energy", "operator": "in|notIn", "values": []
        }
    ]
    

    Mapping

    Property Type Default Required Constraints Excludes
    parameter String ☑ must exist in agent definition and be marked as external
    value Any ☐ must be type of external parameter field
    field String ☐ allowed if input file is specified; must exist in .csv value
    type PrimitiveTypes read from AST ☑
    {
      "mapping": [
        {
          "parameter": "Energy",
          "value": 100,
          "field": "field.name"
        }
      ]
    }
    
    In This Article
    Back to top © 2022 MARS GROUP