在这里巡回策划API任务多天
我有一项工作,必须在第1天提取一些物品,并且必须在第2天交付。 我的舰队从两份工作的两次工作从9:00到18:00转移。 如果我只插入拾音器,请在此处返回响应,但是如果我同时插入拾音器和交货工作,或者如果我将送货和拾音器都放在同一工作中,我会收到错误(无法在车辆时间窗口中提供工作),
我只是尝试了一次接送和一个交付,但目标是在不同日期优化多个工作
{
"configuration":{
"termination":{
"maxTime":30,
"stagnationTime":5
}
},
"fleet":{
"types":[
{
"id":"09c77738-1dba-42f1-b00e-eb63da7147d6",
"profile":"normal_car",
"costs":{
"fixed":22.0,
"distance":1.0E-4,
"time":0.0048
},
"shifts":[
{
"start":{
"time":"2021-01-05T09:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"end":{
"time":"2021-01-05T18:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"breaks":[
{
"times":[
[
"2021-01-05T11:00:00Z",
"2021-01-05T13:00:00Z"
]
],
"duration":1800
}
]
},
{
"start":{
"time":"2021-01-06T09:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"end":{
"time":"2021-01-06T18:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"breaks":[
{
"times":[
[
"2021-01-06T11:00:00Z",
"2021-01-06T13:00:00Z"
]
],
"duration":1800
}
]
}
],
"capacity":[
100,
5
],
"skills":[
"GRU"
],
"limits":{
"maxDistance":100000.0,
"shiftTime":28800.0
},
"amount":1
}
],
"profiles":[
{
"type":"car",
"name":"normal_car"
}
],
"traffic":"liveOrHistorical"
},
"plan":{
"jobs":[
{
"id":"43ef69fd-98ee-4530-acbb-ec774a9d4769",
"tasks":{
"pickups":[
{
"places":[
{
"location":{
"lat":44.492717,
"lng":11.346402
},
"duration":180,
"times":[
[
"2021-01-05T10:00:00Z",
"2021-01-05T17:00:00Z"
]
]
}
],
"demand":[
2
]
}
]
},
"skills":[
"GRU"
],
"priority":2,
"customerId":"012021010408302512_"
},
{
"id":"ed3439b4-270f-488b-8323-5e0109e0d974",
"tasks":{
"deliveries":[
{
"places":[
{
"location":{
"lat":44.361081,
"lng":11.709962
},
"duration":180,
"times":[
[
"2021-01-06T10:00:00Z",
"2021-01-06T17:00:00Z"
]
]
}
],
"demand":[
2
]
}
]
},
"skills":[
"GRU"
],
"priority":2,
"customerId":"012021010408302512_"
}
],
"relations":[
{
"type":"sequence",
"jobs":[
"departure",
"43ef69fd-98ee-4530-acbb-ec774a9d4769",
"ed3439b4-270f-488b-8323-5e0109e0d974",
"arrival"
],
"vehicleId":"09c77738-1dba-42f1-b00e-eb63da7147d6_1"
}
],
"clustering":{
"serviceTimeStrategy":{
"type":"fixedDurationStrategy",
"duration":3600
}
}
}
}
I have a jobs that have to pickup some item on day 1 and have to deliver it on day 2.
my fleet have two shift from from 9:00 to 18:00 from both job.
if I insert only pickup, here return the response, but if i insert both pickup and delivery job or if i put both delivery and pickup on the same job i receive an error (Job cannot be served within vehicle time window)
I just tried with one pickup and one delivery, but the goal is optimize multiple job in different days
{
"configuration":{
"termination":{
"maxTime":30,
"stagnationTime":5
}
},
"fleet":{
"types":[
{
"id":"09c77738-1dba-42f1-b00e-eb63da7147d6",
"profile":"normal_car",
"costs":{
"fixed":22.0,
"distance":1.0E-4,
"time":0.0048
},
"shifts":[
{
"start":{
"time":"2021-01-05T09:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"end":{
"time":"2021-01-05T18:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"breaks":[
{
"times":[
[
"2021-01-05T11:00:00Z",
"2021-01-05T13:00:00Z"
]
],
"duration":1800
}
]
},
{
"start":{
"time":"2021-01-06T09:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"end":{
"time":"2021-01-06T18:00:00Z",
"location":{
"lat":44.492717,
"lng":11.346402
}
},
"breaks":[
{
"times":[
[
"2021-01-06T11:00:00Z",
"2021-01-06T13:00:00Z"
]
],
"duration":1800
}
]
}
],
"capacity":[
100,
5
],
"skills":[
"GRU"
],
"limits":{
"maxDistance":100000.0,
"shiftTime":28800.0
},
"amount":1
}
],
"profiles":[
{
"type":"car",
"name":"normal_car"
}
],
"traffic":"liveOrHistorical"
},
"plan":{
"jobs":[
{
"id":"43ef69fd-98ee-4530-acbb-ec774a9d4769",
"tasks":{
"pickups":[
{
"places":[
{
"location":{
"lat":44.492717,
"lng":11.346402
},
"duration":180,
"times":[
[
"2021-01-05T10:00:00Z",
"2021-01-05T17:00:00Z"
]
]
}
],
"demand":[
2
]
}
]
},
"skills":[
"GRU"
],
"priority":2,
"customerId":"012021010408302512_"
},
{
"id":"ed3439b4-270f-488b-8323-5e0109e0d974",
"tasks":{
"deliveries":[
{
"places":[
{
"location":{
"lat":44.361081,
"lng":11.709962
},
"duration":180,
"times":[
[
"2021-01-06T10:00:00Z",
"2021-01-06T17:00:00Z"
]
]
}
],
"demand":[
2
]
}
]
},
"skills":[
"GRU"
],
"priority":2,
"customerId":"012021010408302512_"
}
],
"relations":[
{
"type":"sequence",
"jobs":[
"departure",
"43ef69fd-98ee-4530-acbb-ec774a9d4769",
"ed3439b4-270f-488b-8323-5e0109e0d974",
"arrival"
],
"vehicleId":"09c77738-1dba-42f1-b00e-eb63da7147d6_1"
}
],
"clustering":{
"serviceTimeStrategy":{
"type":"fixedDurationStrategy",
"duration":3600
}
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在此旅行计划API任务在多天以来,由于您将工作添加到了关系中,因此一个关系对象适用于一个班次。这意味着您要求在车辆的第一次班次中完成这两个工作。尽管其中一个工作是从车辆的第一个换班时间窗口中脱出的,但返回了错误。在关系中,您可以指定ShiftIndex属性,以指导必须完成工作的位置。这是ShiftIndex属性问题的修改后的“关系”对象。这样,第一个作业将在第一个Shift(ShiftIndex = 0)中完成,第二个作业将在第二班(ShiftIndex = 1)中完成。
“关系”:[{{“ type”:“ sequence”,“ jobs”:[“ deptionure”,“ 43EF69FD-98EE-4530-4530-ACBB-EC774A9D4769”,“到达”,“ shiftIndex”。 “ 09C77738-1DBA-42F1-B00E-EB63DA7147D6_1”},{“ type”:“ sequence”,“ jobs”:[“ decress”,“ ed3439b4-270f-488b-488b-8323-b-5e010109e0109e0109e0d9e0d974” “:1,” warterid”:“ 09C77738-1DBA-42F1-B00E-EB63DA7147D6_1”}]
HERE Tour Planning API Task on multiple day Since you have added the jobs to the relation, the one relation object applies to one shift. That means you are asking to complete both jobs in the first shift of the vehicle. While one of the jobs is out of the vehicle’s first shift time window, the error is returned. In the relations, you can specify the shiftIndex property to guide in which shift the job has to be completed. Here is the modified 'relations' object for the problem with shiftIndex property. With this, the first job will be completed in the first shift (shiftIndex = 0) and the second will be done in the second shift (shiftIndex = 1).
"relations":[ { "type":"sequence", "jobs":[ "departure", "43ef69fd-98ee-4530-acbb-ec774a9d4769", "arrival" ], "shiftIndex" : 0, "vehicleId":"09c77738-1dba-42f1-b00e-eb63da7147d6_1" }, { "type":"sequence", "jobs":[ "departure", "ed3439b4-270f-488b-8323-5e0109e0d974", "arrival" ], "shiftIndex" : 1, "vehicleId":"09c77738-1dba-42f1-b00e-eb63da7147d6_1" } ]