From 9fb82ddc7a2e0a7335d10a1a602ad044e20866c8 Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Sat, 20 Jul 2024 10:26:01 +0200 Subject: [PATCH] Update column generation --- extern/CMakeLists.txt | 2 +- scripts/run_tests.py | 56 +++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index b289a67..0401fba 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -45,7 +45,7 @@ endif() FetchContent_Declare( columngenerationsolver GIT_REPOSITORY https://github.com/fontanf/columngenerationsolver.git - GIT_TAG 9c57300135f8d1ec2a44de4aeb53e0056d24f2f3 + GIT_TAG 1414cd0ca3185f301664c9e840aeda20a72e1844 #SOURCE_DIR "${PROJECT_SOURCE_DIR}/../columngenerationsolver/" EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(columngenerationsolver) diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 1b23dcb..18cea16 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -79,32 +79,32 @@ (os.path.join("chu1997", "d10100"), "orlibrary"), ] -# if args.tests is None or "greedy" in args.tests: -# print("Column generation heuristic greedy") -# print("----------------------------------") -# print() +if args.tests is None or "greedy" in args.tests: + print("Column generation heuristic greedy") + print("----------------------------------") + print() -# for instance, instance_format in column_generation_data: -# instance_path = os.path.join( -# data_dir, -# instance) -# json_output_path = os.path.join( -# args.directory, -# algorithm.replace("-", "_"), -# instance + ".json") -# if not os.path.exists(os.path.dirname(json_output_path)): -# os.makedirs(os.path.dirname(json_output_path)) -# command = ( -# generalizedassignmentsolver_main -# + " --verbosity-level 1" -# + " --input \"" + instance_path + "\"" -# + " --format \"" + instance_format + "\"" -# + " --algorithm \"column-generation-heuristic-greedy\"" -# + " --output \"" + json_output_path + "\"") -# print(command) -# status = os.system(command) -# if status != 0: -# sys.exit(1) -# print() -# print() -# print() + for instance, instance_format in column_generation_data: + instance_path = os.path.join( + data_dir, + instance) + json_output_path = os.path.join( + args.directory, + algorithm.replace("-", "_"), + instance + ".json") + if not os.path.exists(os.path.dirname(json_output_path)): + os.makedirs(os.path.dirname(json_output_path)) + command = ( + generalizedassignmentsolver_main + + " --verbosity-level 1" + + " --input \"" + instance_path + "\"" + + " --format \"" + instance_format + "\"" + + " --algorithm \"column-generation-heuristic-greedy\"" + + " --output \"" + json_output_path + "\"") + print(command) + status = os.system(command) + if status != 0: + sys.exit(1) + print() + print() + print()