onegpy.operators.localsearch.improve¶
-
onegpy.operators.localsearch.improve(target_solution, target_node, candidate_id, problem)[source]¶ Core function for local search. Replace the old function with a new function and then revert it if fitness is not improved. :param target_solution: solution object. target solution of local search. :param target_node: node object. target node of the target solution. :param candidate_id: int. ID of candidate function for local search. :param problem: problem object. problem for calculation of fitness. :return: bool. if improvement is success, return True.