From caa799d1f7acc290a3730167bcf8f9c8b40c0bb5 Mon Sep 17 00:00:00 2001 From: Arnab Animesh Das Date: Sun, 26 Jan 2025 02:23:35 +0530 Subject: [PATCH 1/2] Dropped orders should not come with dropped reload stations in cvrp_reload.py example output --- ortools/routing/samples/cvrp_reload.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ortools/routing/samples/cvrp_reload.py b/ortools/routing/samples/cvrp_reload.py index cc7ae754592..1f392315d36 100755 --- a/ortools/routing/samples/cvrp_reload.py +++ b/ortools/routing/samples/cvrp_reload.py @@ -323,6 +323,7 @@ def print_solution( if assignment.Value(routing.NextVar(index)) == index: dropped.append(order) print(f"dropped orders: {dropped}") + dropped = [] for reload in range(1, 6): index = manager.NodeToIndex(reload) if assignment.Value(routing.NextVar(index)) == index: From f5737937b6f824cf2cbdd674c4d180da8b460a79 Mon Sep 17 00:00:00 2001 From: Arnab Animesh Das Date: Sun, 26 Jan 2025 15:31:23 +0530 Subject: [PATCH 2/2] Dropped orders should not come with dropped reload stations in cvrp_reload.ipynb example output --- examples/notebook/routing/cvrp_reload.ipynb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/notebook/routing/cvrp_reload.ipynb b/examples/notebook/routing/cvrp_reload.ipynb index 5be46a21d30..47ab0bb7a99 100644 --- a/examples/notebook/routing/cvrp_reload.ipynb +++ b/examples/notebook/routing/cvrp_reload.ipynb @@ -390,6 +390,7 @@ " if assignment.Value(routing.NextVar(index)) == index:\n", " dropped.append(order)\n", " print(f\"dropped orders: {dropped}\")\n", + " dropped = []\n", " for reload in range(1, 6):\n", " index = manager.NodeToIndex(reload)\n", " if assignment.Value(routing.NextVar(index)) == index:\n", @@ -490,7 +491,11 @@ ] } ], - "metadata": {}, + "metadata": { + "language_info": { + "name": "python" + } + }, "nbformat": 4, "nbformat_minor": 5 }