MCPcopy Index your code
hub / github.com/PyVRP/PyVRP / SolveParams

Class SolveParams

pyvrp/solve.py:32–136  ·  view source on GitHub ↗

Solver parameters for PyVRP's iterated local search algorithm. Parameters ---------- ils Iterated local search parameters. penalty Penalty parameters. neighbourhood Neighbourhood parameters. node_ops Node operators to use in the search.

Source from the content-addressed store, hash-verified

30
31
32class SolveParams:
33 """
34 Solver parameters for PyVRP's iterated local search algorithm.
35
36 Parameters
37 ----------
38 ils
39 Iterated local search parameters.
40 penalty
41 Penalty parameters.
42 neighbourhood
43 Neighbourhood parameters.
44 node_ops
45 Node operators to use in the search.
46 route_ops
47 Route operators to use in the search.
48 display_interval
49 Time (in seconds) between iteration logs. Default 5s.
50 perturbation
51 Perturbation parameters.
52 """
53
54 def __init__(
55 self,
56 ils: IteratedLocalSearchParams = IteratedLocalSearchParams(),
57 penalty: PenaltyParams = PenaltyParams(),
58 neighbourhood: NeighbourhoodParams = NeighbourhoodParams(),
59 node_ops: list[type[NodeOperator]] = NODE_OPERATORS,
60 route_ops: list[type[RouteOperator]] = ROUTE_OPERATORS,
61 display_interval: float = 5.0,
62 perturbation: PerturbationParams = PerturbationParams(),
63 ):
64 self._ils = ils
65 self._penalty = penalty
66 self._neighbourhood = neighbourhood
67 self._node_ops = node_ops
68 self._route_ops = route_ops
69 self._display_interval = display_interval
70 self._perturbation = perturbation
71
72 def __eq__(self, other: object) -> bool:
73 return (
74 isinstance(other, SolveParams)
75 and self.ils == other.ils
76 and self.penalty == other.penalty
77 and self.neighbourhood == other.neighbourhood
78 and self.node_ops == other.node_ops
79 and self.route_ops == other.route_ops
80 and self.display_interval == other.display_interval
81 and self.perturbation == other.perturbation
82 )
83
84 @property
85 def ils(self):
86 return self._ils
87
88 @property
89 def penalty(self):

Callers 8

solveMethod · 0.90
_solveFunction · 0.90
minimise_fleetFunction · 0.90
test_default_valuesFunction · 0.90
test_solve_custom_paramsFunction · 0.90
solveFunction · 0.85

Calls

no outgoing calls