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

Function run

tests/test_IteratedLocalSearch.py:200–212  ·  view source on GitHub ↗
(params: IteratedLocalSearchParams)

Source from the content-addressed store, hash-verified

198 ]
199
200 def run(params: IteratedLocalSearchParams): # run with given params
201 idx = iter(range(len(sols)))
202 ils = IteratedLocalSearch(
203 ok_small,
204 PenaltyManager(initial_penalties=([20], 6, 6)),
205 RandomNumberGenerator(42),
206 lambda *_, **kw: sols[next(idx)], # returns sols one at a time
207 sols[0],
208 params,
209 )
210
211 res = ils.run(MaxIterations(len(sols)))
212 return res.stats.data
213
214 # First run without a restart. We look back to the current solution from
215 # last iteration, which means that we only accept improving solutions.

Callers 1

test_restartFunction · 0.85

Calls 5

runMethod · 0.95
IteratedLocalSearchClass · 0.90
PenaltyManagerClass · 0.90
MaxIterationsClass · 0.90

Tested by

no test coverage detected