Skip to content

Commit

Permalink
Fix cvrp_reload.py dropped reload stations output (#4519)
Browse files Browse the repository at this point in the history
Dropped orders should not come with dropped reload stations in cvrp_reload.py example output
  • Loading branch information
arnabanimesh authored Jan 27, 2025
1 parent 56817ee commit 3065641
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/notebook/routing/cvrp_reload.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -490,7 +491,11 @@
]
}
],
"metadata": {},
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions ortools/routing/samples/cvrp_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3065641

Please sign in to comment.