Пример #1
0
    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
Пример #2
0
def objective(solution: Solution):
    return -solution.objective()
Пример #3
0
def objective(solution: Solution) -> float:
    """
    Returns solution objective.
    """
    return solution.objective()