Exemple #1
0
 def __init__(self):
     self.iteration_count = 0
     self.jump_function = p2.JumpFunction()
     self.best_jump_function = copy.deepcopy(self.jump_function)
     # self.jump_function.print_board_and_objective_function()
     self.get_interation_count()
     self.perform_stochastic_local_search()
     self.print_best_objective_value()
Exemple #2
0
 def __init__(self):
     self.iteration_count = 0
     self.probability = 0
     self.jump_function = p2.JumpFunction()
     self.best_jump_function = copy.deepcopy(self.jump_function)
     self.get_interation_count()
     self.get_hill_descent_count()
     self.perform_hill_descent_with_random_uphill_steps()
     self.print_best_objective_value()
 def __init__(self):
     self.iteration_count = 0
     self.hill_descent_count = 0
     self.jump_function = p2.JumpFunction()
     self.best_jump_function = copy.deepcopy(self.jump_function)
     self.get_interation_count()
     self.get_hill_descent_count()
     self.perform_random_restart_hill_descent()
     self.print_best_objective_value()
Exemple #4
0
 def __init__(self):
     self.iteration_count = 0
     self.temperature = 0
     self.decay_rate = 0
     self.jump_function = p2.JumpFunction()
     self.best_jump_function = copy.deepcopy(self.jump_function)
     self.get_interation_count()
     self.get_initial_temperature()
     self.get_decay_rate()
     self.perform_simulated_annealing()
     self.print_best_objective_value()
 def perform_random_restart_hill_descent(self):
     for i in range(self.hill_descent_count):
         for j in range(self.iteration_count):
             jump_function_prime = copy.deepcopy(self.jump_function)
             self.change_random_jump_number(jump_function_prime.rjm_board,
                                            jump_function_prime.board_size)
             jump_function_prime.rerun_objective_function()
             if jump_function_prime.objective_value <= self.jump_function.objective_value:
                 self.jump_function = copy.deepcopy(jump_function_prime)
                 if jump_function_prime.objective_value <= self.best_jump_function.objective_value:
                     self.best_jump_function = copy.deepcopy(
                         self.jump_function)
         self.jump_function = p2.JumpFunction()