comp
This commit is contained in:
parent
3ebe0b7191
commit
a0438c4af8
@ -21,7 +21,7 @@ def test_turckheim(client, request): # pylint: disable=redefined-outer-name
|
|||||||
request:
|
request:
|
||||||
"""
|
"""
|
||||||
start_time = time.time() # Start timer
|
start_time = time.time() # Start timer
|
||||||
duration_minutes = 20
|
duration_minutes = 15
|
||||||
|
|
||||||
response = client.post(
|
response = client.post(
|
||||||
"/trip/new",
|
"/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 duration_minutes*0.8 < int(result['total_time']) < duration_minutes*1.2
|
||||||
assert len(landmarks) > 2 # check that there is something to visit
|
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 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
|
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 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
|
assert duration_minutes*0.8 < int(result['total_time']) < duration_minutes*1.2
|
||||||
|
|
||||||
|
'''
|
||||||
# def test_new_trip_single_prefs(client):
|
# def test_new_trip_single_prefs(client):
|
||||||
# response = client.post(
|
# response = client.post(
|
||||||
# "/trip/new",
|
# "/trip/new",
|
||||||
|
@ -536,6 +536,8 @@ class Optimizer:
|
|||||||
for i in range(len(b_eq)): # Iterate over rows of A_eq
|
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])
|
prob += (pl.lpSum([A_eq[i][j] * x[j] for j in range(L*L)]) == b_eq[i])
|
||||||
|
|
||||||
|
print(prob)
|
||||||
|
|
||||||
# 6. Solve the problem
|
# 6. Solve the problem
|
||||||
prob.solve(pl.PULP_CBC_CMD(msg=False, gapRel=0.3))
|
prob.solve(pl.PULP_CBC_CMD(msg=False, gapRel=0.3))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user