From 133f81ce3b2f35a8e43bdc51dda35e6a8a391e89 Mon Sep 17 00:00:00 2001 From: Helldragon67 Date: Wed, 15 Jan 2025 10:05:12 +0100 Subject: [PATCH] more print --- backend/src/tests/test_main.py | 2 +- backend/src/utils/optimizer.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/backend/src/tests/test_main.py b/backend/src/tests/test_main.py index 92b7be6..933eaad 100644 --- a/backend/src/tests/test_main.py +++ b/backend/src/tests/test_main.py @@ -54,7 +54,7 @@ def test_turckheim(client, request): # pylint: disable=redefined-outer-name assert duration_minutes*0.8 < int(result['total_time']) < duration_minutes*1.2 assert len(landmarks) > 2 # check that there is something to visit assert comp_time < 30, f"Computation time exceeded 30 seconds: {comp_time:.2f} seconds" - assert 2==3 + # assert 2==3 ''' def test_bellecour(client, request) : # pylint: disable=redefined-outer-name """ diff --git a/backend/src/utils/optimizer.py b/backend/src/utils/optimizer.py index 77b30de..858d350 100644 --- a/backend/src/utils/optimizer.py +++ b/backend/src/utils/optimizer.py @@ -136,11 +136,13 @@ class Optimizer: # A = np.zeros((len(up_ind_x[1:]),L*L), dtype=np.int8) # Fill-in rows L to 2*L-1 - for i in range(int((L*L-L)/2)) : + incr = 0 + for i in range(int((L*L+L)/2)) : if up_ind_x[i] != up_ind_y[i] : - A[L+i, up_ind_x[i]*L + up_ind_y[i]] = 1 - A[L+i, up_ind_y[i]*L + up_ind_x[i]] = 1 - b[L+i] = 1 + A[L+incr, up_ind_x[i]*L + up_ind_y[i]] = 1 + A[L+incr, up_ind_y[i]*L + up_ind_x[i]] = 1 + b[L+incr] = 1 + incr += 1 # return A[~np.all(A == 0, axis=1)], b @@ -525,13 +527,10 @@ class Optimizer: self.logger.debug(f"Optimizing with {A_ub.shape[0]} + {A_eq.shape[0]} = {A_ub.shape[0] + A_eq.shape[0]} constraints.") - print(A_ub) - print('\n\n') - print(b_ub) - print('\n\n') print(A_eq) print('\n\n') print(b_eq) + print('\n\n') # A, b = self.respect_user_must_do(landmarks) # Check if there are user_defined must_see. Also takes care of start/goal