header:
  title: KEXI - AV
  description: This dashboard provides a summary of KPIs for the *autonomous* KEXI On-Demand Service.
layout:
  Results:
  - type: csv
    title: Service results
    description: Final configuration and service KPI.
    width: 1.0
    dataset: analysis/drt-av/supply_kpi.csv
    style: topsheet
    showAllRows: true
  - type: csv
    title: Demand results
    description: Final demand statistics and KPI.
    width: 1.0
    dataset: analysis/drt-av/demand_kpi.csv
    style: topsheet
    showAllRows: true
  - type: map
    title: Map of stops
    width: 2.0
    center:
    - 11.89
    - 48.91
    zoom: 11.0
    display:
      lineWidth: {}
      lineColor: {}
      fill: {}
      fillHeight: {}
      radius:
        dataset: trips
        columnName: departures
        join: stop_id
        scaleFactor: 10.0
    shapes:
      join: id
      file: analysis/drt-av/stops.shp
    datasets:
      trips: analysis/drt-av/trips_per_stop.csv
  Spatial demand distribution:
  - type: hexagons
    title: Spatial demand distribution
    description: Origins and destinations.
    height: 7.0
    file: '*output_drt_legs_av.csv'
    projection: EPSG:25832
    center:
    - 11.89
    - 48.91
    zoom: 11.0
    aggregations:
      OD:
      - title: origins
        x: fromX
        "y": fromY
      - title: destinations
        x: toX
        "y": toY
  # - type: hexagons
  #   title: Spatial rejection distribution
  #   description: Requested (and rejected) origins and destinations.
  #   file: '*rejections_av.csv'
  #   projection: EPSG:25832
  #   center:
  #   - 11.89
  #   - 48.91
  #   zoom: 11.0
  #   aggregations:
  #     rejections:
  #     - title: origins
  #       x: fromX
  #       "y": fromY
  #     - title: destinations
  #       x: toX
  #       "y": toY
  Final Demand And Wait Time Statistics:
  - type: plotly
    title: Final Demand and Wait Stats over day time
    description: "Number of rides (customers) is displayed in bars, wait statistics\
      \ in lines"
    datasets:
      dataset: '*_waitStats_av.csv'
      # '*drtrejectionsperTimeBinav': '*drt_rejections_perTimeBin_av.csv'
    traces:
    - fill: none
      "y": $dataset.average_wait
      x: $dataset.timebin
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: Average
      original_name: Average
    - fill: none
      "y": $dataset.p_5
      x: $dataset.timebin
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: P5
      original_name: P5
    - fill: none
      "y": $dataset.p_95
      x: $dataset.timebin
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: P95
      original_name: P95
    - x: $dataset.timebin
      "y": $dataset.legs
      orientation: v
      type: bar
      opacity: 0.3
      name: Rides
      yaxis: y2
      original_name: Rides
    # - x: $*drtrejectionsperTimeBinav.timebin
    #   "y": $*drtrejectionsperTimeBinav.rejections
    #   orientation: v
    #   type: bar
    #   opacity: 0.3
    #   name: Rejections
    #   yaxis: y2
    #   original_name: Rejections
    layout:
      xaxis:
        title: Time Bin
        color: "#444"
        type: '-'
      yaxis2:
        title: Nr of Rides
        color: "#444"
        type: '-'
        side: right
        overlaying: "y"
      barmode: stack
      yaxis:
        title: "Wait Time [s]"
        color: "#444"
        type: '-'
  - type: area
    title: Vehicle occupancy
    description: Number of passengers on board at a time
    dataset: '*occupancy_time_profiles_av.txt'
    x: time
    useLastRow: false
    xAxisName: Time
    yAxisName: "Vehicles [1]"
  Demand and Wait Time Statistics per iteration:
  - type: plotly
    title: Rides and rejections per iteration
    description: Number of rides (customers) and rejections over the course of the
      simulation
    datasets:
      dataset: '*_customer_stats_av.csv'
    traces:
    - x: $dataset.iteration
      "y": $dataset.rejections
      orientation: v
      type: bar
      name: Rejections
      original_name: Rejections
    - x: $dataset.iteration
      "y": $dataset.rides
      orientation: v
      type: bar
      name: Rides
      original_name: Rides
    layout:
      xaxis:
        title: Iteration
        color: "#444"
        type: '-'
      barmode: stack
      yaxis:
        title: "Wait Time [s]"
        color: "#444"
        type: '-'
  - type: line
    title: Waiting time statistics per iteration
    description: ""
    dataset: '*customer_stats_av.csv'
    x: iteration
    columns:
    - wait_average
    - wait_median
    - wait_p95
    useLastRow: false
    legendName:
    - Average
    - Median
    - 95th Percentile
    xAxisName: Iteration
    yAxisName: "Waiting Time [s]"
  Demand And Travel Time Statistics per iteration:
  - type: plotly
    title: Travel time components per iteration
    description: Comparing mean wait vs. mean in-vehicle travel time per customer
    datasets:
      dataset: '*_customer_stats_av.csv'
    traces:
    - x: $dataset.iteration
      "y": $dataset.inVehicleTravelTime_mean
      orientation: v
      type: bar
      name: In Vehicle
      original_name: In Vehicle
    - x: $dataset.iteration
      "y": $dataset.wait_average
      orientation: v
      type: bar
      name: Wait
      original_name: Wait
    layout:
      xaxis:
        title: Iteration
        color: "#444"
        type: '-'
      barmode: stack
      yaxis:
        title: "Time [s]"
        color: "#444"
        type: '-'
  - type: line
    title: Customer travel distance per iteration
    description: Customer traveled distance versus customer direct distance
    dataset: '*customer_stats_av.csv'
    x: iteration
    columns:
    - directDistance_m_mean
    - distance_m_mean
    useLastRow: false
    legendName:
    - Mean direct distance
    - Mean driven distance
    xAxisName: Iteration
    yAxisName: "distance [m]"
  Fleet Stats per Iteration:
  - type: plotly
    title: Fleet stats per iteration
    description: "Number of av vehicles (customers) is displayed as bars, distance\
      \ stats as lines"
    datasets:
      dataset: '*_vehicle_stats_av.csv'
    traces:
    - fill: none
      "y": $dataset.totalPassengerDistanceTraveled
      x: $dataset.iteration
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: Pax Dist.
      original_name: Pax Dist.
    - fill: none
      "y": $dataset.totalDistance
      x: $dataset.iteration
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: Vehicle mileage
      original_name: Vehicle mileage
    - fill: none
      "y": $dataset.totalEmptyDistance
      x: $dataset.iteration
      mode: lines
      whiskerwidth: 0.0
      type: scatter
      name: Empty mileage
      original_name: Empty mileage
    - x: $dataset.iteration
      "y": $dataset.vehicles
      orientation: v
      type: bar
      opacity: 0.2
      name: Vehicles
      yaxis: y2
      original_name: Vehicles
    layout:
      xaxis:
        title: Iteration
        color: "#444"
        type: '-'
      yaxis2:
        title: Nr Of Vehicles
        color: "#444"
        type: '-'
        side: right
        overlaying: "y"
      barmode: stack
      yaxis:
        title: "Total Distance [m]"
        color: "#444"
        type: '-'
  - type: line
    title: Relative Statistics per iteration
    description: "Occupancy rate (Pax distance / Vehicle mileage), Detour ratio, and\
      \ Empty Ratio"
    dataset: '*vehicle_stats_av.csv'
    x: iteration
    columns:
    - d_p/d_t
    - l_det
    - emptyRatio
    useLastRow: false
    legendName:
    - Pooling ratio
    - Detour ratio
    - Empty Ratio
    xAxisName: Iteration
    yAxisName: Value