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

時間制約のシーケンスを最適化する方法

時間の制約は、次の2つのパラメーターを使用して定義されます。

  • accは、目的地を訪問できる時間帯を定義します。
  • stは、「サービス時間」を定義します。これは、指定された経由地で費やされた時間を意味します。

次の制約により、月曜日から金曜日の午後12時から午後6時までの訪問が可能となります。サービス時間は15分です。

acc:mo12:00:00+02:00|fr18:00:00+02:00;st:900

時間の制約の定義の詳細については、「APIリファレンス」を参照してください。

車での旅はデュイスブルク=ルーアオルトから始まり、目的地は近くのデュイスブルク=ヘーフェンです。ルートは、ツォルフェアアイン炭鉱業遺産群、ツォルフェライン・コークス工場、ミュールハイムを通過する必要があります。ドライバーは最速のルートを必要としています。

リクエスト

curl -H "Authorization: Bearer BEARER_TOKEN" "https://wps.hereapi.com/v8/findsequence2?departure=2015-05-04T8:00:00%2b01:00&mode=fastest;car;traffic:disabled&start=DuisburgRuhrort;51.4541,6.7406&destination1=ZecheZollverein;51.486,7.0459;acc:mo09:00:00%2b01:00%7cmo10:00:00%2b01:00;st:60&destination2=KokereiZollverein;51.4879,7.0337;acc:mo10:30:00%2b01:00%7cmo12:00:00%2b01:00;st:600&destination3=MuehlheimRuhrHbf;51.432,6.886;acc:mo08:00:00%2b01:00%7cmo09:00:00%2b01:00;st:60&end=DuisburgHafen;51.4576,6.7717&improveFor=TIME"

レスポンス

{
  "results": [
    {
      "waypoints": [
        {
          "id": "DuisburgRuhrort",
          "lat": 51.4541,
          "lng": 6.7406,
          "sequence": 0,
          "estimatedArrival": null,
          "estimatedDeparture": "2015-05-04T08:00:00+01:00",
          "fulfilledConstraints": []
        },
        {
          "id": "MuehlheimRuhrHbf",
          "lat": 51.432,
          "lng": 6.886,
          "sequence": 1,
          "estimatedArrival": "2015-05-04T08:15:57+01:00",
          "estimatedDeparture": "2015-05-04T08:16:57+01:00",
          "fulfilledConstraints": [
            "acc:mo08:00:00+01:00|mo09:00:00+01:00;st:60"
          ]
        },
        {
          "id": "ZecheZollverein",
          "lat": 51.486,
          "lng": 7.0459,
          "sequence": 2,
          "estimatedArrival": "2015-05-04T08:37:15+01:00",
          "estimatedDeparture": "2015-05-04T09:01:00+01:00",
          "fulfilledConstraints": [
            "acc:mo09:00:00+01:00|mo10:00:00+01:00;st:60"
          ]
        },
        {
          "id": "KokereiZollverein",
          "lat": 51.4879,
          "lng": 7.0337,
          "sequence": 3,
          "estimatedArrival": "2015-05-04T09:05:10+01:00",
          "estimatedDeparture": "2015-05-04T10:40:00+01:00",
          "fulfilledConstraints": [
            "acc:mo10:30:00+01:00|mo12:00:00+01:00;st:600"
          ]
        },
        {
          "id": "DuisburgHafen",
          "lat": 51.4576,
          "lng": 6.7717,
          "sequence": 4,
          "estimatedArrival": "2015-05-04T11:04:36+01:00",
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        }
      ],
      "distance": "60641",
      "time": "11076",
      "interconnections": [
        {
          "fromWaypoint": "DuisburgRuhrort",
          "toWaypoint": "MuehlheimRuhrHbf",
          "distance": 12158,
          "time": 957,
          "rest": 0,
          "waiting": 0
        },
        {
          "fromWaypoint": "MuehlheimRuhrHbf",
          "toWaypoint": "ZecheZollverein",
          "distance": 17595,
          "time": 1218,
          "rest": 0,
          "waiting": 1365
        },
        {
          "fromWaypoint": "ZecheZollverein",
          "toWaypoint": "KokereiZollverein",
          "distance": 2524,
          "time": 250,
          "rest": 0,
          "waiting": 5090
        },
        {
          "fromWaypoint": "KokereiZollverein",
          "toWaypoint": "DuisburgHafen",
          "distance": 28364,
          "time": 1476,
          "rest": 0,
          "waiting": 0
        }
      ],
      "description": "Targeted best time; without traffic",
      "timeBreakdown": {
        "driving": 3901,
        "service": 720,
        "rest": 0,
        "waiting": 6455,
        "break": 0
      }
    }
  ],
  "errors": [],
  "processingTimeDesc": "88ms",
  "responseCode": "200",
  "warnings": null,
  "requestId": "cbe2b195-a8d8-4593-97c6-0355be2530cb"
}