def update_from_args(self, args): if args.crossover is not None: self.crossover_method = Crossover[args.crossover + '_CROSSOVER'] if args.mutation is not None: self.mutation_method = Mutation[args.mutation + '_MUTATION'] self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.population_size = set_default(args.population, self.population_size) self.mutation_chance = set_default(args.mutation_chance, self.mutation_chance)
def update_from_args(self, args): self.max_velocity = set_default(args.max_velocity, self.max_velocity) self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.num_particles = set_default(args.population, self.num_particles) self.inertia_parameter = set_default(args.inertia, self.inertia_parameter) self.local_influence_parameter = set_default( args.local_influence, self.local_influence_parameter) self.global_influence_parameter = set_default( args.global_influence, self.global_influence_parameter) if args.evaluator is not None: self.evaluator = Evaluator[args.evaluator + '_EVALUATOR']
def update_from_args(self, args): self.max_velocity = set_default(args.max_velocity, self.max_velocity) self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.population_size = set_default(args.population, self.population_size) self.mutation_chance = set_default(args.mutation_chance, self.mutation_chance) self.crossover_rate = set_default(args.crossover_rate, self.crossover_rate) if args.evaluator is not None: self.evaluator = Evaluator[args.evaluator + '_EVALUATOR']
def update_from_args(self, args): if args.copying is not None: self.copying_method = Copying[args.copying + '_COPYING'] if args.selection is not None: self.selection_method = Selection[args.selection + '_SELECTION'] if args.crossover is not None: self.crossover_method = Crossover[args.crossover + '_CROSSOVER'] if args.mutation is not None: self.mutation_method = Mutation[args.mutation + '_MUTATION'] self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.population_size = set_default(args.population, self.population_size) self.top_selection_ratio = set_default(args.top, self.top_selection_ratio) self.bottom_selection_ratio = set_default(args.bottom, self.bottom_selection_ratio) self.mutation_chance = set_default(args.mutation_chance, self.mutation_chance)
def update_from_args(self, args): self.max_position = set_default(args.max_velocity, self.max_position) self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.population_size = set_default(args.population, self.population_size) self.follow_distance_parameter = set_default( args.distance_influence, self.follow_distance_parameter) self.follow_survival_parameter = set_default( args.survival_influence, self.follow_survival_parameter) self.min_steps = set_default(args.min_steps, self.min_steps) self.max_steps = set_default(args.max_steps, self.max_steps) self.steps_distance_parameter = set_default( args.steps_distance, self.steps_distance_parameter) self.local_search_tries = set_default(args.local_search, self.local_search_tries) self.follow_chance = set_default(args.follow_chance, self.follow_chance) if args.evaluator is not None: self.evaluator = Evaluator[args.evaluator + '_EVALUATOR']
def update_from_args(self, args): self.cost_budget = set_default(args.cost_budget, self.cost_budget) self.num_iterations = set_default(args.num_iterations, self.num_iterations) self.max_stagnation = set_default(args.max_stagnation, self.max_stagnation) self.population_size = set_default(args.population, self.population_size) self.follow_distance_parameter = set_default( args.distance_influence, self.follow_distance_parameter) self.follow_survival_parameter = set_default( args.survival_influence, self.follow_survival_parameter) self.min_steps = set_default(args.min_steps, self.min_steps) self.max_steps = set_default(args.max_steps, self.max_steps) self.steps_distance_parameter = set_default( args.steps_distance, self.steps_distance_parameter) self.local_search_tries = set_default(args.local_search, self.local_search_tries) self.follow_chance = set_default(args.follow_chance, self.follow_chance)