MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_solve_params_from_file

Function test_solve_params_from_file

tests/test_solve.py:35–54  ·  view source on GitHub ↗

Tests that the solver parameters are correctly loaded from a TOML file.

()

Source from the content-addressed store, hash-verified

33
34
35def 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
57def test_solve_params_from_file_defaults():

Callers

nothing calls this directly

Calls 5

PenaltyParamsClass · 0.90
NeighbourhoodParamsClass · 0.90
PerturbationParamsClass · 0.90
from_fileMethod · 0.80

Tested by

no test coverage detected