首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在这里,旅游规划使用车辆倍数

在这里,旅游规划使用车辆倍数
EN

Stack Overflow用户
提问于 2022-08-16 16:25:01
回答 1查看 57关注 0票数 0

我正在努力进入这里的巡回赛,并且已经做了一些计划。不过,我现在所处理的问题,是运输的车辆比车辆所能运载的还要多。

问题:我想运输100个单位到10点。我只有一辆载客量为50的汽车,所以我不能在一次旅行中运输所有的东西。车辆行驶的时间和距离是无限的。

我已查过如何处理这个问题。

  1. 使用更多的车辆,
  2. 使用更大的车辆,
  3. 为车辆定义第二次换档,以便它行驶两次。

我想按照解决方案3那样加以实现)。数量和车辆不应改变。这辆车应该更频繁地行驶。但我不知道第一次旅行需要多长时间。我不能说第二班什么时候开始。

你知道如何最好地解决这个问题吗。

EN

回答 1

Stack Overflow用户

发布于 2022-08-24 11:15:47

使用option#3可以很容易地解决问题:在问题文件中为车辆定义2个时差,添加10个带有24小时pf时间窗口的送货作业。该解决方案将由一辆车提供全部10个工作岗位。

举个例子:

代码语言:javascript
运行
复制
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car_1",
        "costs": {
          "fixed": 12.0,
          "distance": 0.003,
          "time": 0.008
        },
        "shifts": [
          {
            "start": {
              "time": "2021-07-17T00:01:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            },
            "end": {
              "time": "2021-07-17T12:00:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            }
          },
          {
            "start": {
              "time": "2021-07-17T12:01:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            },
            "end": {
              "time": "2021-07-17T23:59:00Z",
              "location": {
                "lat": 52.530971,
                "lng": 13.384915
              }
            }
          }
        ],
        "capacity": [
          50
        ],

        "limits": {
          "maxDistance": 3000000,
          "shiftTime": 86400
        },
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car_1"
      }
    ]
  },
  "plan": {
    "jobs": [

      {
       "id": "job_1",
       "tasks": {
           "deliveries": [
                 {
                   "places": [
                     {
                       "times": [
                         [
                           "2021-07-17T00:01:00Z",
                           "2021-07-17T23:59:00Z"
                         ]
                       ],
                       "location": {
                         "lat": 52.400971,
                         "lng": 13.284915
                       },
                       "duration": 900
                     }
                   ],
                   "demand": [
                     10
                   ]
                 }
               ]
       }
     },
     {
        "id": "job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "times": [
                    [
                      "2021-07-17T00:01:00Z",
                      "2021-07-17T23:59:00Z"
                    ]
                  ],
                  "location": {
                    "lat": 52.2346971,
                    "lng": 13.274915
                  },
                  "duration": 900
                }
              ],
              "demand": [
                10
              ]
            }
          ]
        }
      },
      {
         "id": "job_3",
         "tasks": {
           "deliveries": [
             {
               "places": [
                 {
                   "times": [
                     [
                       "2021-07-17T00:01:00Z",
                       "2021-07-17T23:59:00Z"
                     ]
                   ],
                   "location": {
                     "lat": 52.660971,
                     "lng": 13.314915
                   },
                   "duration": 900
                 }
               ],
               "demand": [
                 10
               ]
             }
           ]
         }
       },
       {
          "id": "job_4",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "times": [
                      [
                        "2021-07-17T00:01:00Z",
                        "2021-07-17T23:59:00Z"
                      ]
                    ],
                    "location": {
                      "lat": 52.244971,
                      "lng": 13.344915
                    },
                    "duration": 900
                  }
                ],
                "demand": [
                  10
                ]
              }
            ]
          }
        },
        {
           "id": "job_5",
           "tasks": {
             "deliveries": [
               {
                 "places": [
                   {
                     "times": [
                       [
                         "2021-07-17T00:01:00Z",
                         "2021-07-17T23:59:00Z"
                       ]
                     ],
                     "location": {
                       "lat": 52.150971,
                       "lng": 13.214915
                     },
                     "duration": 900
                   }
                 ],
                 "demand": [
                   10
                 ]
               }
             ]
           }
         },
         {
            "id": "job_6",
            "tasks": {
              "deliveries": [
                {
                  "places": [
                    {
                      "times": [
                        [
                          "2021-07-17T00:01:00Z",
                          "2021-07-17T23:59:00Z"
                        ]
                      ],
                      "location": {
                        "lat": 52.430971,
                        "lng": 13.3454915
                      },
                      "duration": 900
                    }
                  ],
                  "demand": [
                    10
                  ]
                }
              ]
            }
          },
          {
             "id": "job_7",
             "tasks": {
               "deliveries": [
                 {
                   "places": [
                     {
                       "times": [
                         [
                           "2021-07-17T00:01:00Z",
                           "2021-07-17T23:59:00Z"
                         ]
                       ],
                       "location": {
                         "lat": 52.2344971,
                         "lng": 13.224915
                       },
                       "duration": 900
                     }
                   ],
                   "demand": [
                     10
                   ]
                 }
               ]
             }
           }
           ,
           {
              "id": "job_8",
              "tasks": {
                "deliveries": [
                  {
                    "places": [
                      {
                        "times": [
                          [
                            "2021-07-17T00:01:00Z",
                            "2021-07-17T23:59:00Z"
                          ]
                        ],
                        "location": {
                          "lat": 52.330971,
                          "lng": 13.354915
                        },
                        "duration": 900
                      }
                    ],
                    "demand": [
                      10
                    ]
                  }
                ]
              }
            },
            {
               "id": "job_9",
               "tasks": {
                 "deliveries": [
                   {
                     "places": [
                       {
                         "times": [
                           [
                             "2021-07-17T00:01:00Z",
                             "2021-07-17T23:59:00Z"
                           ]
                         ],
                         "location": {
                           "lat": 52.250971,
                           "lng": 13.316915
                         },
                         "duration": 900
                       }
                     ],
                     "demand": [
                       10
                     ]
                   }
                 ]
               }
             },
             {
                "id": "job_10",
                "tasks": {
                  "deliveries": [
                    {
                      "places": [
                        {
                          "times": [
                            [
                              "2021-07-17T00:01:00Z",
                              "2021-07-17T23:59:00Z"
                            ]
                          ],
                          "location": {
                            "lat": 52.420971,
                            "lng": 13.344915
                          },
                          "duration": 900
                        }
                      ],
                      "demand": [
                        10
                      ]
                    }
                  ]
                }
              }
    ]
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73377224

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档