summaryrefslogtreecommitdiffstats
path: root/example3.py
diff options
context:
space:
mode:
Diffstat (limited to 'example3.py')
-rw-r--r--example3.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/example3.py b/example3.py
new file mode 100644
index 0000000..a01434c
--- /dev/null
+++ b/example3.py
@@ -0,0 +1,20 @@
+from vrptw_base import VrptwGraph
+from multiple_ant_colony_system import MultipleAntColonySystem
+import os
+
+
+if __name__ == '__main__':
+ ants_num = 10
+ beta = 1
+ q0 = 0.1
+ show_figure = False
+ for file_name in os.listdir('./solomon-100'):
+ file_path = os.path.join('./solomon-100', file_name)
+ print('-' * 100)
+ print('file_path: %s' % file_path)
+ print('\n')
+ file_to_write_path = os.path.join('./result', file_name.split('.')[0] + '-result.txt')
+ graph = VrptwGraph(file_path)
+ macs = MultipleAntColonySystem(graph, ants_num=ants_num, beta=beta, q0=q0, whether_or_not_to_show_figure=show_figure)
+ macs.run_multiple_ant_colony_system(file_to_write_path)
+ print('\n' * 10)