def __call__(self, current: Solution, *args) -> Solution: improved = self._improve(deepcopy(current), self._solution_operators) for idx, route in enumerate(improved.routes): improved.routes[idx] = self._improve(route, self._route_operators) assert improved.objective() <= current.objective() return improved
def objective(solution: Solution): return -solution.objective()
def objective(solution: Solution) -> float: """ Returns solution objective. """ return solution.objective()