首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >带时间窗约束的旅游规划问题

带时间窗约束的旅游规划问题
EN

Stack Overflow用户
提问于 2022-08-17 13:28:18
回答 1查看 70关注 0票数 0

我正在创建一个演示,以优化一些拾取和送货工作。我的数据集有不同的货件,需要有收件和递送。通常送货是在一天后,然后接(但可能更多)的演示,每一批货物有不同数量的包装,以满足需求(我不需要照顾数量或重量)

我创建了一些车辆,它的换档应该涵盖整个装运期间,但我继续得到time_window_costraint错误。我试着增加数量,容量,增加持续时间转移。但什么都不起作用

代码语言:javascript
运行
复制
    {
  "configuration": {
    "termination": {
      "maxTime": 30,
      "stagnationTime": 5
    }
  },
  "fleet": {
    "types": [
      {
        "id": "ffe012c5-e094-4f44-bbb0-25d68cb05b75",
        "profile": "normal_car",
        "costs": {
          "fixed": 22,
          "distance": 0.0001,
          "time": 0.0048
        },
        "shifts": [
          {
            "start": {
              "time": "2021-01-04T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-04T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-04T12:00:00Z",
                    "2021-01-04T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-05T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-05T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-05T12:00:00Z",
                    "2021-01-05T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-06T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-06T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-06T12:00:00Z",
                    "2021-01-06T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-07T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-07T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-07T12:00:00Z",
                    "2021-01-07T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-08T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-08T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-08T12:00:00Z",
                    "2021-01-08T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-09T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-09T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-09T12:00:00Z",
                    "2021-01-09T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          },
          {
            "start": {
              "time": "2021-01-10T01:00:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "end": {
              "time": "2021-01-10T23:59:00Z",
              "location": {
                "lat": 45.45092,
                "lng": 9.11703
              }
            },
            "breaks": [
              {
                "times": [
                  [
                    "2021-01-10T12:00:00Z",
                    "2021-01-10T13:00:00Z"
                  ]
                ],
                "duration": 10800
              }
            ]
          }
        ],
        "capacity": [
          100,
          10
        ],
        "skills": [
          "VER",
          "GRU",
          "PTT"
        ],
        "amount": 50
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "normal_car"
      }
    ],
    "traffic": "automatic"
  },
  "plan": {
    "jobs": [
      {
        "id": "be294863-9f3b-4e69-934d-855ffd29b18a",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-06T18:00:00Z",
                      "2021-01-06T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                1
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.05247,
                    "lng": 10.93323
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-07T10:00:00Z",
                      "2021-01-07T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010508591016_"
      },
      {
        "id": "c2a0cb1b-5f79-4482-a858-da5b75bd1649",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                2
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.63506,
                    "lng": 11.75273
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                2
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010709395583_"
      },
      {
        "id": "9700038f-cbc7-4267-94db-03f10852630c",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                1
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.74058,
                    "lng": 11.75615
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010709484930_"
      },
      {
        "id": "7d3fa445-30a6-46d5-99ce-40ef75ffd7d3",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                6
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 44.67897,
                    "lng": 11.03683
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                6
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010711175223_"
      },
      {
        "id": "ef7404d8-ed03-4585-8484-4ce7a596e32b",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                5
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.47498,
                    "lng": 12.23138
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                5
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010712034208_"
      },
      {
        "id": "bbba64a2-3716-4eeb-a03a-9098e8f0a844",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                4
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.74232,
                    "lng": 11.65143
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                4
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010712172566_"
      },
      {
        "id": "6d644418-88e6-40f1-a0b7-c0f9e929b794",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                12
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.52001,
                    "lng": 11.91385
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                12
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010712264327_"
      },
      {
        "id": "f42e1a9c-da42-477c-8cec-84a1116eaf55",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                6
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.52001,
                    "lng": 11.91385
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                6
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010712362396_"
      },
      {
        "id": "068a3414-8b23-4c1c-b04d-15b0e6a02b9b",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                12
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.52001,
                    "lng": 11.91385
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                12
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010712571875_"
      },
      {
        "id": "ae9a303e-8c22-44ae-ad20-0b4c94caaeea",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 45.41564,
                    "lng": 9.0453
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-08T18:00:00Z",
                      "2021-01-08T19:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                3
              ]
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 44.10338,
                    "lng": 12.42132
                  },
                  "duration": 1,
                  "times": [
                    [
                      "2021-01-09T10:00:00Z",
                      "2021-01-09T11:00:00Z"
                    ]
                  ]
                }
              ],
              "demand": [
                3
              ]
            }
          ]
        },
        "skills": [
          "VER"
        ],
        "priority": 2,
        "customerId": "042021010714154753_"
      }
    ]
  }
}
EN

回答 1

Stack Overflow用户

发布于 2022-08-22 11:10:40

轮班最长时间可以是24小时或86400秒,包括休息时间。

在这里,您可以看到引用

这里是旅游规划API参考资料

在舰队之下,->类型,->限制-> shiftTime

[shiftTime编号1 ..。86400 ]属性shiftTime定义了车辆类型的最大允许工作时间。如果为此特定车辆类型定义了中断,则应将中断的持续时间添加到shiftTime中。例如,如果车辆类型的换档时间为8小时30分钟,则应将总shiftTime定义为8小时30分钟。start.time和end.time属性在VehicleShift上定义了车辆换挡时间间隔的下界和上界。在任何情况下,车辆不得在start.time之前开始工作,或在end.time之后完成工作。start.time和end.time可以想象为车行开始和结束的车库的开放和关闭时间。start.time和end.time可以覆盖定义的shiftTime。这意味着,如果shiftTime属性定义的时间比start.time和end.time之间的时间间隔更长,则车辆的最大工作时间将减少,并且不会超过该时间间隔。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73389353

复制
相关文章

相似问题

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