Compare commits

...

1 Commits

Author SHA1 Message Date
a0438c4af8 comp 2025-01-15 21:15:54 +01:00
2 changed files with 6 additions and 4 deletions

View File

@ -21,7 +21,7 @@ def test_turckheim(client, request): # pylint: disable=redefined-outer-name
request:
"""
start_time = time.time() # Start timer
duration_minutes = 20
duration_minutes = 15
response = client.post(
"/trip/new",
@ -54,9 +54,9 @@ 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
"""
@ -219,7 +219,7 @@ def test_shopping(client, request) : # pylint: disable=redefined-outer-name
assert comp_time < 30, f"Computation time exceeded 30 seconds: {comp_time:.2f} seconds"
assert duration_minutes*0.8 < int(result['total_time']) < duration_minutes*1.2
'''
# def test_new_trip_single_prefs(client):
# response = client.post(
# "/trip/new",

View File

@ -536,6 +536,8 @@ class Optimizer:
for i in range(len(b_eq)): # Iterate over rows of A_eq
prob += (pl.lpSum([A_eq[i][j] * x[j] for j in range(L*L)]) == b_eq[i])
print(prob)
# 6. Solve the problem
prob.solve(pl.PULP_CBC_CMD(msg=False, gapRel=0.3))