- Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathABCAlgorithm.py
More file actions
Latest commit
38 lines (30 loc) · 1.01 KB
/
Copy pathABCAlgorithm.py
File metadata and controls
38 lines (30 loc) · 1.01 KB
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
32
33
34
35
36
37
38
# github page: https://abcolony.github.io/
# github repository: https://github.com/abcolony/ABCPython
importdatetime
importsys
importtime
importABC
importConfig
fromReporterimportReporter
defmain(argv):
abc_conf=Config.Config(argv)
abc_list=list()
experiment_name=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S").replace(" ", "").replace(":", "")
forruninrange(abc_conf.RUN_TIME):
abc=ABC.ABC(abc_conf)
abc.set_experiment_id(run, experiment_name)
start_time=time.time() *1000
abc.initial()
abc.memorize_best_source()
whilenot(abc.stopping_condition()):
abc.send_employed_bees()
abc.calculate_probabilities()
abc.send_onlooker_bees()
abc.memorize_best_source()
abc.send_scout_bees()
abc.increase_cycle()
abc.globalTime=time.time() *1000-start_time
abc_list.append(abc)
Reporter(abc_list)
if__name__=='__main__':
main(sys.argv[1:])