我正在使用MIO多路线优化来优化去杠杆率,以达到一定的置入效果。我需要添加一个可访问性的限制,因为并不是所有的vheicule都可以访问所有的行程。
是否有一种方法可以在MIO中直接添加这一点,或者在使用API之前添加一些逻辑。
如果无法使用MIO,您建议作为其他API / Python库来响应这一需求。
例如,这是Ii正在使用的输入:
{
"agents": [
{
"name": "A",
"shifts": [
{
"startTime": "2022-08-12T05:30:00",
"startLocation": {
"latitude": 36.76842,
"longitude": 10.21499
},
"endTime": "2022-08-12T11:30:00",
"endLocation": {
"latitude": 36.76842,
"longitude": 10.21499
}
}
],
"capacity": [
32
]
},
{
"name": "B",
"shifts": [
{
"startTime": "2022-08-12T05:30:00",
"startLocation": {
"latitude": 36.76842,
"longitude": 10.21499
},
"endTime": "2022-08-12T11:30:00",
"endLocation": {
"latitude": 36.76842,
"longitude": 10.21499
}
}
],
"capacity": [
16
]
}
],
"itineraryItems": [
{
"name": "AA",
"openingTime": "2022-08-12T05:45:00",
"closingTime": "2022-08-12T11:00:00",
"dwellTime": "00:04:00.00",
"priority": 1,
"quantity": [
8
],
"location": {
"latitude": 36.8570129,
"longitude": 10.1276135
}
},
{
"name": "BB",
"openingTime": "2022-08-12T05:45:00",
"closingTime": "2022-08-12T11:00:00",
"dwellTime": "00:04:00.00",
"priority": 1,
"quantity": [
8
],
"location": {
"latitude": 36.845275,
"longitude": 10.183444
}
}
],
"type": "TrafficRequest",
"costvalue": "Distance"
}对于响应,我得到了未使用的代理B和A执行2交付。但是我需要A给AA和B到BB。
发布于 2022-09-01 16:40:24
对此作出反应的唯一方法是每次使用每种卡车类型的MIO。
第一次用32码的卡车和所有接受这个尺寸的行程项目,第二次我们使用容量为16的卡车和接受这个尺寸的行程。
例如:
第一次呼叫:
{
"agents": [
{
"name": "A",
"shifts": [
{
"startTime": "2022-08-12T05:30:00",
"startLocation": {
"latitude": 36.76842,
"longitude": 10.21499
},
"endTime": "2022-08-12T11:30:00",
"endLocation": {
"latitude": 36.76842,
"longitude": 10.21499
}
}
],
"capacity": [
32
]
}
],
"itineraryItems": [
{
"name": "AA",
"openingTime": "2022-08-12T05:45:00",
"closingTime": "2022-08-12T11:00:00",
"dwellTime": "00:04:00.00",
"priority": 1,
"quantity": [
8
],
"location": {
"latitude": 36.8570129,
"longitude": 10.1276135
}
}
],
"type": "TrafficRequest",
"costvalue": "Distance"
}第二次呼叫
{
"agents": [
{
"name": "B",
"shifts": [
{
"startTime": "2022-08-12T05:30:00",
"startLocation": {
"latitude": 36.76842,
"longitude": 10.21499
},
"endTime": "2022-08-12T11:30:00",
"endLocation": {
"latitude": 36.76842,
"longitude": 10.21499
}
}
],
"capacity": [
16
]
}
],
"itineraryItems": [
{
"name": "BB",
"openingTime": "2022-08-12T05:45:00",
"closingTime": "2022-08-12T11:00:00",
"dwellTime": "00:04:00.00",
"priority": 1,
"quantity": [
8
],
"location": {
"latitude": 36.845275,
"longitude": 10.183444
}
}
],
"type": "TrafficRequest",
"costvalue": "Distance"
}https://stackoverflow.com/questions/73049544
复制相似问题