我有一个工作,必须在第一天拿一些东西,并必须在第二天交付它,我的舰队有两班从9:00到6: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
}
}
}
}
发布于 2022-08-04 12:56:15
这里的旅游规划API任务在多天,因为您已经添加了作业到关系,一个关系对象适用于一个班次。这意味着你要求在车辆的第一班完成这两项工作。当其中一个作业超出车辆的第一个换班时间窗口时,错误将返回。在关系中,您可以指定shiftIndex属性来指导必须完成工作转移的位置。以下是针对shiftIndex属性问题修改的“关系”对象。这样,第一次工作将在第一班完成(shiftIndex = 0),第二次工作将在第二班完成(shiftIndex = 1)。
“关系”:[{“类型”:“序列”,“职务”:“离开”,"43ef69fd-98ee-4530-acbb-ec774a9d4769",“到达”,"shiftIndex“:0,shiftIndex },{”类型“:”序列“,”作业“:”离开“,”离开“,"ed3439b4-270f-488b-8323-5e0109e0d974",”到达“,"shiftIndex”:1,"vehicleId":"09c77738-1dba-42f1-b00e-eb63da7147d6_1“}
https://stackoverflow.com/questions/72683904
复制相似问题