forked from abcolony/ABCPython
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathABCAlgorithm.py
More file actions
Latest commit
executable file
·39 lines (31 loc) · 1 KB
/
Copy pathABCAlgorithm.py
File metadata and controls
executable file
·39 lines (31 loc) · 1 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
39
#!/usr/bin/env python3
# github page: https://abcolony.github.io/
# github repository: https://github.com/abcolony/ABCPython
importdatetime
importsys
importtime
importABC
importConfig
fromReporterimportReporter
defmain(argv):
abcConf=Config.Config(argv)
abcList=list()
expT=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S").replace(" ", "").replace(":", "")
forruninrange(abcConf.RUN_TIME):
abc=ABC.ABC(abcConf)
abc.setExperimentID(run, expT)
start_time=time.time() *1000
abc.initial()
abc.memorize_best_source()
while(not(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
abcList.append(abc)
Reporter(abcList)
if__name__=='__main__':
main(sys.argv[1:])