header:
  title: Traffic Counts
  description: "Comparison of observed and simulated daily traffic volumes. Reported\
    \ volumes are scaled-up according to simulated sample size. \nError metrics based\
    \ on relative error: major under: < -0.40; under: -0.40 - -0.20; ok: -0.20 - 0.20;\
    \ over: 0.20 - 0.40; major over: > 0.40\n\n. The Scalable Quality Value (SQV)\
    \ and the Geoffrey E. Havers (GEH) value are used to assess the quality of the\
    \ simulated traffic counts. For the SQV a threshold of 0.75 is used, which is\
    \ the threshold for an acceptable simulation quality. See: https://doi.org/10.1177/0361198119838849\
    \ or https://fops.de/wp-content/uploads/2021/02/FE-70.0919-2015-Anf-an-staedt-Verkehrsnachfragemodelle-Schlussbericht.pdf"
subtabs:
- title: Car
  rows:
  - averages_car
  - overview_car
  - scatter_car
  - perHour_car
  - map_car
  - hoursPerStation_car
layout:
  averages_car:
  - type: tile
    height: 0.1
    dataset: analysis/traffic-car/count_comparison_daily_averages.csv
  overview_car:
  - type: plotly
    title: Count estimation quality
    description: over all count stations
    datasets:
      dataset:
        file: analysis/traffic-car/count_comparison_quality.csv
        constant:
          source: ""
        aggregate:
          func: SUM
          groupBy:
          - quality
          target: "n"
    traces:
    - x: $dataset.n
      "y": $dataset.source
      orientation: h
      type: bar
      name: $dataset.quality
      colorRamp: RdYlBu
    layout:
      xaxis:
        title: Number
        color: "#444"
        type: '-'
      barmode: stack
  - type: plotly
    title: Count estimation quality
    description: by road type
    datasets:
      dataset: analysis/traffic-car/count_comparison_quality.csv
    traces:
    - x: $dataset.road_type
      "y": $dataset.share
      orientation: v
      type: bar
      name: $dataset.quality
      colorRamp: RdYlBu
    layout:
      barmode: stack
      yaxis:
        title: Share
        color: "#444"
        type: '-'
  scatter_car:
  - type: plotly
    title: Daily sqv values
    description: SQV values for all count stations based on the observed traffic counts.
      A higher value indicates a better simulation quality and 0.75 is the threshold
      for an acceptable simulation quality.
    datasets:
      dataset: analysis/traffic-car/count_comparison_daily.csv
    traces:
    - fill: none
      "y": $dataset.sqv
      x: $dataset.observed_traffic_volume
      mode: markers
      whiskerwidth: 0.0
      type: scatter
      name: $dataset.road_type
      text: $dataset.name
    - fill: none
      "y": $dataset.sqv_threshold
      x: $dataset.observed_traffic_volume
      mode: lines
      line:
        color: grey
        width: 2.0
        smoothing: 1.0
        shape: linear
        dash: solid
        simplify: true
        context:
          color: grey
          shape: linear
          width: 2.0
          smoothing: 1.0
          simplify: true
          dash: solid
      whiskerwidth: 0.0
      type: scatter
      name: SQV Threshold
      original_name: SQV Threshold
    layout:
      xaxis:
        title: Observed traffic count
        color: "#444"
        type: '-'
      yaxis:
        title: sqv
        color: "#444"
        type: '-'
    height: 8.0
    fixedRatio: false
  - type: plotly
    title: Daily traffic volumes
    description: simulated vs. observed
    datasets:
      dataset: analysis/traffic-car/count_comparison_daily.csv
    traces:
    - fill: none
      "y": $dataset.simulated_traffic_volume
      x: $dataset.observed_traffic_volume
      mode: markers
      whiskerwidth: 0.0
      type: scatter
      name: $dataset.road_type
      text: $dataset.name
    - fill: none
      "y": $dataset.observed_traffic_volume
      x: $dataset.observed_traffic_volume
      mode: lines
      line:
        color: grey
        width: 2.0
        smoothing: 1.0
        shape: linear
        dash: solid
        simplify: true
        context:
          color: grey
          shape: linear
          width: 2.0
          smoothing: 1.0
          simplify: true
          dash: solid
      whiskerwidth: 0.0
      type: scatter
      name: Benchmark
      original_name: Benchmark
    layout:
      xaxis:
        title: Observed traffic count
        color: "#444"
        type: '-'
      yaxis:
        title: Simulated traffic count
        color: "#444"
        type: '-'
    height: 8.0
    fixedRatio: false
  perHour_car:
  - type: plotly
    title: Traffic volumes by hour
    description: simulated vs. observed
    datasets:
      dataset: analysis/traffic-car/count_comparison_by_hour.csv
    traces:
    - fill: none
      "y": $dataset.simulated_traffic_volume
      x: $dataset.observed_traffic_volume
      mode: markers
      whiskerwidth: 0.0
      type: scatter
      name: $dataset.hour
      text: $dataset.name
    layout:
      xaxis:
        title: Observed traffic count
        color: "#444"
        type: '-'
      yaxis:
        title: Simulated traffic count
        color: "#444"
        type: '-'
    height: 8.0
    fixedRatio: true
    interactive: slider
  - type: plotly
    title: Avg. error / bias
    datasets:
      dataset: analysis/traffic-car/count_error_by_hour.csv
    traces:
    - fill: none
      "y": $dataset.mean_rel_error
      x: $dataset.hour
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: Mean rel. error
      original_name: Mean rel. error
    - fill: none
      "y": $dataset.mean_abs_error
      x: $dataset.hour
      mode: lines
      yaxis: y2
      whiskerwidth: 0.0
      type: scatter
      name: Mean abs. error
      original_name: Mean abs. error
    - fill: none
      "y": $dataset.mean_bias
      x: $dataset.hour
      mode: lines
      yaxis: y2
      whiskerwidth: 0.0
      type: scatter
      name: Mean bias
      original_name: Mean bias
    layout:
      xaxis:
        title: Hour
        color: "#444"
        type: '-'
      yaxis2:
        title: "Mean (abs.) error [veh/h]"
        color: "#444"
        type: '-'
        side: right
        overlaying: "y"
      yaxis:
        title: "Mean rel. error [%]"
        color: "#444"
        type: '-'
  map_car:
  - type: map
    title: Relative traffic volumes
    height: 8.0
    datasets:
      counts: analysis/traffic-car/count_comparison_daily.csv
    display:
      lineWidth:
        dataset: '@8'
      lineColor:
        dataset: counts
        columnName: quality
        join: link_id
        colorRamp:
          reverse: false
          steps: 5
          ramp: RdYlBu
      fill: {}
      fillHeight: {}
      radius: {}
    shapes:
      join: id
      file: analysis/network/network.avro
  hoursPerStation_car:
  - type: plotly
    title: Count stations
    description: hourly comparison
    datasets:
      dataset: analysis/traffic-car/count_comparison_by_hour.csv
    traces:
    - x: $dataset.hour
      "y": $dataset.simulated_traffic_volume
      orientation: v
      type: bar
      name: $dataset.name
      original_name: Simulated
    - x: $dataset.hour
      "y": $dataset.observed_traffic_volume
      orientation: v
      type: bar
      name: $dataset.name
      original_name: Observed
    interactive: dropdown
