Skip to content

Commit

Permalink
test for cplex
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomino committed Oct 4, 2023
1 parent a22cbf4 commit 6a34315
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,25 @@ def test_line_fragemnt(self):
model = AGV.create_linear_model()
model.print_information()


begin = time.time()
sol = model.solve()
end = time.time()
print("time: ", end-begin)
model.print_solution(print_zeros=True)

assert sol["y_0_1_s0"] == 1.
assert sol["y_0_1_s1"] == 1.

assert sol["t_in_0_s0"] == 0.
assert sol["t_out_0_s0"] == 1.
assert sol["t_in_0_s1"] == 6.
assert sol["t_out_0_s1"] == 7.

try:
begin = time.time()
sol = model.solve()
end = time.time()
print("time: ", end-begin)
model.print_solution(print_zeros=True)
is_cplex = True
except:
is_cplex = False

if is_cplex:
assert sol["y_0_1_s0"] == 1.
assert sol["y_0_1_s1"] == 1.

assert sol["t_in_0_s0"] == 0.
assert sol["t_out_0_s0"] == 1.
assert sol["t_in_0_s1"] == 6.
assert sol["t_out_0_s1"] == 7.



Expand Down

0 comments on commit 6a34315

Please sign in to comment.