|
79 | 79 | (os.path.join("chu1997", "d10100"), "orlibrary"), |
80 | 80 | ] |
81 | 81 |
|
82 | | -# if args.tests is None or "greedy" in args.tests: |
83 | | -# print("Column generation heuristic greedy") |
84 | | -# print("----------------------------------") |
85 | | -# print() |
| 82 | +if args.tests is None or "greedy" in args.tests: |
| 83 | + print("Column generation heuristic greedy") |
| 84 | + print("----------------------------------") |
| 85 | + print() |
86 | 86 |
|
87 | | -# for instance, instance_format in column_generation_data: |
88 | | -# instance_path = os.path.join( |
89 | | -# data_dir, |
90 | | -# instance) |
91 | | -# json_output_path = os.path.join( |
92 | | -# args.directory, |
93 | | -# algorithm.replace("-", "_"), |
94 | | -# instance + ".json") |
95 | | -# if not os.path.exists(os.path.dirname(json_output_path)): |
96 | | -# os.makedirs(os.path.dirname(json_output_path)) |
97 | | -# command = ( |
98 | | -# generalizedassignmentsolver_main |
99 | | -# + " --verbosity-level 1" |
100 | | -# + " --input \"" + instance_path + "\"" |
101 | | -# + " --format \"" + instance_format + "\"" |
102 | | -# + " --algorithm \"column-generation-heuristic-greedy\"" |
103 | | -# + " --output \"" + json_output_path + "\"") |
104 | | -# print(command) |
105 | | -# status = os.system(command) |
106 | | -# if status != 0: |
107 | | -# sys.exit(1) |
108 | | -# print() |
109 | | -# print() |
110 | | -# print() |
| 87 | + for instance, instance_format in column_generation_data: |
| 88 | + instance_path = os.path.join( |
| 89 | + data_dir, |
| 90 | + instance) |
| 91 | + json_output_path = os.path.join( |
| 92 | + args.directory, |
| 93 | + algorithm.replace("-", "_"), |
| 94 | + instance + ".json") |
| 95 | + if not os.path.exists(os.path.dirname(json_output_path)): |
| 96 | + os.makedirs(os.path.dirname(json_output_path)) |
| 97 | + command = ( |
| 98 | + generalizedassignmentsolver_main |
| 99 | + + " --verbosity-level 1" |
| 100 | + + " --input \"" + instance_path + "\"" |
| 101 | + + " --format \"" + instance_format + "\"" |
| 102 | + + " --algorithm \"column-generation-heuristic-greedy\"" |
| 103 | + + " --output \"" + json_output_path + "\"") |
| 104 | + print(command) |
| 105 | + status = os.system(command) |
| 106 | + if status != 0: |
| 107 | + sys.exit(1) |
| 108 | + print() |
| 109 | + print() |
| 110 | + print() |
0 commit comments