GET_WEIGHTS = False results = Results() #results.load(results_file) if GET_WEIGHTS == True: # Get best combination of weights inertia_weights = [0.5, 0.8, 1] cognitive_weights = [0.5, 1, 2.05, 4] social_weights = [0.5, 1, 2.05, 4] for inertia_weight in inertia_weights: for cognitive_weight in cognitive_weights: for social_weight in social_weights: constants.INERTIA_WEIGHT = inertia_weight constants.COGNITIVE_WEIGHT = cognitive_weight constants.SOCIAL_WEIGHT = social_weight print(inertia_weight, cognitive_weight, social_weight) # 30 experiments on a fixed population + statistics experiment = Experiment(griewangk, constants) max_value, min_value, mean_value = experiment.run_experiment( 30) print('Min = ', min_value, " Max = ", max_value, " Mean = ", mean_value) results.add("griewangk", -1, constants, min_value, max_value, mean_value) else: weight_combinations = [(0.5, 0.50, 4.00), (0.5, 1.00, 4.00)]