starling_sim.utils.config

This module contains a config dict with simulation related values.

Config values can be provided to the simulator using a json file name after the _CONFIG_FILE constant.

For a complete description of the config specification and its default values, see the JSON schema (schemas/starling_config.schema.json):

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "distance_factor": {
      "title": "Distance factor",
      "description": "Multiplicand applied to euclidean distance to approximate a travelling distance",
      "type": "number",
      "minimum": 0,
      "default": 1.3
    },
    "walking_speed": {
      "title": "Walking speed [meters/seconds]",
      "description": "Walking speed of Person objects, used when walking speed cannot be fetched from topology",
      "type": "number",
      "exclusiveMinimum": 0,
      "default": 1.1
    },
    "geojson_format": {
      "title": "GeoJSON output format",
      "description": "Filename format of the GeoJSON output. Placeholder: {scenario}",
      "type": "string",
      "pattern": "(\\.geojson(\\.gz)?)$",
      "default": "visualisation.geojson.gz"
    },
    "kpi_format": {
      "title": "KPI output format",
      "description": "Filename format of the KPI output. Placeholders: {scenario}, {kpi_output}",
      "type": "string",
      "pattern": "(\\.csv(\\.gz)?)$",
      "default": "{kpi_output}.csv.gz"
    },
    "traces_format": {
      "title": "Traces output format",
      "description": "Filename format of the traces output. Placeholder: {scenario}",
      "type": "string",
      "pattern": "(.)*(.txt)",
      "default": "traces.txt"
    },
    "max_stop_distance": {
      "title": "Max stop distance [meters]",
      "description": "Maximum accepted distance between stop and node before extending graph (when extend_graph_from_stops is True)",
      "type": "integer",
      "minimum": 0,
      "default": 100
    },
    "transfer_restriction": {
      "title": "Transfer time restriction [seconds]",
      "description": "Duration restriction applied to the GTFS transfer table before making it transitively closed",
      "type": "integer",
      "exclusiveMinimum": 0,
      "default": 240
    },
    "estimated_detour": {
      "title": "Estimated trip detour",
      "description": "Used in some models to estimate a shared trip duration before proper planning. Multiplied to the trip direct travel time",
      "type": "number",
      "minimum": 1,
      "default": 1.3
    },
    "geojson_version": {
      "title": "GeoJSON output version",
      "description": "Format version of the GeoJSON output. If null, use the one specified in geojson_output.py.",
      "type": ["integer", "null"],
      "default": null
    },
    "stop_sequence_separator": {
      "title": "Stop sequence separator",
      "description": "Separator used to build stop sequences in GTFS",
      "type": ["string"],
      "default": "-"
    }
  }
}

Module Contents

Functions

_init_config()

Initialise config variables from a config file or from the default schema values.

Attributes

_CONFIG_FILE

_CONFIG_SCHEMA

config

starling_sim.utils.config._CONFIG_FILE = 'starling_config.json'
starling_sim.utils.config._CONFIG_SCHEMA = 'starling_config.schema.json'
starling_sim.utils.config._init_config()

Initialise config variables from a config file or from the default schema values.

starling_sim.utils.config.config