-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
The timeout is not correctly enforced in both ParameterTuner and GridSearchTuner, which can lead to errors or unexpected behaviour.
Problem 1: Init solver call not constrained by timeout
Both tuners perform an Init solver call without applying the timeout:
# Init solver
solver = SolverLookup.get(self.solvername, self.model)
solver.solve(**self.best_params)Problem 2: Negative timeout values
When checking if the algorithm has exceeded the time limit, the computed time_limit - (time.time() - start_time) can become negative, which is not supported by OR-Tools:
timeout = self.best_runtime
# set timeout depending on time budget
if time_limit is not None:
timeout = min(timeout, time_limit - (time.time() - start_time))
# run solver
solver.solve(**params_dict, time_limit=timeout)Metadata
Metadata
Assignees
Labels
No labels