ガイドAPIリファレンス
ガイド

未割り当てジョブをトラブルシューティングする

HERE Tour Planning APIがルートを最適化する際、さまざまな理由により一部のジョブが未割り当てのままになる場合があります。このような場合、サービスはジョブが車両に割り当てられなかった理由を特定できるよう、理由コードを返します。この記事では、よく発生する主な理由を説明し、それぞれの問題を解決するための実践的なヒントを示します。

未割り当てジョブの理由の仕組み

最適化アルゴリズムがジョブを割り当てられない場合、フリートのすべての車両を評価し、ジョブを割り当てられなかった理由を説明する1つ以上の理由コードを返します。各理由には特定の制約違反が示され、どのジョブに影響があったかの詳細が含まれます。

デフォルトでは、サービスは未割り当てのジョブごとに最も頻度の高い理由を返します。ただし、テスト段階の機能multipleUnassignedReasonsを有効にすると、未割り当てジョブごとに、影響を受けた車両別にグループ化されたすべての制約違反を取得できます。これにより、ジョブが車両ごとに異なる理由で割り当てられない場合でも、より包括的に把握できます。詳細については、「複数の未割り当てジョブの理由を取得する」を参照してください。

未割り当てジョブでよく見られる理由コードの理解とトラブルシューティング

次のセクションでは、ジョブを割り当てられない場合に返される主な理由コードについて説明します。各セクションで、理由の意味、発生要因、その問題の解決方法を説明します。

SKILL_CONSTRAINT

このジョブを処理するために必要なスキルを持つ車両がありません。

考えられる原因:

  • フリート内に、このジョブを処理するために指定されたスキルを持つ車両がない
  • 該当するスキルを持つ車両に、十分な容量または時間がない

トラブルシューティング手順:

  • フリートに該当するスキルを持つ車両を追加する
  • 必須でない場合は、スキル要件を削除または変更する
  • ジョブ内のスキル名が車両タイプで定義されたスキル名と一致することを確認する

詳細については、「スキルに基づいてジョブを割り当てる」を参照してください。

SKILL_CONSTRAINTの例:

次のセクションでは、SKILL_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、Job_5にはflammableのスキルが必要ですが、車両にはスキルが定義されていません。この問題を送信すると、ソリューションではJob_5が未割り当てとして表示され、理由コードSKILL_CONSTRAINTが示されます。

SKILL_CONSTRAINT problem
  {
    "fleet": {
      "types": [
        {
          "id": "vehicle_1",
          "profile": "car",
          "costs": {
            "fixed": 10.0,
            "distance": 0.001,
            "time": 0.002
          },
          "shifts": [
            {
              "start": {
                "time": "2024-06-24T06:00:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              },
              "end": {
                "time": "2024-06-24T20:00:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              }
            }
          ],
          "capacity": [8],
          "amount": 1
        }
      ],
      "profiles": [
        {
          "type": "car",
          "name": "car"
        }
      ]
    },
    "plan": {
      "jobs": [
        {
          "id": "Job_1",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.531757,
                      "lng": 13.384426
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_2",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532983,
                      "lng": 13.38787
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_3",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532065,
                      "lng": 13.389091
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_4",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530384,
                      "lng": 13.391224
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_5",
          "skills": ["flammable"],
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530008,
                      "lng": 13.389562
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_6",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.529496,
                      "lng": 13.385547
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_7",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.528909,
                      "lng": 13.385381
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_8",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530533,
                      "lng": 13.383505
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        }
      ]
    }
  }

次の抜粋は、未割り当てジョブに対する制約違反メッセージと、問題の解決に役立つ補足通知を示しています。

{
  "unassigned": [
    {
      "jobId": "Job_5",
      "reasons": [
        {
          "code": "SKILL_CONSTRAINT",
          "description": "cannot be assigned due to required skill"
        }
      ]
    }
  ],
  "notices": [
    {
      "code": "noVehicleWithSkillsForJob",
      "title": "There is no vehicle type with matching skills for job Job_5",
      "action": "Check whether skills are correctly assigned"
    }
  ]
}

TIME_WINDOW_CONSTRAINT

指定された期間枠内にジョブを完了できません。

考えられる原因:

  • このジョブは指定された時間枠内で完了できない
  • 距離や交通状況により、車両が時間内にジョブの場所に到達できない

トラブルシューティング手順:

  • ジョブの時間枠を車両のシフト時間に合わせて調整する
  • 車両のシフト時間を延長し、ジョブの時間枠に収まるようにする
  • 車両を追加し、作業負荷を分散する
  • リアルタイムの交通データではなく過去の交通データを使用し、より予測しやすい結果を得る

詳細については、以下を参照してください。

TIME_WINDOW_CONSTRAINTの例:

次のセクションでは、TIME_WINDOW_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、車両がツアー内のすべてのジョブを処理するには時間が足りないように、シフト終了時刻を設定しています。この問題を送信すると、ソリューションでは少なくとも1つのジョブが未割り当てとして表示され、理由コードTIME_WINDOW_CONSTRAINTが示されます。

TIME_WINDOW_CONSTRAINT example problem
  {
    "fleet": {
      "types": [
        {
          "id": "vehicle_1",
          "profile": "car",
          "costs": {
            "fixed": 10.0,
            "distance": 0.001,
            "time": 0.002
          },
          "shifts": [
            {
              "start": {
                "time": "2024-06-24T06:00:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              },
              "end": {
                "time": "2024-06-24T06:40:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              }
            }
          ],
          "capacity": [
            8
          ],
          "amount": 1
        }
      ],
      "profiles": [
        {
          "type": "car",
          "name": "car"
        }
      ]
    },
    "plan": {
      "jobs": [
        {
          "id": "Job_1",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.531757,
                      "lng": 13.384426
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_2",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532983,
                      "lng": 13.38787
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_3",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532065,
                      "lng": 13.389091
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_4",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530384,
                      "lng": 13.391224
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_5",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530008,
                      "lng": 13.389562
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_6",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.529496,
                      "lng": 13.385547
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_7",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.528909,
                      "lng": 13.385381
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_8",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530533,
                      "lng": 13.383505
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        }
      ]
    }
  }

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_7",
      "reasons": [
        {
          "code": "TIME_WINDOW_CONSTRAINT",
          "description": "cannot be assigned due to violation of time window"
        }
      ]
    },
    {
      "jobId": "Job_6",
      "reasons": [
        {
          "code": "TIME_WINDOW_CONSTRAINT",
          "description": "cannot be assigned due to violation of time window"
        }
      ]
    }
  ]
}

CAPACITY_CONSTRAINT

どの車両にも、ジョブの需要を満たすだけの残りの容量がありません。

考えられる原因:

  • すべての車両が満載、またはほぼ満載である
  • ジョブの需要が空の車両の容量を上回っている
  • 容量と需要の配列は要素ごとに比較され、少なくとも1つの要素で上回っている

トラブルシューティング手順:

  • フリートに車両を追加する
  • 運用上可能であれば、車両の容量を増やす
  • 要件が過大に見積もられている場合は、ジョブの需要を減らす
  • 容量と需要の配列の次元が一致しているか確認する
  • 再積載ポイントを有効にして、車両が荷降ろしを行い、処理を継続できるようにする

詳細については、以下を参照してください。

CAPACITY_CONSTRAINTの例:

次のセクションでは、CAPACITY_CONSTRAINTによりジョブが未割り当てのままになるよう設定されたサンプル問題を示します。この例では、車両は重量 (kg) と体積 (立方単位) を表す2次元の容量[100, 50]を持っています。需要は、Job_5 ([30, 15]) が重量がありかさばる一方で、Job_6 ([5, 25]) は軽量ですが非常にかさばるように設定されています。この問題を送信すると、ソリューションでは両方のジョブが未割り当てとして表示されます。これは、最適化アルゴリズムがジョブ1〜4、7〜8を割り当てる際に容量[90, 45]を消費し、残りが[10, 5]のみとなり、いずれの未割り当てジョブにも不十分であるためです。

CAPACITY_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [100, 50],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [15, 5]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [20, 8]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [10, 12]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [25, 10]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [30, 15]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [5, 25]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [8, 6]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [12, 4]
            }
          ]
        }
      }
    ]
  }
}

次の完全なソリューションでは、最適化アルゴリズムがジョブ1〜4および7〜8を車両に割り当て、容量[100, 50]のうち[90, 45]をどのように消費するかを示します。これにより残りは[10, 5]のみとなり、Job_5 ([30, 15]) およびJob_6 ([5, 25]) のいずれにも不十分です。この例は、多次元の容量制約がどのように評価されるかを示しています。いずれかの次元で上限を超える場合、そのジョブは未割り当てとなります。

CAPACITY_CONSTRAINT example solution
{
  "tours": [
    {
      "vehicleId": "vehicle_1",
      "typeId": "vehicle_1",
      "shiftIndex": 0,
      "stops": [
        {
          "location": {
            "lat": 52.53097,
            "lng": 13.38504
          },
          "time": {
            "arrival": "2024-06-24T06:00:00Z",
            "departure": "2024-06-24T06:00:00Z"
          },
          "load": [0, 0],
          "activities": [
            {
              "jobId": "departure",
              "type": "departure"
            }
          ]
        },
        {
          "location": {
            "lat": 52.531757,
            "lng": 13.384426
          },
          "time": {
            "arrival": "2024-06-24T06:01:39Z",
            "departure": "2024-06-24T06:06:39Z"
          },
          "load": [15, 5],
          "distance": 193,
          "activities": [
            {
              "jobId": "Job_1",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.532983,
            "lng": 13.38787
          },
          "time": {
            "arrival": "2024-06-24T06:08:13Z",
            "departure": "2024-06-24T06:13:13Z"
          },
          "load": [35, 13],
          "distance": 460,
          "activities": [
            {
              "jobId": "Job_2",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.532065,
            "lng": 13.389091
          },
          "time": {
            "arrival": "2024-06-24T06:14:06Z",
            "departure": "2024-06-24T06:19:06Z"
          },
          "load": [45, 25],
          "distance": 619,
          "activities": [
            {
              "jobId": "Job_3",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.530384,
            "lng": 13.391224
          },
          "time": {
            "arrival": "2024-06-24T06:20:35Z",
            "departure": "2024-06-24T06:25:35Z"
          },
          "load": [70, 35],
          "distance": 861,
          "activities": [
            {
              "jobId": "Job_4",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.528909,
            "lng": 13.385381
          },
          "time": {
            "arrival": "2024-06-24T06:28:22Z",
            "departure": "2024-06-24T06:33:22Z"
          },
          "load": [78, 41],
          "distance": 1422,
          "activities": [
            {
              "jobId": "Job_7",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.530533,
            "lng": 13.383505
          },
          "time": {
            "arrival": "2024-06-24T06:35:01Z",
            "departure": "2024-06-24T06:40:01Z"
          },
          "load": [90, 45],
          "distance": 1689,
          "activities": [
            {
              "jobId": "Job_8",
              "type": "delivery"
            }
          ]
        },
        {
          "location": {
            "lat": 52.53097,
            "lng": 13.38504
          },
          "time": {
            "arrival": "2024-06-24T06:41:36Z",
            "departure": "2024-06-24T06:41:36Z"
          },
          "load": [90, 45],
          "distance": 1886,
          "activities": [
            {
              "jobId": "arrival",
              "type": "arrival"
            }
          ]
        }
      ],
      "statistic": {
        "cost": 26.552,
        "distance": 1886,
        "duration": 2496,
        "times": {
          "driving": 696,
          "serving": 1800,
          "waiting": 0,
          "break": 0
        }
      }
    }
  ],
  "statistic": {
    "cost": 26.552,
    "distance": 1886,
    "duration": 2496,
    "times": {
      "driving": 696,
      "serving": 1800,
      "waiting": 0,
      "break": 0
    }
  },
  "unassigned": [
    {
      "jobId": "Job_6",
      "reasons": [
        {
          "code": "CAPACITY_CONSTRAINT",
          "description": "cannot be assigned due to capacity of vehicle"
        }
      ]
    },
    {
      "jobId": "Job_5",
      "reasons": [
        {
          "code": "CAPACITY_CONSTRAINT",
          "description": "cannot be assigned due to capacity of vehicle"
        }
      ]
    }
  ]
}

REACHABLE_CONSTRAINT

どの車両もこのジョブの場所に到達できません。

考えられる原因:

  • リアルタイムの交通状況によりアクセスが遮断されている (例:工事や事故)
  • この場所はこの車両タイプでは通行できない (例:住宅道路でのトラック)
  • このジョブの場所は車両プロファイルに設定された回避エリア内にあるため、この車両はアクセスできない
  • ルーティングネットワークにこの場所に到達するための道路が含まれていない

トラブルシューティング手順:

  • 一時的な交通障害を回避するため、過去の交通データに切り替える
  • ジョブの場所の座標が正しいことを確認する
  • 制限が適用される場合は別の車両プロファイルを使用する (例:truckの代わりにcarを使用)
  • この場所が道路ネットワークを通じてアクセス可能か確認する

詳細については、「交通情報モードを理解する」を参照してください。

REACHABLE_CONSTRAINTの例:

次のセクションでは、REACHABLE_CONSTRAINTによりジョブが未割り当てのままになるよう設定されたサンプル問題を示します。この例では、次の例に示すとおり、車両プロファイルにJob_8の場所が含まれる回避バウンディングボックスが含まれています。

回避エリア内に配置されたジョブの場所

サービスは車両プロファイルでavoidエリアを通るルートを生成できないため、このジョブは到達不能となります。この問題を送信すると、ソリューションではJob_8が未割り当てとして表示されます。これは、車両プロファイルの制限によりこの場所にアクセスできないためです。

REACHABLE_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [8],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car",
        "avoid": {
          "areas": [
            {
              "type": "boundingBox",
              "north": 52.531,
              "south": 52.5295,
              "west": 13.3825,
              "east": 13.3845
            }
          ]
        }
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "REACHABLE_CONSTRAINT",
          "description": "location unreachable"
        }
      ]
    }
  ]
}

MAX_DISTANCE_CONSTRAINT

このジョブを処理するには、車両が最大走行距離を超えます。

考えられる原因:

  • 車両の最大走行距離の上限は、このジョブの分布には厳しすぎる

トラブルシューティング手順:

  • 運用上可能であれば、車両の最大走行距離の上限を引き上げる
  • 十分な走行距離の上限を持つ車両を追加する
  • 集配センターをジョブの場所により近い位置に移動する
  • 離れた外れ値のジョブを問題から除外するか、別に処理する

MAX_DISTANCE_CONSTRAINTの例:

次のセクションでは、MAX_DISTANCE_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、車両の最大走行距離の上限は2000メートルに設定されており、すべてのジョブを処理するには不十分です。この問題を送信すると、ソリューションでは少なくとも1つのジョブが未割り当てとして表示され、理由コードMAX_DISTANCE_CONSTRAINTが示されます。

MAX_DISTANCE_CONSTRAINT example problem
  {
    "fleet": {
      "types": [
        {
          "id": "vehicle_1",
          "profile": "car",
          "costs": {
            "fixed": 10.0,
            "distance": 0.001,
            "time": 0.002
          },
          "shifts": [
            {
              "start": {
                "time": "2024-06-24T06:00:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              },
              "end": {
                "time": "2024-06-24T20:00:00Z",
                "location": {
                  "lat": 52.53097,
                  "lng": 13.38504
                }
              }
            }
          ],
          "capacity": [8],
          "amount": 1,
          "limits": {
            "maxDistance": 2000 
          }
        }
      ],
      "profiles": [
        {
          "type": "car",
          "name": "car"
        }
      ]
    },
    "plan": {
      "jobs": [
        {
          "id": "Job_1",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.531757,
                      "lng": 13.384426
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_2",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532983,
                      "lng": 13.38787
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_3",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.532065,
                      "lng": 13.389091
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_4",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530384,
                      "lng": 13.391224
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_5",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530008,
                      "lng": 13.389562
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_6",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.529496,
                      "lng": 13.385547
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_7",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.528909,
                      "lng": 13.385381
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        },
        {
          "id": "Job_8",
          "tasks": {
            "deliveries": [
              {
                "places": [
                  {
                    "location": {
                      "lat": 52.530533,
                      "lng": 13.383505
                    },
                    "duration": 300
                  }
                ],
                "demand": [
                  1
                ]
              }
            ]
          }
        }
      ]
    }
  }

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "MAX_DISTANCE_CONSTRAINT",
          "description": "cannot be assigned due to max distance constraint of vehicle"
        }
      ]
    }
  ]
}

SHIFT_TIME_CONSTRAINT

車両はシフト時間内にジョブを完了できません。

考えられる原因:

  • 車両はすでに最大シフト時間の大部分を消費している
  • このジョブを追加すると、車両が最大作業時間を超える
  • このジョブは残りのシフト時間内に処理するには遠すぎる

トラブルシューティング手順:

  • 現地の労働規則で許可されている場合は、車両のシフト時間を延長する
  • 車両を追加し、作業負荷を分散する
  • 優先度の低いジョブを削除するか後回しにして、シフト時間を確保する
  • 他のジョブのサービス時間が過大に見積もられている場合は、それらを短縮する

詳細については、以下を参照してください。

SHIFT_TIME_CONSTRAINTの例:

次のセクションでは、SHIFT_TIME_CONSTRAINTによりジョブが未割り当てのままになるよう設定されたサンプル問題を示します。この例では、車両タイプはlimitsの設定で2400秒 (40分) のshiftTimeの上限があり、すべてのジョブを完了するには短すぎます。この問題を送信すると、ソリューションでは未割り当てのジョブが表示され、SHIFT_TIME_CONSTRAINTコードが示されます。

SHIFT_TIME_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [8],
        "limits": {
          "shiftTime": 2400
        },
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_7",
      "reasons": [
        {
          "code": "SHIFT_TIME_CONSTRAINT",
          "description": "cannot be assigned due to shift time constraint of vehicle"
        }
      ]
    },
    {
      "jobId": "Job_6",
      "reasons": [
        {
          "code": "SHIFT_TIME_CONSTRAINT",
          "description": "cannot be assigned due to shift time constraint of vehicle"
        }
      ]
    }
  ]
}

LOCKING_CONSTRAINT

このジョブは、他のジョブを特定の車両に固定するリレーションと競合するため、割り当てられません。

考えられる原因:

  • sequenceリレーションによりジョブが特定の車両に厳密な順序で固定されており、このジョブはそのシーケンスに含まれていない
  • リレーションにはdeparturearrivalアクティビティが含まれており、他のジョブを挿入できない境界が作られている
  • このジョブはリレーションに含まれていないが、他のジョブで固定されている同じ車両に割り当てる設定になっている

トラブルシューティング手順:

  • 固定されたシーケンスの一部とする場合は、このジョブを既存のリレーションに追加する
  • リレーションからdepartureおよび/orarrivalアクティビティを削除して柔軟性を高める
  • リレーションのタイプをsequenceからtourに変更してジョブを任意の順序で処理できるようにする (またはflexibleに変更し固定されたジョブ間に挿入できるようにする)
  • このジョブを別のリレーションに追加して、別の車両に割り当てる
  • 厳密な順序が不要な場合は、リレーションを削除する

詳しくは、「リレーションを使用して旅程を再計画する」を参照してください。

LOCKING_CONSTRAINTの例:

次のセクションでは、LOCKING_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、sequenceリレーションにより7つのジョブ (Job_1からJob_7) がvehicle_1_1に特定の順序で固定されています。Job_8はこのリレーションに含まれておらず、このリレーションはdepartureおよびarrivalのアクティビティを含む厳密なシーケンスを強制するため、Job_8をこの固定されたシーケンスに挿入できません。この問題を送信すると、ソリューションではJob_8が未割り当てとして表示され、理由コードLOCKING_CONSTRAINTが示されます。

LOCKING_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [14],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
        
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ],
    "relations": [
      {
        "type": "sequence",
        "jobs": ["departure", "Job_1", "Job_2", "Job_3", "Job_4", "Job_5", "Job_6", "Job_7", "arrival"],
        "vehicleId": "vehicle_1_1"
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "LOCKING_CONSTRAINT",
          "description": "cannot be assigned due to relation lock"
        }
      ]
    }
  ]
}

TOUR ORDER_CONSTRAINT

このジョブはツアー位置制約に違反しており、通常はタスクの順序要件の競合が原因です。

考えられる原因:

  • マルチジョブで、集荷と配達のタスクの位置の値が逆になっている (配達が集荷より前にある)
  • このジョブのタスクの位置が、ツアー内の他のジョブの位置要件と競合する
  • 定義された順序は、このツアーのシーケンスでは満たせない

トラブルシューティング手順:

  • マルチジョブでは、集荷タスクの位置の値が配達タスクより小さくなるようにする
  • 実現不可能な順序要件を生む位置制約を削除または調整する
  • optimizeTaskPositionの目的関数を使用してソルバーの柔軟性を高める
  • 順序要件が運用上必要かどうかを確認する

詳細については、「ジョブタスク位置を制御する」を参照してください。

TOUR ORDER_CONSTRAINTの例:

次のセクションでは、TOUR_ORDER_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、Job_6Job_7には順序付けされた位置が設定されており、Job_8は集荷と配達の両方のタスクを持つマルチジョブで、配達 (位置1) が集荷 (位置2) より前に実行される必要があります。このマルチジョブ内の逆順が、集荷を配達より前に行うという本来の順序要件と競合し、ジョブが未割り当てとなります。この問題を送信すると、ソリューションではJob_8が未割り当てとして表示され、理由コードTOUR_ORDER_CONSTRAINTが示されます。

TOUR_ORDER_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [
          8
        ],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ],
              "position": {
                "type": "ordered",
                "value": 1
              }
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ],
              "position": {
                "type": "ordered",
                "value": 2
              }
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ],
              "position": {
                "type": "ordered",
                "value": 2
              }
            }
          ],
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530744,
                    "lng": 13.384912
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ],
              "position": {
                "type": "ordered",
                "value": 1
              }
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "TOUR_ORDER_CONSTRAINT",
          "description": "cannot be assigned due to tour order constraint"
        }
      ]
    }
  ]
}

MAX_STOPS_CONSTRAINT

このジョブを追加すると、車両の最大停止回数を超えます。

考えられる原因:

  • 車両が停止数の上限に達している
  • フリート全体の停止数の設定が厳しすぎる

トラブルシューティング:

  • 車両の最大停止数を増やす
  • フリートに車両を追加する
  • 優先度の低いジョブを削除して上限内に収める

詳細については、「停車地の最大数を設定する」を参照してください。

MAX_STOP_CONSTRAINTの例:

次のセクションでは、MAX_STOPS_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。最大上限が7に設定されており、処理するジョブの総数が8であるため、最適化アルゴリズムは1つのジョブを未割り当てとします。

MAX_STOPS_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [
          8
        ],
        "amount": 1,
        "limits": {
          "stops": {
            "maxCount": {
              "value": 7
            }
          }
        }
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "MAX_STOPS_CONSTRAINT",
          "description": "cannot be assigned due to exceeding the maximum number of stops"
        }
      ]
    }
  ]
}

MIN_STOPS_CONSTRAINT

車両が必要な最小停止数を満たすだけのジョブがないため、このジョブを割り当てられません。

考えられる原因:

  • コスト効率の観点から、車両に最小停止数 (例:10件) が設定されている
  • このジョブを車両に割り当てると、必要な停止数を下回る
  • 合計のジョブ数が不足しているか、この車両に割り当て可能なジョブが不足しており、最小停止数を満たせない

トラブルシューティング手順:

  • 最小停止数の要件がある車両が最小数に達するよう、問題にジョブを追加する
  • 車両がより少ない停止数で運用できる場合は、最小停止数の制約を減らすか削除する
  • 需要が少ない場合は、最小停止数の要件がない車両にジョブを割り当てる
  • 車両の制約 (スキル、テリトリー、時間枠) に一致するジョブを確保し、最小停止数に達するようにする

詳細については、「停車地の最小数を設定する」を参照してください。

MIN_STOPS_CONSTRAINTの例:

次のスニペットでは、MIN_STOPS_CONSTRAINTによりジョブが未割り当てのままとなるよう設定されたサンプル問題を示します。この問題では、車両タイプの最小停止数は10に設定されており、ジョブ総数は8です。そのため、この問題を実行すると、最適化アルゴリズムは車両にどのジョブも割り当てません。

MIN_STOPS_CONSTRAINT example problem
{
  "configuration": {
    "experimentalFeatures": [
      "minStops"
    ]
  },
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [
          8
        ],
        "amount": 1,
        "limits": {
          "stops": {
            "minCount": {
              "value": 10
            }
          }
        }
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  }
}

TERRITORY_CONSTRAINT

テリトリーの制約により、このジョブを割り当てられません。

考えられる原因:

  • このジョブには、車両が対応できないテリトリーIDが割り当てられている
  • 車両に対応するよう割り当てられているテリトリーがstrictとして設定されている

トラブルシューティング手順:

  • ジョブのテリトリーに対応可能な車両を割り当てる
  • テリトリーの定義を調整し、strict制約を削除して柔軟性を高める

詳細については、「テリトリー別に旅程を最適化する」を参照してください。

TERRITIAL_CONSTRAINTの例:

次のセクションでは、TERRITORY_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、車両はテリトリーzone_northのみに対応するよう設定されていますが、Job_8はテリトリーzone_southに割り当てられています。車両は"strict": trueの設定により指定されたテリトリー外のジョブに対応できないため、Job_8は未割り当てのままとなります。この問題を送信すると、ソリューションではJob_8が未割り当てとして表示され、理由コードTERRITORY_CONSTRAINTが示されます。

TERRITORY_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [
          8
        ],
        "amount": 1,
        "territories": {
          "strict": true,
          "items": [
            {
              "id": "zone_north"
            }
          ]
        }
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300,
                  "territoryIds": ["zone_north"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300,
                  "territoryIds": ["zone_south"]
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "TERRITORY_CONSTRAINT",
          "description": "cannot be assigned due to territory constraint"
        }
      ]
    }
  ]
}

UNREACHABLE_IN_RELATION_CONSTRAINT

このジョブはリレーションの一部であり、その場所に車両が到達できないため、割り当てられません。

考えられる原因:

  • このジョブはリレーション (sequenceflexibletourなど) に含まれており、車両が到達できないエリア内にあります。たとえば次のようなエリアが挙げられます。
    • 車両プロファイルで定義された回避エリア
    • 車両プロファイルの制約 (トラックルート、回避エリア) により、その場所に到達できない
    • ルーティングネットワークにその場所に到達するための道路が含まれておらず、リレーションにより別の車両への再割り当てもできない

トラブルシューティング手順:

  • このジョブを特定の車両やシーケンスに結び付ける必要がない場合は、リレーションから削除する
  • 車両プロファイルの回避エリアを調整または削除して、ジョブの場所にアクセスできるようにする
  • ジョブの場所の座標が正しいことを確認する
  • 制限が適用される場合は別の車両プロファイルを使用する (例:truckの代わりにcarを使用)
  • このジョブをリレーションに含める必要がある場合は、その場所が割り当てられた車両からアクセス可能であることを確認する

詳しくは、「リレーションを使用して旅程を再計画する」を参照してください。

UNREACHABLE_IN_RELATION_CONSTRAINTの例:

この例では、sequenceリレーションにより、車両が集配センター (arrival) に戻る前にJob_8を処理する必要があります。ただし、Job_8の場所は車両プロファイルで定義された回避バウンディングボックスのエリア内にあり、到達できません。リレーションに含まれており、かつ到達不能であるため、UNREACHABLE_IN_RELATION_CONSTRAINTがトリガーされます。

UNREACHABLE_IN_RELATION_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [8],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car",
        "avoid": {
          "areas": [
            {
              "type": "boundingBox",
              "north": 52.531,
              "south": 52.5295,
              "west": 13.3825,
              "east": 13.3845
            }
          ]
        }
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ],
    "relations": [
      {
        "type": "sequence",
        "jobs": [
          "Job_8",
          "arrival"
        ],
        "vehicleId": "vehicle_1_1"
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "UNREACHABLE_IN_RELATION_CONSTRAINT",
          "description": "cannot be assigned due to being unreachable and in a relation"
        }
      ]
    }
  ]
}

MIXING_RESTRICTION_CON

特定のカテゴリーの貨物を同時に輸送することを禁止する混載制限に違反するため、このジョブを割り当てられません。

考えられる原因:

  • ジョブのカテゴリーが、車両ツアーにすでに割り当てられているカテゴリーと競合する (leveltourの場合)
  • このジョブのカテゴリーが、車両に現在積載されているカテゴリーと競合する (levelsubTourの場合)
  • カテゴリーが競合する複数のジョブが同じ車両に割り当てられている
  • 車両の混載制限がこのジョブの組み合わせには厳しすぎる

トラブルシューティング手順:

  • 車両やシフトを追加し競合するカテゴリーを分ける
  • 混載制限のレベルをtourからsubTourに変更し、異なるカテゴリーを順次処理できるようにする
  • 運用上不要な場合は、カテゴリーの割り当てを削除または変更する
  • 一緒に輸送できる貨物を同時に扱えるように、conflictingCategoriesリストを調整する
  • 制限されているカテゴリーを同時に輸送しないようにジョブをスケジュールできるか確認する

詳細については、「混載の制限を定義する」を参照してください。

MIXING_RESTRICTION_CONSTRAINTの例:

この例では、混載制限はtourレベルで定義されており、同一ツアー中に車両がperishableカテゴリーとelectronicsカテゴリーの両方を輸送することを禁止しています。Job_1からJob_7perishableカテゴリーに割り当てられ、Job_8electronicsカテゴリーに割り当てられています。車両はツアーごとに対応できるカテゴリーが1つに制限されているため、Job_8は未割り当てとなります。

MIXING_RESTRICTION_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T07:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "mixingRestrictions": {
              "level": "tour",
              "restrictions": [
                {
                  "conflictingCategories": [
                    "perishable",
                    "electronics"
                  ]
                }
              ]
            }
          }
        ],
        "capacity": [8],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "category": "perishable",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "category": "electronics",
        "tasks": {
          "pickups": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "MIXING_RESTRICTION_CONSTRAINT",
          "description": "cannot be assigned due to job mixing restriction"
        }
      ]
    }
  ]
}

GROUP_CONSTRAINT

グループ内のすべてのジョブは単一の車両が順番に処理する必要がありますが、車両の容量やその他の制約により、このグループのすべてのジョブを処理できないため、ジョブが割り当てられません。

考えられる原因:

  • グループ内のすべてのジョブの需要合計が単一の車両の容量を超えている
  • グループ内のジョブ数が多く、車両の容量、シフト時間、距離制限内に収まらない
  • 利用可能なすべての車両で容量が不足しており、グループ全体を処理できない

トラブルシューティング手順:

  • 車両の容量を増やし、グループ内のすべてのジョブを処理できるようにする
  • 大きなグループを、車両の制約内に収まる小さなグループに分割する
  • グループ全体を処理できる十分な容量を持つ車両を追加する
  • グループあたりのジョブ数または各ジョブの需要を減らす
  • シフト時間または距離制限を調整して、車両がグループ全体を処理できるようにする
  • 単一の車両で処理する必要が運用上ない場合は、グループ割り当てを削除する

詳細については、「グループを使ってジョブの配置を制御する」を参照してください。

GROUP_CONSTRAINTの例:

次のセクションでは、GROUP_CONSTRAINTによりジョブが未割り当てのままになるよう設定されたサンプル問題を示します。この例では、3つのグループ (ABC) が定義され、合計8つのジョブが含まれています。グループAには3つのジョブ (Job_1Job_3Job_5) が含まれ、グループBには3つのジョブ (Job_6Job_7Job_8) が含まれ、グループCには2つのジョブ (Job_2Job_4) が含まれています。各車両の容量は2ユニットで、4台の車両が利用可能です。

同一グループのすべてのジョブを完了してからでなければ別のグループのジョブを開始できず、グループAとグループBはいずれも3つのジョブを持ち、車両の容量は2ユニットに限られるため、グループの一部のジョブは単一の車両にすべて割り当てることができません。この問題を送信すると、ソリューションには2つのジョブが未割り当てとして表示され、理由コードGROUP_CONSTRAINTが示されます。

GROUP_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [
          2
        ],
        "amount": 4
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300,
                  "groupId": "A"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300,
                  "groupId": "C"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300,
                  "groupId": "A"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300,
                  "groupId": "C"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300,
                  "groupId": "A"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300,
                  "groupId": "B"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300,
                  "groupId": "B"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300,
                  "groupId": "B"
                }
              ],
              "demand": [
                1
              ]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_5",
      "reasons": [
        {
          "code": "GROUP_CONSTRAINT",
          "description": "cannot be assigned due to group constraint"
        }
      ]
    },
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "GROUP_CONSTRAINT",
          "description": "cannot be assigned due to group constraint"
        }
      ]
    }
  ]
}

MAX_TIME_ON_VEHICLE_CONSTRAINT

車両に費やす時間が最大許容時間を超えているため、ジョブを割り当てることができません。

考えられる原因:

  • ツアー構造に対して、ジョブのmaxTimeOnVehicle設定の制限が厳しすぎる
  • 集荷場所と配達場所の距離が、許容される移動時間を超えている
  • 他のジョブの処理時間や停止地間の移動時間により、このジョブに必要な時間が上限を超えている
  • 車両は集荷と配達の間に他のジョブを処理する必要があり、このジョブにかかる総時間が増加する

トラブルシューティング手順:

  • maxTimeOnVehicleの値を増やし、集荷と配達の間の時間を延ばす
  • 他のジョブの処理時間を短縮して、車両の総所要時間を減らす
  • 運用上必要がない場合はmaxTimeOnVehicle制約を削除する

詳細については、「車両の最大時間を制限する」を参照してください。

MAX_TIME_ON_VEHICLE_CONSTRAINTの例:

次のセクションでは、MAX_TIME_ON_VEHICLE_CONSTRAINTによりジョブが未割り当てのままになるよう設定されたサンプル問題を示します。この例では、ジョブ1から5はそれぞれ、maxTimeOnVehicleが900秒 (15分) に設定されています。車両が出発時にすべてのジョブを積載すると、ツアー内の一部のジョブで累計時間が900秒の上限を超え、MAX_TIME_ON_VEHICLE_CONSTRAINTの理由コードで未割り当てのジョブが発生します。

MAX_TIME_ON_VEHICLE_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [8],
        "amount": 1
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "maxTimeOnVehicle": 180,
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "maxTimeOnVehicle": 180,
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "maxTimeOnVehicle": 180,
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_2",
      "reasons": [
        {
          "code": "MAX_TIME_ON_VEHICLE_CONSTRAINT",
          "description": "cannot be assigned due to max time on vehicle restriction"
        }
      ]
    },
    {
      "jobId": "Job_1",
      "reasons": [
        {
          "code": "MAX_TIME_ON_VEHICLE_CONSTRAINT",
          "description": "cannot be assigned due to max time on vehicle restriction"
        }
      ]
    }
  ]
}

MAX_DRIVING_TIME_CONSTRAINT

このジョブを追加すると車両の最大運転時間を超えるため、ジョブが割り当てられません。

考えられる原因:

  • ジョブ数に対し、車両のmaxDrivingTime上限が過度に制限されている
  • 割り当て済みのジョブの累積運転時間にこのジョブを加えると上限を超える
  • ジョブ間の距離が離れており、停止地間の移動時間が上限を超えている
  • 運転時間の上限に、必要な総移動距離が考慮されていない

トラブルシューティング手順:

  • 車両タイプのlimits設定でmaxDrivingTimeの上限を増やす
  • 車両を追加して作業負荷を分散し、車両ごとの運転時間を減らす
  • 優先度の低いジョブを削除または後回しにして、運転時間の上限内に収める
  • ジョブの場所やクラスタリングを最適化して、総運転時間を減らす

MAX_DRIVING_TIME_CONSTRAINTの例:

次のセクションでは、MAX_DRIVING_TIME_CONSTRAINTによりジョブが未割り当てのままになるように設定されたサンプル問題を示します。この例では、車両タイプのlimits設定で、maxDrivingTimeの上限が400秒 (非現実的な値であり、説明目的のみに使用) に設定されています。この上限内で車両は7つのジョブを処理できますが、8つ目のジョブを追加すると総運転時間が400秒のしきい値を超えます。この問題を送信すると、ソリューションではJob_8が未割り当てとして表示され、理由コードMAX_DRIVING_TIME_CONSTRAINTが示されます。

MAX_DRIVING_TIME_CONSTRAINT example problem
{
  "fleet": {
    "types": [
      {
        "id": "vehicle_1",
        "profile": "car",
        "costs": {
          "fixed": 10.0,
          "distance": 0.001,
          "time": 0.002
        },
        "shifts": [
          {
            "start": {
              "time": "2024-06-24T06:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            },
            "end": {
              "time": "2024-06-24T20:00:00Z",
              "location": {
                "lat": 52.53097,
                "lng": 13.38504
              }
            }
          }
        ],
        "capacity": [8],
        "amount": 1,
        "limits": {
          "maxDrivingTime": 400
        }
      }
    ],
    "profiles": [
      {
        "type": "car",
        "name": "car"
      }
    ]
  },
  "plan": {
    "jobs": [
      {
        "id": "Job_1",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.531757,
                    "lng": 13.384426
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_2",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532983,
                    "lng": 13.38787
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_3",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.532065,
                    "lng": 13.389091
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_4",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530384,
                    "lng": 13.391224
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_5",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530008,
                    "lng": 13.389562
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_6",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.529496,
                    "lng": 13.385547
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_7",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.528909,
                    "lng": 13.385381
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      },
      {
        "id": "Job_8",
        "tasks": {
          "deliveries": [
            {
              "places": [
                {
                  "location": {
                    "lat": 52.530533,
                    "lng": 13.383505
                  },
                  "duration": 300
                }
              ],
              "demand": [1]
            }
          ]
        }
      }
    ]
  }
}

次のソリューションからの抜粋では、未割り当てのジョブの制約違反メッセージを示します。

{
  "unassigned": [
    {
      "jobId": "Job_8",
      "reasons": [
        {
          "code": "MAX_DRIVING_TIME_CONSTRAINT",
          "description": "cannot be assigned due to max driving time constraint of vehicle"
        }
      ]
    }
  ]
}

NO_REASON_FOUND

これは、最適化アルゴリズムがジョブが未割り当てとなった具体的な理由を特定できなかった場合に発生します。

考えられる原因:

  • 原因がはっきりしない場合や、複数の制約が重なって明確な理由を特定できないまま割り当てが妨げられている場合に、この理由で未割り当てのジョブが発生します。

トラブルシューティング手順:

  • 複数の制約が競合していないか、問題の定義を確認する
  • ジョブと車両の定義が完全かつ正しいことを確認する
  • 任意の制約を一時的に削除して問題を単純化し、原因を特定する

次のステップ

リクエストレベルの問題については、「APIエラー」を参照してください。