ガイドAPIリファレンス
ガイド

制限速度を適用する

多くの場合、ディスパッチャは車両の制限速度を設定することが不可欠であると考えています。特に人や壊れやすい物品を輸送する場合、会社の方針や現地の法律に沿っている場合、または新人や経験の浅いドライバーの制限を遵守する場合などに、安全を確保するためにさまざまなユースケースでこの慣行が広まっています。この機能により、ディスパッチャは車両タイプごとに特定の速度上限を定義でき、車両速度を正確に制御して安全性と業務効率を高めることができます。

さらに、この機能が特に車両の制限速度を制御するものであることを明確にすることが重要です。たとえば、通常速度が30kph、50kph、70kphの道路があり、速度上限を65kphに設定した場合、この上限は通常速度が65kphを超える道路でのみ有効となります。他の道路はすでに速度上限である65kphを下回っているためです。

いくつかのシナリオでは、ディスパッチャはカスタム速度調整を普遍的に必要とし、標準速度に対して車両の速度を変更します。このニーズに応えるため、speedFactorと呼ばれる機能があります。この機能を使用すると、車両の速度を変更して運転時間を調整できます。たとえば、speedFactorが0.5の場合、速度は通常速度の50%になり、車両が同じ距離を走行するのにかかる時間は実質的に2倍になります。

speedCapパラメーターを使用すると、最高速度をメートル/秒 (m/s) で制限できます。移動時間は車両が最高速度を超えないことを考慮して計算されます。この制限は車、トラック、スクーターの車両プロファイルで利用できます。

問題

以下の例では車両の最大速度制限により運転時間が増加し、5メートル/秒に設定されています。 このパラメーターを変更すると、特定のツアーの運転時間とソリューションの合計運転時間に影響します。

Click to expand/collapse the sample JSON
{
  "fleet": {
    "profiles": [
      {
        "type": "car",
        "name": "car_1",
        "options": {
          "speedCap": 5
        }
      }
    ],
    "types": [
      {
        "id": "6290a20b08a7",
        "profile": "car_1",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.006
        },
        "shifts": [
          {
            "start": {
              "time": "2021-08-27T08:03:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            },
            "end": {
              "time": "2021-08-27T16:03:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            }
          }
        ],
        "capacity": [
          50
        ],
        "amount": 1
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "times": [
                    [
                      "2021-08-27T09:03:00Z",
                      "2021-08-27T18:03:00Z"
                    ]
                  ],
                  "location": {
                    "lat": 52.59175589353722,
                    "lng": 13.350747750372257
                  },
                  "duration": 360
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "times": [
                    [
                      "2021-08-27T08:03:00Z",
                      "2021-08-27T18:03:00Z"
                    ]
                  ],
                  "location": {
                    "lat": 52.43363386232821,
                    "lng": 13.403232562191313
                  },
                  "duration": 540
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  }
}

速度上限が設定されたソリューション

このような問題のソリューションは次のようになります。

Click to expand/collapse the sample JSON
{
  "statistic": {
    "cost": 127.941,
    "distance": 50573,
    "duration": 11228,
    "times": {
      "driving": 10328,
      "serving": 900,
      "waiting": 0,
      "stopping": 0,
      "break": 0
    }
  },
  "tours": [
    {
      "vehicleId": "6290a20b08a7_1",
      "typeId": "6290a20b08a7",
      "stops": [
        ... TOUR STOPS
      ],
      "statistic": {
        "cost": 127.941,
        "distance": 50573,
        "duration": 11228,
        "times": {
          "driving": 10328,
          "serving": 900,
          "waiting": 0,
          "stopping": 0,
          "break": 0
        }
      },
      "shiftIndex": 0
    }
  ]
}

速度上限が設定されていないソリューション

同じ問題でも、速度上限が設定されていない場合、総運転時間は異なるはずです。 ソリューションは次のようになります。

Click to expand/collapse the sample JSON
{
  "statistic": {
    "cost": 92.404,
    "distance": 51030,
    "duration": 5229,
    "times": {
      "driving": 4329,
      "serving": 900,
      "waiting": 0,
      "stopping": 0,
      "break": 0
    }
  },
  "tours": [
    {
      "vehicleId": "6290a20b08a7_1",
      "typeId": "6290a20b08a7",
      "stops": [
        ... TOUR STOPS
      ],
      "statistic": {
        "cost": 92.404,
        "distance": 51030,
        "duration": 5229,
        "times": {
          "driving": 4329,
          "serving": 900,
          "waiting": 0,
          "stopping": 0,
          "break": 0
        }
      },
      "shiftIndex": 0
    }
  ]
}

次のステップ