休憩時間パラメーターの使用方法
breakTimesパラメーターを使用して、特定の時間を空き時間またはアイドル時間として指定できます。指定された時間内は停車地や移動が計画されません。これにより、たとえば、特定の場所を指定することなく昼休みのスケジュールを設定できます。
デフォルトでは、休憩によってサービス時間と走行が中断されます。休憩が終了すると、サービスまたは走行が再開されます。
制限
次の制限が適用されます。
breakTimesパラメーターの値が経由地のサービス時間内に収まり、閉店時間などの制約に違反する場合、シーケンスは生成されません。- 休息時間と休憩時間を組み合わせることはできません。
- 休憩が重複する場合は検証エラーが発生します。
休憩によるサービス時間の中断を防止する
サービス時間が休憩によって中断されないようにするには、サービス時間設定でinterruptibleフラグを使用してfalseに設定します。
interruptibleフラグはbreakTimesパラメーターとともに使用する必要があります。interruptibleフラグをclusteringパラメーターとともに使用することはできません。
例
次のリクエスト例は、さまざまな経由地シーケンスを最適化するときにbreakTimesパラメーターを使用する方法を示しています。
休憩時間によってサービスが中断される可能性がある
curl -gX GET 'https://wps.hereapi.com/v8/findsequence2?'\
'mode=fastest;car;traffic:disabled&'\
'start=DuisburgRuhrort;51.4541,6.7406&'\
'departure=2024-06-14T07:30:00%2B02:00&'\
'destination1=Gelsenkirchen;51.5053,7.1016;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination2=ZecheZollverein;51.486,7.0459;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination3=KokereiZollverein;51.49016,7.03141;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination4=MuehlheimRuhrHbf;51.432,6.886;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination5=BochumRathaus;51.4832,7.2186;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination6=DortmundHbf;51.5169,7.4605;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination7=Bochum;51.4732,7.1771;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination8=EssenGrugapark;51.4304,7.0011;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'destination9=Herne;51.537974,7.217826;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:1800&'\
'destination10=Bottrop;51.51936,6.95109;acc:fr08:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'improveFor=time&'\
'restTimes=disabled&'\
'end=DuisburgHafen;51.4576,6.7717&'\
'breakTimes=2024-06-14T12:00:00%2B02:00;3600&'\
'apikey=API_KEY'Click to expand/collapse the API response
3600秒 (60 分) の休憩は、ツェッヘ・ツォルフェアアインからグルガパーク・エッセンへの移動中に設定されています。このことは、その区間の"break": 3600が示しています。
ドライバーは11:50:14にツェッヘ・ツォルフェアアインを出発し、12:00まで走行します。12:00から13:00まで休憩を取ります。ドライバーは13:02:29にグルガパーク・エッセンに到着します。この間、サービス時間が中断されることはありません。
{
"results": [
{
"waypoints": [
{
"id": "DuisburgRuhrort",
"lat": 51.4541,
"lng": 6.7406,
"sequence": 0,
"estimatedArrival": null,
"estimatedDeparture": "2024-06-14T07:30:00+02:00",
"fulfilledConstraints": []
},
{
"id": "Herne",
"lat": 51.537974,
"lng": 7.217826,
"sequence": 1,
"estimatedArrival": "2024-06-14T07:56:36+02:00",
"estimatedDeparture": "2024-06-14T08:30:00+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:1800"
]
},
{
"id": "DortmundHbf",
"lat": 51.5169,
"lng": 7.4605,
"sequence": 2,
"estimatedArrival": "2024-06-14T08:50:22+02:00",
"estimatedDeparture": "2024-06-14T09:05:22+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "BochumRathaus",
"lat": 51.4832,
"lng": 7.2186,
"sequence": 3,
"estimatedArrival": "2024-06-14T09:26:30+02:00",
"estimatedDeparture": "2024-06-14T09:41:30+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "Bochum",
"lat": 51.4732,
"lng": 7.1771,
"sequence": 4,
"estimatedArrival": "2024-06-14T09:49:49+02:00",
"estimatedDeparture": "2024-06-14T10:04:49+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "Gelsenkirchen",
"lat": 51.5053,
"lng": 7.1016,
"sequence": 5,
"estimatedArrival": "2024-06-14T10:18:04+02:00",
"estimatedDeparture": "2024-06-14T10:33:04+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "Bottrop",
"lat": 51.51936,
"lng": 6.95109,
"sequence": 6,
"estimatedArrival": "2024-06-14T10:46:44+02:00",
"estimatedDeparture": "2024-06-14T11:01:44+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "KokereiZollverein",
"lat": 51.49016,
"lng": 7.03141,
"sequence": 7,
"estimatedArrival": "2024-06-14T11:15:32+02:00",
"estimatedDeparture": "2024-06-14T11:30:32+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "ZecheZollverein",
"lat": 51.486,
"lng": 7.0459,
"sequence": 8,
"estimatedArrival": "2024-06-14T11:35:14+02:00",
"estimatedDeparture": "2024-06-14T11:50:14+02:00", // driver departs; break begins at 12:00 during travel
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "EssenGrugapark",
"lat": 51.4304,
"lng": 7.0011,
"sequence": 9,
"estimatedArrival": "2024-06-14T13:02:29+02:00", // arrival after break ends at 13:00; service uninterrupted
"estimatedDeparture": "2024-06-14T13:17:29+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "MuehlheimRuhrHbf",
"lat": 51.432,
"lng": 6.886,
"sequence": 10,
"estimatedArrival": "2024-06-14T13:29:48+02:00",
"estimatedDeparture": "2024-06-14T13:44:48+02:00",
"fulfilledConstraints": [
"acc:fr08:00:00+02:00|fr18:00:00+02:00;st:900"
]
},
{
"id": "DuisburgHafen",
"lat": 51.4576,
"lng": 6.7717,
"sequence": 11,
"estimatedArrival": "2024-06-14T13:58:35+02:00",
"estimatedDeparture": null,
"fulfilledConstraints": []
}
],
"distance": "153064",
"time": "23315",
"interconnections": [
{
"fromWaypoint": "DuisburgRuhrort",
"toWaypoint": "Herne",
"distance": 38500,
"time": 1596,
"rest": 0,
"waiting": 204
},
{
"fromWaypoint": "Herne",
"toWaypoint": "DortmundHbf",
"distance": 24587,
"time": 1222,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "DortmundHbf",
"toWaypoint": "BochumRathaus",
"distance": 20437,
"time": 1268,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "BochumRathaus",
"toWaypoint": "Bochum",
"distance": 4289,
"time": 499,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "Bochum",
"toWaypoint": "Gelsenkirchen",
"distance": 10712,
"time": 795,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "Gelsenkirchen",
"toWaypoint": "Bottrop",
"distance": 13392,
"time": 820,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "Bottrop",
"toWaypoint": "KokereiZollverein",
"distance": 9556,
"time": 828,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "KokereiZollverein",
"toWaypoint": "ZecheZollverein",
"distance": 2431,
"time": 282,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "ZecheZollverein",
"toWaypoint": "EssenGrugapark",
"distance": 7807,
"time": 735,
"break": 3600, // 60-minute break falls during this leg
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "EssenGrugapark",
"toWaypoint": "MuehlheimRuhrHbf",
"distance": 11225,
"time": 739,
"rest": 0,
"waiting": 0
},
{
"fromWaypoint": "MuehlheimRuhrHbf",
"toWaypoint": "DuisburgHafen",
"distance": 10128,
"time": 827,
"rest": 0,
"waiting": 0
}
],
"description": "Targeted best time; without traffic",
"timeBreakdown": {
"driving": 9611,
"service": 9900,
"rest": 0,
"waiting": 204,
"break": 3600 // total break time (seconds)
}
}
],
"errors": [],
"processingTimeDesc": "211ms",
"responseCode": "200",
"warnings": null,
"requestId": "c78f0e53-4e87-4ee8-a326-1c2438872153"
}休憩時間によってサービスが中断されない
curl -gX GET 'https://wps.hereapi.com/v8/findsequence2?'\
'departure=2024-08-27T09:30:00Z&'\
'mode=shortest;car;traffic:enabled&'\
'start=START;13.01322,77.72112&'\
'breakTimes=2024-08-27T13:00:00Z;3600&'\
'end=END;13.01322,77.72112;st:1;acc:tu09:30:00Z|tu23:59:59Z&'\
'destination1=D1;12.99119123438,77.71621874776;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination2=D2;12.98021,77.71521;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination3=D3;12.98051,77.74722;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination4=D4;12.97958,77.75099;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination5=D5;12.96802,77.72608;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination6=D6;12.96731,77.71774;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'destination7=D7;12.97122,77.71225;acc:tu08:00:00Z|tu12:00:00Z,tu12:00:00Z|tu18:00:00Z;st:2400,interruptible:false&'\
'destination8=D8;13.00073575196138,77.67540576871859;acc:tu09:30:00Z|tu23:59:00Z;st:2400,interruptible:false&'\
'apikey=API-KEY'Click to expand/collapse the API response
3600秒 (60 分) の休憩は、経由地D8とD7の間の区間に設定されています。ドライバーは12:59:35に経由地D7に到着します。その後25秒間待機 ("waiting": 25と表示) し、13:00から休憩に入ります。すべての目的地でinterruptible:falseが設定されているため、経由地D7でのサービスは休憩が終了する14:00に開始されます。サービス時間は14:40に終了します。
{
"results": [
{
"waypoints": [
{
"id": "START",
"lat": 13.01322,
"lng": 77.72112,
"sequence": 0,
"estimatedArrival": null,
"estimatedDeparture": "2024-08-27T09:30:00Z",
"fulfilledConstraints": []
},
{
"id": "D3",
"lat": 12.98051,
"lng": 77.74722,
"sequence": 1,
"estimatedArrival": "2024-08-27T09:48:50Z",
"estimatedDeparture": "2024-08-27T10:28:50Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D4",
"lat": 12.97958,
"lng": 77.75099,
"sequence": 2,
"estimatedArrival": "2024-08-27T10:30:10Z",
"estimatedDeparture": "2024-08-27T11:10:10Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D1",
"lat": 12.99119123438,
"lng": 77.71621874776,
"sequence": 3,
"estimatedArrival": "2024-08-27T11:18:21Z",
"estimatedDeparture": "2024-08-27T11:58:21Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D8",
"lat": 13.00073575196138,
"lng": 77.67540576871859,
"sequence": 4,
"estimatedArrival": "2024-08-27T12:07:57Z",
"estimatedDeparture": "2024-08-27T12:47:57Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D7",
"lat": 12.97122,
"lng": 77.71225,
"sequence": 5,
"estimatedArrival": "2024-08-27T12:59:35Z", // arrives 25s before break begins at 13:00
"estimatedDeparture": "2024-08-27T14:40:00Z", // service starts after break ends at 14:00 (interruptible:false)
"fulfilledConstraints": [
"acc:tu12:00:00+00:00|tu18:00:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D6",
"lat": 12.96731,
"lng": 77.71774,
"sequence": 6,
"estimatedArrival": "2024-08-27T14:41:35Z",
"estimatedDeparture": "2024-08-27T15:21:35Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D5",
"lat": 12.96802,
"lng": 77.72608,
"sequence": 7,
"estimatedArrival": "2024-08-27T15:27:27Z",
"estimatedDeparture": "2024-08-27T16:07:27Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "D2",
"lat": 12.98021,
"lng": 77.71521,
"sequence": 8,
"estimatedArrival": "2024-08-27T16:13:51Z",
"estimatedDeparture": "2024-08-27T16:53:51Z",
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:00+00:00;st:2400,interruptible:false"
]
},
{
"id": "END",
"lat": 13.01322,
"lng": 77.72112,
"sequence": 9,
"estimatedArrival": "2024-08-27T17:10:29Z",
"estimatedDeparture": null,
"fulfilledConstraints": [
"acc:tu09:30:00+00:00|tu23:59:59+00:00;st:1"
]
}
],
"distance": "35347",
"time": "27630",
"interconnections": [
{
"fromWaypoint": "START",
"toWaypoint": "D3",
"distance": 7677.0,
"time": 1130.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D3",
"toWaypoint": "D4",
"distance": 443.0,
"time": 80.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D4",
"toWaypoint": "D1",
"distance": 4767.0,
"time": 491.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D1",
"toWaypoint": "D8",
"distance": 5374.0,
"time": 576.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D8",
"toWaypoint": "D7",
"distance": 6300.0,
"time": 698.0,
"break": 3600.0, // 60-minute break occurs during this leg
"rest": 0.0,
"waiting": 25.0 // 25s wait at D7 before break begins at 13:00
},
{
"fromWaypoint": "D7",
"toWaypoint": "D6",
"distance": 828.0,
"time": 95.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D6",
"toWaypoint": "D5",
"distance": 1719.0,
"time": 352.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D5",
"toWaypoint": "D2",
"distance": 2867.0,
"time": 384.0,
"rest": 0.0,
"waiting": 0.0
},
{
"fromWaypoint": "D2",
"toWaypoint": "END",
"distance": 5372.0,
"time": 998.0,
"rest": 0.0,
"waiting": 0.0
}
],
"description": "Targeted best time; with , improvement for traffic",
"timeBreakdown": {
"driving": 4804,
"service": 19201,
"rest": 0,
"waiting": 25, // 25s wait before break
"break": 3600 // total break time (seconds)
}
}
],
"errors": [],
"processingTimeDesc": "556ms",
"responseCode": "200",
"warnings": null,
"requestId": "357700ce-cd98-4f91-9ecf-990455ca8288"
}制約と休憩時間がある2つの経由地
curl -gX GET 'https://wps.hereapi.com/v8/findsequence2?'\
'mode=fastest;car;traffic:disabled&'\
'start=DuisburgRuhrort;51.4541,6.7406&'\
'departure=2024-07-01T09:30:00%2B02:00&'\
'destination1=ZecheZollverein;51.486,7.0459;acc:mo12:00:00%2B02:00|mo18:00:00%2B02:00;st:900&'\
'improveFor=time&'\
'restTimes=disabled&'\
'end=KokereiZollverein;51.49016,7.03141;acc:mo12:00:00%2B02:00|fr18:00:00%2B02:00;st:900&'\
'breakTimes=2024-07-01T12:00:00%2B02:00;7200&'\
'apikey=API_KEY'Click to expand/collapse the API response
7200秒 (120分) の休憩 (デュイスブルク・ルールロトとツェッヘ・ツォルフェライン間の区間における"break": 7200) はツェッヘ・ツォルフェアアインでのサービス開始前に設定されています。ドライバーは11:53:04にツェッヘ・ツォルフェアアインに到着し、その経由地で900秒間 (15分) のサービスを完了した後、12:15:00に出発します。
{
"results": [
{
"waypoints": [
{
"id": "DuisburgRuhrort",
"lat": 51.4541,
"lng": 6.7406,
"sequence": 0,
"estimatedArrival": null,
"estimatedDeparture": "2024-07-01T09:30:00+02:00",
"fulfilledConstraints": []
},
{
"id": "ZecheZollverein",
"lat": 51.486,
"lng": 7.0459,
"sequence": 1,
"estimatedArrival": "2024-07-01T11:53:04+02:00", // arrives before service window opens at 12:00
"estimatedDeparture": "2024-07-01T12:15:00+02:00", // departs after 900s service (12:00–12:15)
"fulfilledConstraints": [
"acc:mo12:00:00+02:00|mo18:00:00+02:00;st:900"
]
},
{
"id": "KokereiZollverein",
"lat": 51.49016,
"lng": 7.03141,
"sequence": 2,
"estimatedArrival": "2024-07-01T12:21:03+02:00",
"estimatedDeparture": null,
"fulfilledConstraints": [
"acc:mo12:00:00+02:00|fr18:00:00+02:00;st:900"
]
}
],
"distance": "31572",
"time": "11163",
"interconnections": [
{
"fromWaypoint": "DuisburgRuhrort",
"toWaypoint": "ZecheZollverein",
"distance": 28491,
"time": 1384,
"break": 7200, // 120-minute break falls before service begins at ZecheZollverein
"rest": 0,
"waiting": 416 // wait before service window opens at 12:00
},
{
"fromWaypoint": "ZecheZollverein",
"toWaypoint": "KokereiZollverein",
"distance": 3081,
"time": 363,
"rest": 0,
"waiting": 0
}
],
"description": "Targeted best time; without traffic",
"timeBreakdown": {
"driving": 1747,
"service": 1800,
"rest": 0,
"waiting": 416, // wait before service window opens
"break": 7200 // total break time (seconds)
}
}
],
"errors": [],
"processingTimeDesc": "117ms",
"responseCode": "200",
"warnings": null,
"requestId": "5a1b6802-b1f2-45bd-98ec-5d63f4f2e188"
}2回の休憩時間がある経由地のシーケンス
curl -gX GET 'https://wps.hereapi.com/v8/findsequence2?'\
'mode=fastest;car;traffic:disabled&'\
'start=DuisburgRuhrort;51.4541,6.7406&'\
'departure=2024-07-01T07:30:00%2B02:00&'\
'destination1=ZecheZollverein;51.486,7.0459;acc:mo09:00:00%2B02:00|mo18:00:00%2B02:00;st:18000&'\
'improveFor=time&'\
'restTimes=disabled&'\
'end=KokereiZollverein;51.49016,7.03141;acc:mo09:00:00%2B02:00|mo18:00:00%2B02:00;st:5400&'\
'breakTimes=2024-07-01T12:00:00%2B02:00;3600,2024-07-01T15:00:00%2B02:00;3600&'\
'apikey=API_KEY'Click to expand/collapse the API response
3,600秒の休憩が2回追加され、合計7,200秒 (120分) になります。これは、timeBreakdownの"break": 7200で確認できます。どちらの休憩もツェッヘ・ツォルフェアアインでのサービス時間 (18,000秒/300分/5時間) 内に収まるため、その経由地からの出発は15:00まで遅延することになります。
{
"results": [
{
"waypoints": [
{
"id": "DuisburgRuhrort",
"lat": 51.4541,
"lng": 6.7406,
"sequence": 0,
"estimatedArrival": null,
"estimatedDeparture": "2024-07-01T07:30:00+02:00",
"fulfilledConstraints": []
},
{
"id": "ZecheZollverein",
"lat": 51.486,
"lng": 7.0459,
"sequence": 1,
"estimatedArrival": "2024-07-01T08:53:04+02:00",
"estimatedDeparture": "2024-07-01T15:00:00+02:00", // departure delayed by two breaks during 5-hour service
"fulfilledConstraints": [
"acc:mo09:00:00+02:00|mo18:00:00+02:00;st:18000"
]
},
{
"id": "KokereiZollverein",
"lat": 51.49016,
"lng": 7.03141,
"sequence": 2,
"estimatedArrival": "2024-07-01T15:06:03+02:00",
"estimatedDeparture": null,
"fulfilledConstraints": [
"acc:mo09:00:00+02:00|mo18:00:00+02:00;st:5400"
]
}
],
"distance": "31572",
"time": "32763",
"interconnections": [
{
"fromWaypoint": "DuisburgRuhrort",
"toWaypoint": "ZecheZollverein",
"distance": 28491,
"time": 1384,
"break": 7200, // combined total of both 3600s breaks
"rest": 0,
"waiting": 416
},
{
"fromWaypoint": "ZecheZollverein",
"toWaypoint": "KokereiZollverein",
"distance": 3081,
"time": 363,
"rest": 0,
"waiting": 0
}
],
"description": "Targeted best time; without traffic",
"timeBreakdown": {
"driving": 1747,
"service": 23400,
"rest": 0,
"waiting": 416,
"break": 7200 // combined total of both 3600s breaks (seconds)
}
}
],
"errors": [],
"processingTimeDesc": "90ms",
"responseCode": "200",
"warnings": null,
"requestId": "1fa50dac-8d13-4d9c-a95c-1aea4fabe0a8"
}先月の更新