• Documentation
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API

    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

    Simulation Output | FerryTransfer | Green4Bikes

    Results for FerryTransfer and Green4Bikes are generated in three ways:

    • Trajectories can be switched on and off to observe and visualize the movements of workers and ferries.
    • Simulation results can be generated for each individual agent to perform detailed analysis on movement and other available properties.
    • Layer can be observed in order to investigate environmental changes.

    The result schema for each type is described here

    Agent Output

    Simulation results of agents include tick-by-tick versioning of individual agents (DockWorker, FerryDriver, CycleTraveler) and can be saved into different formats. According to your considered scenario, the output is configurable in order save specific model states. Such states can be:

    • The selection of certain simulation steps.
    • The selection for certain model states.
    • Everything of an agent.
    • Only trajectories.

    In the enclosed config.json an example configuration for the DockWorker is defined as follows:

    {
        "name": "DockWorker",
        "output": "sqlite",
        "outputFilter": [
          {
            "parameter": "StoreTickResult", "operator": "in", "values": [true]
          }
        ]
    }
    

    You can set the output per agent individually and configure its current state via an output filter. For more about output filters and how to apply, see here.

    The output filter shown above, outputs all DockWorkers via a local SQLite database, which are captured exactly when the StoreTickResult condition is met.

    The condition StoreTickResult is a default output filter, which is valid when a multi-modal route is processed.

    An alternative condition would be the output of results where only those DockWorkers are stored who are currently on a Ferry. For this purpose the output model offers an attribute ActiveCapability that always reflects the currently used modality in the simulation.

    {
        "name": "DockWorker",
        "output": "sqlite",
        "outputFilter": [
          {
            "parameter": "ActiveCapability", "operator": "in", "values": ["Ferry"]
          }
        ]
    }
    

    To get all results for each calculated simulation step, remove the outputFilter from the configuration and leave the output filter active.

    Please note that the simulation time will taking longer, when the output filter is omitted, wrongly configured or the output for all simulation results is active.

    Entity Output

    To include single entities like the used ferry used here in the output, the output must also be set to the selected format in the configuration for the respective entity type:

    {
      "file": "resources/ferry.csv",
      "name": "Ferry",
      "output": "sqlite"
    }
    

    Layer Output

    In addition to agents and entity types, the boxes contain a number of vector layers for mapping spatial properties. These are modified at runtime and can be used like agents as simulation results.

    For the Green4Bikes scenario. The model provides a BicycleRentalLayer. Versioned snapshots can be saved for this layer to observe rental bike capacity changes. Therefore, the output have to be set for example to geojson:

    {
      "name": "BicycleRentalLayer", 
      "output":"geojson", 
      "outputFrequency": 1000, 
      "file": "resources/harburg_rental_stations.geojson"
    }
    

    ❗❗❗ It is recommended to set the outputFrequency to avoid taking a snapshot for every single step.

    More about the respective layer output kinds can be found here.

    Extended Output

    In order to improve the execution performance only changing attributes are stored by default, where multiple attributes with constant value are ignored. To write out all attributes, the outputKind must be set to fullWithIgnored. To still write out all attributes, the option outputKind must be set to fullWithIgnored within the mapping

    {
      "file": "resources/ferry.csv",
      "name": "Ferry",
      "output": "sqlite",
      "outputKind": "fullWithIgnored"
    }
    
    Back to top Copyright © MARS GROUP.
    HAW Hamburg