-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment_ga.py
31 lines (30 loc) · 1.25 KB
/
experiment_ga.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import random
from problems.makespan.makespan_candidate import Makespan as Makespan
import hippie.GA as GA
from experiment.generator import ExperimentGenerator
from experiment.worker import Worker
random.seed(3)
experiments_parms = {
'n_generations': [100],
'population_size':[100],
'crossover': {'type': [GA.crossover.TwoPointCross, GA.crossover.OnePointCross],
'pb': [0.2, 0.5]},
'mutation': {'type': [GA.mutation.CreepMutation],
'pb': [0.2],
'encoding_range': [Makespan.generate_random_candidate(conf="Bench1")._m]},
'selection': [GA.selection.RouletteWheel(), {'type': [GA.selection.Tournament],
'tournement_size': [20,10],
'best_win_pb': [0.4]
}],
'candidate_type': [Makespan],
'candidate_gen_parms': {'type':[dict], 'conf': ["Bench1"]}
}
experiments = ExperimentGenerator(GA.Optimizer, experiments_parms, num_experiments=2)
arbeiter = Worker(experiments)
arbeiter.start()
arbeiter.wait()
# for i in experiments.experiment_instances():
# # pprint(i)
# opt = GA.Optimizer(**i)
# # opt.optimize()
# print("Done")