From 504cce6cdb87c1b438838a440d614ee99be5ccc1 Mon Sep 17 00:00:00 2001 From: Cap Date: Sun, 4 Jan 2026 00:19:57 +0100 Subject: [PATCH] Correct choice probability Adds a divider before using log logic, otherwise the slightly better option will be too heavily chosen --- .../compute_subtour_mode_probs_parallel_utilities.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobility/transport_modes/compute_subtour_mode_probs_parallel_utilities.py b/mobility/transport_modes/compute_subtour_mode_probs_parallel_utilities.py index c58f67e..6d4d273 100644 --- a/mobility/transport_modes/compute_subtour_mode_probs_parallel_utilities.py +++ b/mobility/transport_modes/compute_subtour_mode_probs_parallel_utilities.py @@ -182,6 +182,7 @@ def run_top_k_search( is_return_mode, return_mode, k=10, + divider=10, debug=False ): @@ -302,7 +303,7 @@ def run_top_k_search( utilities -= np.max(utilities) # Compute probabilities - prob = np.exp(utilities) + prob = np.exp(utilities/divider) prob = prob/prob.sum() # Keep only the first 98 % of the cumulative distribution