Tests that the solver parameters are correctly loaded from a TOML file.
()
| 33 | |
| 34 | |
| 35 | def test_solve_params_from_file(): |
| 36 | """ |
| 37 | Tests that the solver parameters are correctly loaded from a TOML file. |
| 38 | """ |
| 39 | params = SolveParams.from_file(DATA_DIR / "test_config.toml") |
| 40 | |
| 41 | ils = IteratedLocalSearchParams(10, 1) |
| 42 | penalty = PenaltyParams(100, 1.25, 0.85, 0.43) |
| 43 | neighbourhood = NeighbourhoodParams(0, 0, 20, True, True) |
| 44 | node_ops = [Exchange10, SwapTails] |
| 45 | route_ops = [SwapStar] |
| 46 | perturbation = PerturbationParams(1, 10) |
| 47 | |
| 48 | assert_equal(params.ils, ils) |
| 49 | assert_equal(params.penalty, penalty) |
| 50 | assert_equal(params.neighbourhood, neighbourhood) |
| 51 | assert_equal(params.node_ops, node_ops) |
| 52 | assert_equal(params.route_ops, route_ops) |
| 53 | assert_allclose(params.display_interval, 10.0) |
| 54 | assert_equal(params.perturbation, perturbation) |
| 55 | |
| 56 | |
| 57 | def test_solve_params_from_file_defaults(): |
nothing calls this directly
no test coverage detected