From 626671222573830ae04d4917ac15428817b38448 Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Mon, 6 Jan 2025 23:40:04 +0100 Subject: [PATCH] ILP solver seems o be sensible to cost scaling #21 --- .../2taxis_10persons/exhaustive_search/output.tools | 3 ++- .../customized_times/exhaustive_search/output.tools | 7 ++++--- .../customized_times/simple_rerouting/output.tools | 6 +++--- .../stop_duration/exhaustive_search/output.tools | 5 ++--- .../stop_duration/simple_rerouting/output.tools | 10 +--------- tools/drt/drtOnline.py | 2 +- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/tests/tools/drt/drtOnline/2taxis_10persons/exhaustive_search/output.tools b/tests/tools/drt/drtOnline/2taxis_10persons/exhaustive_search/output.tools index 0218eb577bdb..2c4e65c03049 100644 --- a/tests/tools/drt/drtOnline/2taxis_10persons/exhaustive_search/output.tools +++ b/tests/tools/drt/drtOnline/2taxis_10persons/exhaustive_search/output.tools @@ -1,3 +1,4 @@ + Retrying in 1 seconds Run dispatcher New reservations: ['0'] @@ -11,7 +12,7 @@ New reservations: ['1', '2', '3'] Pending reservations: [] Solve DARP with exhaustive_search Solve ILP -Dispatch: taxiA_0y_2y_3y_1y_3z_0z_1z_2z +Dispatch: taxiA_0y_2y_3y_3z_1y_0z_1z_2z Run dispatcher New reservations: ['4', '5', '6'] diff --git a/tests/tools/drt/drtOnline/customized_times/exhaustive_search/output.tools b/tests/tools/drt/drtOnline/customized_times/exhaustive_search/output.tools index f2a0e3fdb1e1..ddf02f635d90 100644 --- a/tests/tools/drt/drtOnline/customized_times/exhaustive_search/output.tools +++ b/tests/tools/drt/drtOnline/customized_times/exhaustive_search/output.tools @@ -1,3 +1,4 @@ + Retrying in 1 seconds Run dispatcher New reservations: ['0'] @@ -17,15 +18,15 @@ New reservations: ['4', '5', '6'] Pending reservations: ['0'] Solve DARP with exhaustive_search Solve ILP -Dispatch: taxiA_6y_6z -Dispatch: taxiB_4y_5y_4z_5z +Dispatch: taxiA_4y_5y_4z_5z +Dispatch: taxiB_6y_6z Run dispatcher New reservations: ['7', '8', '9'] Pending reservations: ['0'] Solve DARP with exhaustive_search Solve ILP -Dispatch: taxiA_6y_7y_7z_6z +Dispatch: taxiB_6y_7y_7z_6z Dispatch: taxiC_3y_8y_3z_8z_2z Run dispatcher diff --git a/tests/tools/drt/drtOnline/customized_times/simple_rerouting/output.tools b/tests/tools/drt/drtOnline/customized_times/simple_rerouting/output.tools index 3afdef856a2a..8382051b8b2c 100644 --- a/tests/tools/drt/drtOnline/customized_times/simple_rerouting/output.tools +++ b/tests/tools/drt/drtOnline/customized_times/simple_rerouting/output.tools @@ -18,15 +18,15 @@ New reservations: ['4', '5', '6'] Pending reservations: ['0'] Solve DARP with simple_rerouting Solve ILP -Dispatch: taxiA_6y_6z -Dispatch: taxiB_4y_5y_4z_5z +Dispatch: taxiA_4y_5y_4z_5z +Dispatch: taxiB_6y_6z Run dispatcher New reservations: ['7', '8', '9'] Pending reservations: ['0'] Solve DARP with simple_rerouting Solve ILP -Dispatch: taxiA_6y_7y_7z_6z +Dispatch: taxiB_6y_7y_7z_6z Run dispatcher Pending reservations: ['0', '8', '9'] diff --git a/tests/tools/drt/drtOnline/stop_duration/exhaustive_search/output.tools b/tests/tools/drt/drtOnline/stop_duration/exhaustive_search/output.tools index 05e5d9679d1e..b42095dd4641 100644 --- a/tests/tools/drt/drtOnline/stop_duration/exhaustive_search/output.tools +++ b/tests/tools/drt/drtOnline/stop_duration/exhaustive_search/output.tools @@ -1,3 +1,4 @@ + Retrying in 1 seconds Run dispatcher New reservations: ['0'] @@ -12,7 +13,7 @@ Pending reservations: [] Solve DARP with exhaustive_search Solve ILP Dispatch: taxiA_0y_2y_0z_2z -Dispatch: taxiB_1y_3y_3z_1z +Dispatch: taxiB_3y_1y_3z_1z Run dispatcher New reservations: ['4', '5', '6'] @@ -63,13 +64,11 @@ Pending reservations: ['4', '5', '7', '8'] Solve DARP with exhaustive_search Reservation 4 (person ('4',)) cannot be served Reservation 5 (person ('5',)) cannot be served -Solve ILP Run dispatcher Pending reservations: ['7', '8'] Solve DARP with exhaustive_search Reservation 7 (person ('7',)) cannot be served -Solve ILP Run dispatcher Pending reservations: ['8'] diff --git a/tests/tools/drt/drtOnline/stop_duration/simple_rerouting/output.tools b/tests/tools/drt/drtOnline/stop_duration/simple_rerouting/output.tools index d30fc897ad0a..4b4b03eb1576 100644 --- a/tests/tools/drt/drtOnline/stop_duration/simple_rerouting/output.tools +++ b/tests/tools/drt/drtOnline/stop_duration/simple_rerouting/output.tools @@ -12,7 +12,7 @@ New reservations: ['1', '2', '3'] Pending reservations: [] Solve DARP with simple_rerouting Solve ILP -Dispatch: taxiB_1y_3y_3z_1z +Dispatch: taxiB_3y_1y_3z_1z Run dispatcher New reservations: ['4', '5', '6'] @@ -27,48 +27,40 @@ Solve DARP with simple_rerouting Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting -Solve ILP Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting -Solve ILP Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting -Solve ILP Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting -Solve ILP Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting -Solve ILP Run dispatcher Pending reservations: ['2', '4', '5', '6', '7', '8', '9'] Solve DARP with simple_rerouting Reservation 2 (person ('2',)) cannot be served Reservation 6 (person ('6',)) cannot be served -Solve ILP Run dispatcher Pending reservations: ['4', '5', '7', '8', '9'] Solve DARP with simple_rerouting Reservation 4 (person ('4',)) cannot be served Reservation 5 (person ('5',)) cannot be served -Solve ILP Run dispatcher Pending reservations: ['7', '8', '9'] Solve DARP with simple_rerouting Reservation 7 (person ('7',)) cannot be served Reservation 9 (person ('9',)) cannot be served -Solve ILP Run dispatcher Pending reservations: ['8'] diff --git a/tools/drt/drtOnline.py b/tools/drt/drtOnline.py index 713e025a9f34..b8009f331dc9 100755 --- a/tools/drt/drtOnline.py +++ b/tools/drt/drtOnline.py @@ -440,7 +440,7 @@ def main(): # TODO specific cost for vehicle can be consider here bonus_cost = (sum(routes[trip_id][2]) + 1) * options.cost_per_trip # generate dict with costs - costs.update({idx: routes[trip_id][0] + bonus_cost}) + costs.update({idx: 10 * (routes[trip_id][0] + bonus_cost)}) # generate dict with vehicle used in the trip veh_constraints.update({idx: routes[trip_id][1]}) # generate dict with served reservations in the trip