gpt4 book ai didi

java - 在常规中获取意外数据

转载 作者:太空宇宙 更新时间:2023-11-04 12:22:10 24 4
gpt4 key购买 nike

我正在使用 Routific 进行路由优化。但我得到了意想不到的结果。见下面的json

{
"visits": {
"order_1": {
"location": {
"name": "sanjay park",
"lat": 18.56873,
"lng": 73.90603
},
"start": "9:00",
"end": "12:00",
"duration": 10,
"priority": "high"
},
"order_2": {
"location": {
"name": "lohgon",
"lat": 18.59113,
"lng": 73.91882
},
"start": "9:00",
"end": "12:00",
"duration": 10,
"priority": "low"
},
"order_3": {
"location": {
"name": "kudachi",
"lat": 16.62638,
"lng": 74.85656
},
"start": "9:30",
"end": "17:00",
"duration": 10


}
},
"fleet": {
"vehicle_1": {
"start_location": {
"id": "depot",
"name": "vidhyanager",
"lat": 18.57997,
"lng": 73.89432
},
"end_location": {
"id": "depot",
"name": "vidhyanager",
"lat": 18.57997,
"lng": 73.89432
},
"shift_start": "8:00",
"shift_end": "23:00"
}
}
}

在上面的 json 中,我已将 “sanjay park” 指定为高优先级,将“lohgaon”指定为低优先级,但获取它时仅优先考虑 “lohgaon” 位置。

参见下面的输出

{
"status": "success",
"total_travel_time": 452.23334,
"total_idle_time": 0,
"num_unserved": 0,
"unserved": null,
"solution": {
"vehicle_1": [
{
"location_id": "depot",
"location_name": "vidhyanager",
"arrival_time": "08:54"
},
{
"location_id": "order_2",
"location_name": "lohgon",
"arrival_time": "09:00",
"finish_time": "09:10"
},
{
"location_id": "order_1",
"location_name": "sanjay park",
"arrival_time": "09:15",
"finish_time": "09:25"
},
{
"location_id": "order_3",
"location_name": "kudachi",
"arrival_time": "13:32",
"finish_time": "13:42"
},
{
"location_id": "depot",
"location_name": "vidhyanager",
"arrival_time": "16:56"
}
]
}
}

请感谢您对此的评论

最佳答案

这是文档的说明:

priority allows you to make certain visits a priority over others. In some cases you have more visits than you can serve, resulting in a few unserved. But if you want to make sure your high priority visits take precedence, use this parameter and set it to "high".

因此它用于确保高优先级订单得到服务。在您的情况下,所有订单均已送达,因此此参数不会执行任何操作。如果您希望在当天早些时候为 sanjay park 提供服务,则应使用时间窗口限制。

关于java - 在常规中获取意外数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38744319/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com