Tests that reading a HFVRP solution results in the correct routes and objective value.
()
| 650 | |
| 651 | |
| 652 | def test_read_hfvrp_solution(): |
| 653 | """ |
| 654 | Tests that reading a HFVRP solution results in the correct routes and |
| 655 | objective value. |
| 656 | """ |
| 657 | data = read("data/X115-HVRP.vrp", "exact") |
| 658 | sol = read_solution("data/X115-HVRP.sol", data) |
| 659 | routes = sol.routes() |
| 660 | |
| 661 | assert_equal(routes[1].visits(), [59, 35, 99, 49, 79, 47, 109, 18]) |
| 662 | assert_equal(routes[-1].visits(), [5, 6, 3, 93, 42, 9]) |
| 663 | |
| 664 | assert_equal(routes[1].vehicle_type(), 0) |
| 665 | assert_equal(routes[-1].vehicle_type(), 2) |
| 666 | |
| 667 | cost_eval = CostEvaluator([0], 0, 0) |
| 668 | assert_equal(cost_eval.cost(sol), 1941256006) |
nothing calls this directly
no test coverage detected