forked from abcolony/ABCPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathABCAlgorithm.py
39 lines (30 loc) · 1004 Bytes
/
ABCAlgorithm.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
32
33
34
35
36
37
38
39
# github page: https://abcolony.github.io/
# github repository: https://github.com/abcolony/ABCPython
import datetime
import sys
import time
import ABC
import Config
from Reporter import Reporter
def main(argv):
abcConf = Config.Config(argv)
abcList = list()
expT = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S").replace(" ","").replace(":","")
for run in range(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:])