diff --git a/.bazelrc b/.bazelrc deleted file mode 100644 index 5c259c8..0000000 --- a/.bazelrc +++ /dev/null @@ -1,5 +0,0 @@ -build --compilation_mode=opt -#build --cxxopt=-Wall --cxxopt=-Wextra - -#build --define cplex=true -#build --define gurobi=true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e451fbf..69371f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,17 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.8"] + env: + CAPACITATED_VEHICLE_ROUTING_DATA: ${{ github.workspace }}/data/capacitated_vehicle_routing + KNAPSACK_WITH_CONFLICTS_DATA: ${{ github.workspace }}/data/knapsack_with_conflicts + JOB_SEQUENCING_AND_TOOL_SWITCHING_DATA: ${{ github.workspace }}/data/job_sequencing_and_tool_switching + FLOWSHOP_SCHEDULING_DATA: ${{ github.workspace }}/data/flowshop_scheduling + SCHEDULING_WITH_SDST_TWT_DATA: ${{ github.workspace }}/data/scheduling_with_sdst_twt + SEQUENTIAL_ORDERING_DATA: ${{ github.workspace }}/data/sequential_ordering + TEAM_ORIENTEERING_DATA: ${{ github.workspace }}/data/team_orienteering + TIME_DEPENDENT_ORIENTEERING_DATA: ${{ github.workspace }}/data/time_dependent_orienteering + VEHICLE_ROUTING_WITH_TIME_WINDOWS_DATA: ${{ github.workspace }}/data/vehicle_routing_with_time_windows + steps: - name: Checkout code uses: actions/checkout@v4 @@ -26,7 +37,10 @@ jobs: python3 -m pip install gdown python3 scripts/download_data.py - name: Build - run: bazel build -- //... + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + cmake --build build --config Release --parallel + cmake --install build --config Release --prefix install - name: Run tests run: python3 -u scripts/run_tests.py test_results - name: Checkout main branch @@ -35,8 +49,8 @@ jobs: git fetch --depth 1 git checkout master - name: Build - run: bazel build -- //... + run: bazel build -- //examples/... - name: Run tests run: python3 -u scripts/run_tests.py test_results_ref - name: Process tests - run: python3 ./bazel-localsearchsolver/external/optimizationtools/scripts/process_tests.py --ref test_results_ref --new test_results + run: python3 -u ./build/_deps/optimizationtools-src/scripts/process_tests.py --ref test_results_ref --new test_results diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5c8bcf1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.15.0) + +project(LocalSearchSolver LANGUAGES CXX) + +# Require C++14. +set(CMAKE_CXX_STANDARD 14) + +# Enable output of compile commands during generation. +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Add sub-directories. +add_subdirectory(extern) +add_subdirectory(src) +add_subdirectory(test) diff --git a/README.md b/README.md index cac06c0..b07e302 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,9 @@ Data can be downloaded from [fontanf/orproblems](https://github.com/fontanf/orpr Compile: ```shell -bazel build -- //... +cmake -S . -B build -DCMAKE_BUILD_TYPE=Release +cmake --build build --config Release --parallel +cmake --install build --config Release --prefix install ``` Download data: @@ -182,7 +184,7 @@ python3 scripts/download_data.py Then, examples can be executed as follows: ```shell -./bazel-bin/examples/sequential_ordering_main -v 1 -i ./data/sequential_ordering/soplib/R.200.100.1.sop -f soplib -a best-first-local-search --maximum-number-of-nodes 100 -c sol.txt +./install/bin/localsearchsolver_sequential_ordering --verbosity-level 1 --input ./data/sequential_ordering/soplib/R.200.100.1.sop --format soplib --algorithm best-first-local-search --maximum-number-of-nodes 100 --certificate solution.txt ``` ``` ======================================= @@ -308,7 +310,7 @@ Total distance: 194 ``` ```shell -./bazel-bin/examples/knapsack_with_conflicts_main -v 1 -i ../ordata/packing/knapsack_with_conflicts/bettinelli2017/sparse_corr/test_1000_1000_r0.001-0.dat -f bettinelli2017 -t 5 -c sol.txt +./install/bin/localsearchsolver_knapsack_with_conflicts --verbosity-level 1 --input ./data/packing/knapsack_with_conflicts/bettinelli2017/sparse_corr/test_1000_1000_r0.001-0.dat --format bettinelli2017 --time-limit 5 --certificate solution.txt ``` ``` ======================================= diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index a9eb739..0000000 --- a/WORKSPACE +++ /dev/null @@ -1,138 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -git_repository( - name = "googletest", - remote = "https://github.com/google/googletest.git", - commit = "58d77fa8070e8cec2dc1ed015d66b454c8d78850", - shallow_since = "1656350095 -0400", -) - -git_repository( - name = "com_github_nelhage_rules_boost", - remote = "https://github.com/nelhage/rules_boost", - commit = "e83dfef18d91a3e35c8eac9b9aeb1444473c0efd", - shallow_since = "1671181466 +0000", -) -load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") -boost_deps() - -http_archive( - name = "json", - build_file_content = """ -cc_library( - name = "json", - hdrs = ["single_include/nlohmann/json.hpp"], - visibility = ["//visibility:public"], - strip_include_prefix = "single_include/" -) -""", - urls = ["https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip"], - sha256 = "87b5884741427220d3a33df1363ae0e8b898099fbc59f1c451113f6732891014", -) - -git_repository( - name = "optimizationtools", - remote = "https://github.com/fontanf/optimizationtools.git", - commit = "9ddf9e540ecda09f7877b8c6267f77fbcf15ce25", -) - -local_repository( - name = "optimizationtools_", - path = "../optimizationtools/", -) - -git_repository( - name = "orproblems", - remote = "https://github.com/fontanf/orproblems.git", - commit = "73775045b1dda21a7b58b277444448eeeb14105a", -) - -local_repository( - name = "orproblems_", - path = "../orproblems/", -) - -git_repository( - name = "travelingsalesmansolver", - remote = "https://github.com/fontanf/travelingsalesmansolver.git", - commit = "b30181787a1bd1a64dac4ad8fb926d2e2f58afaa", -) - -local_repository( - name = "travelingsalesmansolver_", - path = "../travelingsalesmansolver/", -) - -http_archive( - name = "simdjson", - build_file_content = """ -cc_library( - name = "simdjson", - hdrs = ["simdjson-0.9.2/singleheader/simdjson.h"], - srcs = ["simdjson-0.9.2/singleheader/simdjson.cpp"], - visibility = ["//visibility:public"], - strip_include_prefix = "simdjson-0.9.2/singleheader/" -) -""", - urls = ["https://github.com/simdjson/simdjson/archive/refs/tags/v0.9.2.zip"], - sha256 = "4d4e4a9d64b55839ec6c80f0ba54261139543b7ffcf84bceede681ccb95fe94b", -) - -new_local_repository( - name = "gurobi", - path = "/home/florian/Programmes/gurobi811/linux64/", - build_file_content = """ -cc_library( - name = "gurobi", - hdrs = [ - "include/gurobi_c.h", - "include/gurobi_c++.h", - ], - strip_include_prefix = "include/", - srcs = [ - "lib/libgurobi_c++.a", - "lib/libgurobi81.so", - ], - visibility = ["//visibility:public"], -) -""", -) - -new_local_repository( - name = "cplex", - path = "/opt/ibm/ILOG/CPLEX_Studio129/", - build_file_content = """ -cc_library( - name = "concert", - hdrs = glob(["concert/include/ilconcert/**/*.h"], exclude_directories = 0), - strip_include_prefix = "concert/include/", - srcs = ["concert/lib/x86-64_linux/static_pic/libconcert.a"], - linkopts = [ - "-lm", - "-lpthread", - "-ldl", - ], - visibility = ["//visibility:public"], -) -cc_library( - name = "cplex", - hdrs = glob(["cplex/include/ilcplex/*.h"]), - strip_include_prefix = "cplex/include/", - srcs = [ - "cplex/lib/x86-64_linux/static_pic/libilocplex.a", - "cplex/lib/x86-64_linux/static_pic/libcplex.a", - ], - deps = [":concert"], - visibility = ["//visibility:public"], -) -cc_library( - name = "cpoptimizer", - hdrs = glob(["cpoptimizer/include/ilcp/*.h"]), - strip_include_prefix = "cpoptimizer/include/", - srcs = ["cpoptimizer/lib/x86-64_linux/static_pic/libcp.a"], - deps = [":cplex"], - visibility = ["//visibility:public"], -) -""", -) diff --git a/examples/BUILD b/examples/BUILD deleted file mode 100644 index c21769b..0000000 --- a/examples/BUILD +++ /dev/null @@ -1,463 +0,0 @@ -config_setting(name = "cplex_build", values = {"define": "cplex=true"}, visibility = ["//visibility:public"]) -config_setting(name = "gurobi_build", values = {"define": "gurobi=true"}, visibility = ["//visibility:public"]) - -load("//examples:variables.bzl", - "CPLEX_COPTS", "CPLEX_DEP", - "GUROBI_COPTS", "GUROBI_DEP") - -cc_library( - name = "knapsack_with_conflicts", - hdrs = ["knapsack_with_conflicts.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:knapsack_with_conflicts", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "knapsack_with_conflicts_main", - srcs = ["knapsack_with_conflicts_main.cpp"], - deps = [ - ":knapsack_with_conflicts", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "multidimensional_multiple_choice_knapsack", - hdrs = ["multidimensional_multiple_choice_knapsack.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:multidimensional_multiple_choice_knapsack", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "multidimensional_multiple_choice_knapsack_main", - srcs = ["multidimensional_multiple_choice_knapsack_main.cpp"], - deps = [ - ":multidimensional_multiple_choice_knapsack", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "quadratic_assignment", - hdrs = ["quadratic_assignment.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:quadratic_assignment", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "quadratic_assignment_main", - srcs = ["quadratic_assignment_main.cpp"], - deps = [ - ":quadratic_assignment", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "sequential_ordering", - hdrs = ["sequential_ordering.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:sequential_ordering", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "sequential_ordering_main", - srcs = ["sequential_ordering_main.cpp"], - deps = [ - ":sequential_ordering", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "scheduling_with_sdst_twt", - hdrs = ["scheduling_with_sdst_twt.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:scheduling_with_sdst_twt", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "scheduling_with_sdst_twt_main", - srcs = ["scheduling_with_sdst_twt_main.cpp"], - deps = [ - ":scheduling_with_sdst_twt", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "order_acceptance_and_scheduling", - hdrs = ["order_acceptance_and_scheduling.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:order_acceptance_and_scheduling", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "order_acceptance_and_scheduling_main", - srcs = ["order_acceptance_and_scheduling_main.cpp"], - deps = [ - ":order_acceptance_and_scheduling", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "job_sequencing_and_tool_switching", - hdrs = ["job_sequencing_and_tool_switching.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:job_sequencing_and_tool_switching", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "job_sequencing_and_tool_switching_main", - srcs = ["job_sequencing_and_tool_switching_main.cpp"], - deps = [ - ":job_sequencing_and_tool_switching", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "time_dependent_orienteering", - hdrs = ["time_dependent_orienteering.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:time_dependent_orienteering", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "time_dependent_orienteering_main", - srcs = ["time_dependent_orienteering_main.cpp"], - deps = [ - ":time_dependent_orienteering", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "permutation_flowshop_scheduling_makespan", - hdrs = ["permutation_flowshop_scheduling_makespan.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:permutation_flowshop_scheduling_makespan", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "permutation_flowshop_scheduling_makespan_main", - srcs = ["permutation_flowshop_scheduling_makespan_main.cpp"], - deps = [ - ":permutation_flowshop_scheduling_makespan", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "permutation_flowshop_scheduling_tct", - hdrs = ["permutation_flowshop_scheduling_tct.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:permutation_flowshop_scheduling_tct", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "permutation_flowshop_scheduling_tct_main", - srcs = ["permutation_flowshop_scheduling_tct_main.cpp"], - deps = [ - ":permutation_flowshop_scheduling_tct", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "permutation_flowshop_scheduling_tt", - hdrs = ["permutation_flowshop_scheduling_tt.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:permutation_flowshop_scheduling_tt", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "permutation_flowshop_scheduling_tt_main", - srcs = ["permutation_flowshop_scheduling_tt_main.cpp"], - deps = [ - ":permutation_flowshop_scheduling_tt", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "distributed_pfss_tct", - hdrs = ["distributed_pfss_tct.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:distributed_pfss_tct", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "distributed_pfss_tct_main", - srcs = ["distributed_pfss_tct_main.cpp"], - deps = [ - ":distributed_pfss_tct", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "traveling_repairman", - hdrs = ["traveling_repairman.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:traveling_repairman", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "traveling_repairman_main", - srcs = ["traveling_repairman_main.cpp"], - deps = [ - ":traveling_repairman", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "capacitated_vehicle_routing", - hdrs = ["capacitated_vehicle_routing.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:capacitated_vehicle_routing", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "capacitated_vehicle_routing_main", - srcs = ["capacitated_vehicle_routing_main.cpp"], - deps = [ - ":capacitated_vehicle_routing", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - -cc_binary( - name = "capacitated_vehicle_routing_dimacs_main", - srcs = ["capacitated_vehicle_routing_dimacs_main.cpp"], - deps = [ - ":capacitated_vehicle_routing", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "vehicle_routing_with_time_windows", - hdrs = ["vehicle_routing_with_time_windows.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:vehicle_routing_with_time_windows", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "vehicle_routing_with_time_windows_main", - srcs = ["vehicle_routing_with_time_windows_main.cpp"], - deps = [ - ":vehicle_routing_with_time_windows", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - -cc_binary( - name = "vehicle_routing_with_time_windows_dimacs_main", - srcs = ["vehicle_routing_with_time_windows_dimacs_main.cpp"], - deps = [ - ":vehicle_routing_with_time_windows", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "team_orienteering", - hdrs = ["team_orienteering.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:team_orienteering", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "team_orienteering_main", - srcs = ["team_orienteering_main.cpp"], - deps = [ - ":team_orienteering", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "traveling_salesman_with_release_dates", - hdrs = ["traveling_salesman_with_release_dates.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:traveling_salesman_with_release_dates", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "traveling_salesman_with_release_dates_main", - srcs = ["traveling_salesman_with_release_dates_main.cpp"], - deps = [ - ":traveling_salesman_with_release_dates", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) - - -cc_library( - name = "batch_scheduling_total_weighted_tardiness", - hdrs = ["batch_scheduling_total_weighted_tardiness.hpp"], - deps = [ - "//localsearchsolver:localsearchsolver", - "@orproblems//orproblems:batch_scheduling_total_weighted_tardiness", - ], - visibility = ["//visibility:public"], -) - -cc_binary( - name = "batch_scheduling_total_weighted_tardiness_main", - srcs = ["batch_scheduling_total_weighted_tardiness_main.cpp"], - deps = [ - ":batch_scheduling_total_weighted_tardiness", - "//localsearchsolver:read_args", - ], - linkopts = select({ - "@bazel_tools//src/conditions:windows": [], - "//conditions:default": ["-lpthread"], - }), -) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt new file mode 100644 index 0000000..4e05343 --- /dev/null +++ b/extern/CMakeLists.txt @@ -0,0 +1,10 @@ +# Enable FetchContent. +include(FetchContent) + +# Fetch fontanf/orproblems. +FetchContent_Declare( + orproblems + GIT_REPOSITORY https://github.com/fontanf/orproblems.git + GIT_TAG b9e5b32ea612fd2cf23e71de0a969b6dd56ae5d3) + #SOURCE_DIR "${PROJECT_SOURCE_DIR}/../orproblems/") +FetchContent_MakeAvailable(orproblems) diff --git a/localsearchsolver/algorithm_formatter.hpp b/include/localsearchsolver/algorithm_formatter.hpp similarity index 100% rename from localsearchsolver/algorithm_formatter.hpp rename to include/localsearchsolver/algorithm_formatter.hpp diff --git a/localsearchsolver/best_first_local_search.hpp b/include/localsearchsolver/best_first_local_search.hpp similarity index 100% rename from localsearchsolver/best_first_local_search.hpp rename to include/localsearchsolver/best_first_local_search.hpp diff --git a/localsearchsolver/common.hpp b/include/localsearchsolver/common.hpp similarity index 100% rename from localsearchsolver/common.hpp rename to include/localsearchsolver/common.hpp diff --git a/examples/batch_scheduling_total_weighted_tardiness.hpp b/include/localsearchsolver/examples/batch_scheduling_total_weighted_tardiness.hpp similarity index 100% rename from examples/batch_scheduling_total_weighted_tardiness.hpp rename to include/localsearchsolver/examples/batch_scheduling_total_weighted_tardiness.hpp diff --git a/examples/capacitated_vehicle_routing.hpp b/include/localsearchsolver/examples/capacitated_vehicle_routing.hpp similarity index 100% rename from examples/capacitated_vehicle_routing.hpp rename to include/localsearchsolver/examples/capacitated_vehicle_routing.hpp diff --git a/examples/distributed_pfss_tct.hpp b/include/localsearchsolver/examples/distributed_pfss_tct.hpp similarity index 100% rename from examples/distributed_pfss_tct.hpp rename to include/localsearchsolver/examples/distributed_pfss_tct.hpp diff --git a/examples/job_sequencing_and_tool_switching.hpp b/include/localsearchsolver/examples/job_sequencing_and_tool_switching.hpp similarity index 100% rename from examples/job_sequencing_and_tool_switching.hpp rename to include/localsearchsolver/examples/job_sequencing_and_tool_switching.hpp diff --git a/examples/knapsack_with_conflicts.hpp b/include/localsearchsolver/examples/knapsack_with_conflicts.hpp similarity index 100% rename from examples/knapsack_with_conflicts.hpp rename to include/localsearchsolver/examples/knapsack_with_conflicts.hpp diff --git a/examples/multidimensional_multiple_choice_knapsack.hpp b/include/localsearchsolver/examples/multidimensional_multiple_choice_knapsack.hpp similarity index 100% rename from examples/multidimensional_multiple_choice_knapsack.hpp rename to include/localsearchsolver/examples/multidimensional_multiple_choice_knapsack.hpp diff --git a/examples/order_acceptance_and_scheduling.hpp b/include/localsearchsolver/examples/order_acceptance_and_scheduling.hpp similarity index 100% rename from examples/order_acceptance_and_scheduling.hpp rename to include/localsearchsolver/examples/order_acceptance_and_scheduling.hpp diff --git a/examples/permutation_flowshop_scheduling_makespan.hpp b/include/localsearchsolver/examples/permutation_flowshop_scheduling_makespan.hpp similarity index 100% rename from examples/permutation_flowshop_scheduling_makespan.hpp rename to include/localsearchsolver/examples/permutation_flowshop_scheduling_makespan.hpp diff --git a/examples/permutation_flowshop_scheduling_tct.hpp b/include/localsearchsolver/examples/permutation_flowshop_scheduling_tct.hpp similarity index 100% rename from examples/permutation_flowshop_scheduling_tct.hpp rename to include/localsearchsolver/examples/permutation_flowshop_scheduling_tct.hpp diff --git a/examples/permutation_flowshop_scheduling_tt.hpp b/include/localsearchsolver/examples/permutation_flowshop_scheduling_tt.hpp similarity index 100% rename from examples/permutation_flowshop_scheduling_tt.hpp rename to include/localsearchsolver/examples/permutation_flowshop_scheduling_tt.hpp diff --git a/examples/quadratic_assignment.hpp b/include/localsearchsolver/examples/quadratic_assignment.hpp similarity index 100% rename from examples/quadratic_assignment.hpp rename to include/localsearchsolver/examples/quadratic_assignment.hpp diff --git a/examples/scheduling_with_sdst_twt.hpp b/include/localsearchsolver/examples/scheduling_with_sdst_twt.hpp similarity index 100% rename from examples/scheduling_with_sdst_twt.hpp rename to include/localsearchsolver/examples/scheduling_with_sdst_twt.hpp diff --git a/examples/sequential_ordering.hpp b/include/localsearchsolver/examples/sequential_ordering.hpp similarity index 100% rename from examples/sequential_ordering.hpp rename to include/localsearchsolver/examples/sequential_ordering.hpp diff --git a/examples/team_orienteering.hpp b/include/localsearchsolver/examples/team_orienteering.hpp similarity index 100% rename from examples/team_orienteering.hpp rename to include/localsearchsolver/examples/team_orienteering.hpp diff --git a/examples/time_dependent_orienteering.hpp b/include/localsearchsolver/examples/time_dependent_orienteering.hpp similarity index 100% rename from examples/time_dependent_orienteering.hpp rename to include/localsearchsolver/examples/time_dependent_orienteering.hpp diff --git a/examples/traveling_repairman.hpp b/include/localsearchsolver/examples/traveling_repairman.hpp similarity index 100% rename from examples/traveling_repairman.hpp rename to include/localsearchsolver/examples/traveling_repairman.hpp diff --git a/examples/traveling_salesman_with_release_dates.hpp b/include/localsearchsolver/examples/traveling_salesman_with_release_dates.hpp similarity index 100% rename from examples/traveling_salesman_with_release_dates.hpp rename to include/localsearchsolver/examples/traveling_salesman_with_release_dates.hpp diff --git a/examples/vehicle_routing_with_time_windows.hpp b/include/localsearchsolver/examples/vehicle_routing_with_time_windows.hpp similarity index 100% rename from examples/vehicle_routing_with_time_windows.hpp rename to include/localsearchsolver/examples/vehicle_routing_with_time_windows.hpp diff --git a/localsearchsolver/genetic_local_search.hpp b/include/localsearchsolver/genetic_local_search.hpp similarity index 100% rename from localsearchsolver/genetic_local_search.hpp rename to include/localsearchsolver/genetic_local_search.hpp diff --git a/localsearchsolver/iterated_local_search.hpp b/include/localsearchsolver/iterated_local_search.hpp similarity index 100% rename from localsearchsolver/iterated_local_search.hpp rename to include/localsearchsolver/iterated_local_search.hpp diff --git a/localsearchsolver/multi_start_local_search.hpp b/include/localsearchsolver/multi_start_local_search.hpp similarity index 100% rename from localsearchsolver/multi_start_local_search.hpp rename to include/localsearchsolver/multi_start_local_search.hpp diff --git a/localsearchsolver/sequencing.hpp b/include/localsearchsolver/sequencing.hpp similarity index 100% rename from localsearchsolver/sequencing.hpp rename to include/localsearchsolver/sequencing.hpp diff --git a/localsearchsolver/BUILD b/localsearchsolver/BUILD deleted file mode 100644 index 26ec5d3..0000000 --- a/localsearchsolver/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -cc_library( - name = "localsearchsolver", - hdrs = [ - "common.hpp", - "algorithm_formatter.hpp", - "multi_start_local_search.hpp", - "iterated_local_search.hpp", - "best_first_local_search.hpp", - "genetic_local_search.hpp", - "sequencing.hpp", - "read_args.hpp", - ], - srcs = [ - "common.cpp", - ], - deps = [ - "@optimizationtools//optimizationtools/utils:utils", - "@optimizationtools//optimizationtools/containers:containers", - ], - visibility = ["//visibility:public"], -) - -cc_library( - name = "read_args", - hdrs = ["read_args.hpp"], - deps = [ - ":localsearchsolver", - "@boost//:program_options", - ], - visibility = ["//visibility:public"], -) diff --git a/scripts/process_all_tests.py b/scripts/process_all_tests.py deleted file mode 100644 index 71d1414..0000000 --- a/scripts/process_all_tests.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys -import os -sys.path.insert(1, os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "..", - "bazel-localsearchsolver", - "external", - "optimizationtools", - "scripts")) -import process_tests - -process_tests.process_tests( - os.path.join("test_results_ref", "scheduling_with_sdst_twt"), - os.path.join("test_results", "scheduling_with_sdst_twt"), - ["Value"], - ["Time"]) - -process_tests.process_tests( - os.path.join("test_results_ref", "team_orienteering"), - os.path.join("test_results", "team_orienteering"), - ["Value"], - ["Time"]) diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 993c761..5e0eb95 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -18,7 +18,8 @@ print("-----------------------------------") print() - capacitated_vehicle_routing_data = [ + data_dir = os.environ['CAPACITATED_VEHICLE_ROUTING_DATA'] + data = [ (os.path.join("uchoa2014", "X", "X-n101-k25.vrp"), "cvrplib"), (os.path.join("uchoa2014", "X", "X-n106-k14.vrp"), "cvrplib"), (os.path.join("uchoa2014", "X", "X-n110-k13.vrp"), "cvrplib"), @@ -29,14 +30,13 @@ (os.path.join("uchoa2014", "X", "X-n134-k13.vrp"), "cvrplib"), (os.path.join("uchoa2014", "X", "X-n139-k10.vrp"), "cvrplib"), (os.path.join("uchoa2014", "X", "X-n143-k7.vrp"), "cvrplib")] - capacitated_vehicle_routing_main = os.path.join( - "bazel-bin", - "examples", - "capacitated_vehicle_routing_main") - for instance, instance_format in capacitated_vehicle_routing_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_capacitated_vehicle_routing") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "capacitated_vehicle_routing", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -45,7 +45,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - capacitated_vehicle_routing_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -66,7 +66,8 @@ print("-------------------------------") print() - knapsack_with_conflicts_data = [ + data_dir = os.environ['KNAPSACK_WITH_CONFLICTS_DATA'] + data = [ (os.path.join("hifi2006", "I1 - I10", "1I1"), "hifi2006"), (os.path.join("hifi2006", "I1 - I10", "2I2"), "hifi2006"), (os.path.join("hifi2006", "I1 - I10", "3I3"), "hifi2006"), @@ -77,14 +78,13 @@ (os.path.join("hifi2006", "I1 - I10", "8I3"), "hifi2006"), (os.path.join("hifi2006", "I1 - I10", "9I4"), "hifi2006"), (os.path.join("hifi2006", "I1 - I10", "10I5"), "hifi2006")] - knapsack_with_conflicts_main = os.path.join( - "bazel-bin", - "examples", - "knapsack_with_conflicts_main") - for instance, instance_format in knapsack_with_conflicts_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_knapsack_with_conflicts") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "knapsack_with_conflicts", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -93,7 +93,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - knapsack_with_conflicts_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -114,7 +114,8 @@ print("---------------------------------") print() - job_sequencing_and_tool_switching_data = [ + data_dir = os.environ['JOB_SEQUENCING_AND_TOOL_SWITCHING_DATA'] + data = [ (os.path.join("crama1994", "Tabela1", "s1n001.txt"), ""), (os.path.join("crama1994", "Tabela1", "s2n001.txt"), ""), (os.path.join("crama1994", "Tabela1", "s3n001.txt"), ""), @@ -127,14 +128,13 @@ (os.path.join("crama1994", "Tabela4", "s1n001.txt"), ""), (os.path.join("crama1994", "Tabela4", "s2n001.txt"), ""), (os.path.join("crama1994", "Tabela4", "s3n001.txt"), "")] - job_sequencing_and_tool_switching_main = os.path.join( - "bazel-bin", - "examples", - "job_sequencing_and_tool_switching_main") - for instance, instance_format in job_sequencing_and_tool_switching_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_job_sequencing_and_tool_switching") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "job_sequencing_and_tool_switching", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -143,7 +143,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - job_sequencing_and_tool_switching_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -164,7 +164,8 @@ print("--------------------------------------------------------------") print() - permutation_flowshop_scheduling_tct_data = [ + data_dir = os.environ['FLOWSHOP_SCHEDULING_DATA'] + data = [ (os.path.join("taillard1993", "tai20_5_0.txt"), "default"), (os.path.join("taillard1993", "tai20_5_1.txt"), "default"), (os.path.join("taillard1993", "tai20_5_2.txt"), "default"), @@ -175,14 +176,13 @@ (os.path.join("taillard1993", "tai20_5_7.txt"), "default"), (os.path.join("taillard1993", "tai20_5_8.txt"), "default"), (os.path.join("taillard1993", "tai20_5_9.txt"), "default")] - permutation_flowshop_scheduling_tct_main = os.path.join( - "bazel-bin", - "examples", - "permutation_flowshop_scheduling_tct_main") - for instance, instance_format in permutation_flowshop_scheduling_tct_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_permutation_flowshop_scheduling_tct") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "flowshop_scheduling", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -191,7 +191,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - permutation_flowshop_scheduling_tct_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -212,7 +212,8 @@ print("-------------------------------------------------") print() - permutation_flowshop_scheduling_makespan_data = [ + data_dir = os.environ['FLOWSHOP_SCHEDULING_DATA'] + data = [ (os.path.join("vallada2015", "Small", "VFR10_5_1_Gap.txt"), "default"), (os.path.join("vallada2015", "Small", "VFR10_5_2_Gap.txt"), "default"), (os.path.join("vallada2015", "Small", "VFR10_5_3_Gap.txt"), "default"), @@ -223,14 +224,13 @@ (os.path.join("vallada2015", "Small", "VFR10_5_8_Gap.txt"), "default"), (os.path.join("vallada2015", "Small", "VFR10_5_9_Gap.txt"), "default"), (os.path.join("vallada2015", "Small", "VFR10_5_10_Gap.txt"), "default")] - permutation_flowshop_scheduling_makespan_main = os.path.join( - "bazel-bin", - "examples", - "permutation_flowshop_scheduling_makespan_main") - for instance, instance_format in permutation_flowshop_scheduling_makespan_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_permutation_flowshop_scheduling_makespan") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "flowshop_scheduling", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -239,7 +239,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - permutation_flowshop_scheduling_makespan_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -260,7 +260,8 @@ print("-----------------------------------------------------------------------------------------------") print() - scheduling_with_sdst_twt_data = [ + data_dir = os.environ['SCHEDULING_WITH_SDST_TWT_DATA'] + data = [ (os.path.join("cicirello2005", "wt_sds_10.instance"), ""), (os.path.join("cicirello2005", "wt_sds_20.instance"), ""), (os.path.join("cicirello2005", "wt_sds_30.instance"), ""), @@ -273,14 +274,13 @@ (os.path.join("cicirello2005", "wt_sds_100.instance"), ""), (os.path.join("cicirello2005", "wt_sds_110.instance"), ""), (os.path.join("cicirello2005", "wt_sds_120.instance"), "")] - scheduling_with_sdst_twt_main = os.path.join( - "bazel-bin", - "examples", - "scheduling_with_sdst_twt_main") - for instance, instance_format in scheduling_with_sdst_twt_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_scheduling_with_sdst_twt") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "scheduling_with_sdst_twt", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -289,7 +289,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - scheduling_with_sdst_twt_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -310,7 +310,8 @@ print("---------------------------") print() - sequential_ordering_data = [ + data_dir = os.environ['SEQUENTIAL_ORDERING_DATA'] + data = [ (os.path.join("soplib", "R.200.100.1.sop"), "soplib"), (os.path.join("soplib", "R.200.100.15.sop"), "soplib"), (os.path.join("soplib", "R.200.100.30.sop"), "soplib"), @@ -319,14 +320,13 @@ (os.path.join("soplib", "R.200.1000.15.sop"), "soplib"), (os.path.join("soplib", "R.200.1000.30.sop"), "soplib"), (os.path.join("soplib", "R.200.1000.60.sop"), "soplib")] - sequential_ordering_main = os.path.join( - "bazel-bin", - "examples", - "sequential_ordering_main") - for instance, instance_format in sequential_ordering_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_sequential_ordering") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "sequential_ordering", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -335,7 +335,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - sequential_ordering_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -356,7 +356,8 @@ print("-------------------------") print() - team_orienteering_data = [ + data_dir = os.environ['TEAM_ORIENTEERING_DATA'] + data = [ (os.path.join("chao1996", "Set_102_234", "p7.2.a.txt"), ""), (os.path.join("chao1996", "Set_102_234", "p7.2.b.txt"), ""), (os.path.join("chao1996", "Set_102_234", "p7.2.c.txt"), ""), @@ -366,14 +367,13 @@ (os.path.join("chao1996", "Set_102_234", "p7.4.i.txt"), ""), (os.path.join("chao1996", "Set_102_234", "p7.4.j.txt"), ""), (os.path.join("chao1996", "Set_102_234", "p7.4.k.txt"), "")] - team_orienteering_main = os.path.join( - "bazel-bin", - "examples", - "team_orienteering_main") - for instance, instance_format in team_orienteering_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_team_orienteering") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "team_orienteering", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -382,7 +382,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - team_orienteering_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -403,7 +403,8 @@ print("-----------------------------------") print() - time_dependent_orienteering_data = [ + data_dir = os.environ['TIME_DEPENDENT_ORIENTEERING_DATA'] + data = [ (os.path.join("verbeeck2014", "dataset 1", "OP_instances", "p1.1.a.txt"), ""), (os.path.join("verbeeck2014", "dataset 2", "OP_instances", "p2.1.a.txt"), ""), (os.path.join("verbeeck2014", "dataset 3", "OP_instances", "p3.1.a.txt"), ""), @@ -411,14 +412,13 @@ (os.path.join("verbeeck2014", "dataset 5", "OP_instances", "p5.1.a.txt"), ""), (os.path.join("verbeeck2014", "dataset 6", "OP_instances", "p6.1.a.txt"), ""), (os.path.join("verbeeck2014", "dataset 7", "OP_instances", "p7.1.a.txt"), "")] - time_dependent_orienteering_main = os.path.join( - "bazel-bin", - "examples", - "time_dependent_orienteering_main") - for instance, instance_format in time_dependent_orienteering_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_time_dependent_orienteering") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "time_dependent_orienteering", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -427,7 +427,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - time_dependent_orienteering_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" @@ -448,7 +448,8 @@ print("-----------------------------------------") print() - vehicle_routing_with_time_windows_data = [ + data_dir = os.environ['VEHICLE_ROUTING_WITH_TIME_WINDOWS_DATA'] + data = [ (os.path.join("solomon1987", "C101.txt"), ""), (os.path.join("solomon1987", "C102.txt"), ""), (os.path.join("solomon1987", "C103.txt"), ""), @@ -458,14 +459,13 @@ (os.path.join("solomon1987", "RC101.txt"), ""), (os.path.join("solomon1987", "RC102.txt"), ""), (os.path.join("solomon1987", "RC103.txt"), "")] - vehicle_routing_with_time_windows_main = os.path.join( - "bazel-bin", - "examples", - "vehicle_routing_with_time_windows_main") - for instance, instance_format in vehicle_routing_with_time_windows_data: + main = os.path.join( + "install", + "bin", + "localsearchsolver_vehicle_routing_with_time_windows") + for instance, instance_format in data: instance_path = os.path.join( - "data", - "vehicle_routing_with_time_windows", + data_dir, instance) json_output_path = os.path.join( args.directory, @@ -474,7 +474,7 @@ if not os.path.exists(os.path.dirname(json_output_path)): os.makedirs(os.path.dirname(json_output_path)) command = ( - vehicle_routing_with_time_windows_main + main + " --verbosity-level 1" + " --input \"" + instance_path + "\"" + " --format \"" + instance_format + "\"" diff --git a/scripts/run_tests_scheduling_with_sdst_twt.py b/scripts/run_tests_scheduling_with_sdst_twt.py deleted file mode 100644 index 37bde37..0000000 --- a/scripts/run_tests_scheduling_with_sdst_twt.py +++ /dev/null @@ -1,23 +0,0 @@ -import run_tests -import os - - -commands = run_tests.generate_commands( - os.path.join( - "bazel-bin", - "examples", - "scheduling_with_sdst_twt_main") - + " --algorithm best-first-local-search" - + " --maximum-number-of-nodes 1024", - os.path.join( - "..", - "ordata", - "scheduling", - "scheduling_with_sdst_twt", - "data.csv"), - os.path.join("test_results", "scheduling_with_sdst_twt")) - - -if __name__ == "__main__": - for command in commands: - run_tests.run(command) diff --git a/scripts/run_tests_team_orienteering.py b/scripts/run_tests_team_orienteering.py deleted file mode 100644 index 96a9534..0000000 --- a/scripts/run_tests_team_orienteering.py +++ /dev/null @@ -1,25 +0,0 @@ -import run_tests -import os - - -commands = run_tests.generate_commands( - os.path.join( - "bazel-bin", - "examples", - "team_orienteering_main") - + " --algorithm best-first-local-search" - + " --maximum-number-of-nodes 1024", - os.path.join( - "..", - "ordata", - "routing", - "team_orienteering", - "data.csv"), - os.path.join("test_results", "team_orienteering"), - "row['Dataset'] in" - " ['chao1996_4', 'chao1996_5', 'chao1996_6', 'chao1996_7']") - - -if __name__ == "__main__": - for command in commands: - run_tests.run(command) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..9809eaf --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,13 @@ +add_library(LocalSearchSolver_localsearchsolver) +target_sources(LocalSearchSolver_localsearchsolver PRIVATE + common.cpp) +target_include_directories(LocalSearchSolver_localsearchsolver PUBLIC + ${PROJECT_SOURCE_DIR}/include) +target_link_libraries(LocalSearchSolver_localsearchsolver PUBLIC + OptimizationTools::containers + OptimizationTools::utils) +add_library(LocalSearchSolver::localsearchsolver ALIAS LocalSearchSolver_localsearchsolver) +set_target_properties(LocalSearchSolver_localsearchsolver PROPERTIES OUTPUT_NAME "localsearchsolver") +install(TARGETS LocalSearchSolver_localsearchsolver) + +add_subdirectory(examples) diff --git a/localsearchsolver/common.cpp b/src/common.cpp similarity index 100% rename from localsearchsolver/common.cpp rename to src/common.cpp diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt new file mode 100644 index 0000000..971baa4 --- /dev/null +++ b/src/examples/CMakeLists.txt @@ -0,0 +1,347 @@ +add_library(LocalSearchSolver_read_args INTERFACE) +target_link_libraries(LocalSearchSolver_read_args INTERFACE + LocalSearchSolver_localsearchsolver) +target_include_directories(LocalSearchSolver_read_args INTERFACE + ${PROJECT_SOURCE_DIR}/include) + + +add_library(LocalSearchSolver_example_knapsack_with_conflicts INTERFACE) +target_link_libraries(LocalSearchSolver_example_knapsack_with_conflicts INTERFACE + LocalSearchSolver_read_args + ORProblems::knapsack_with_conflicts) +target_include_directories(LocalSearchSolver_example_knapsack_with_conflicts INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::knapsack_with_conflicts ALIAS LocalSearchSolver_example_knapsack_with_conflicts) + +add_executable(LocalSearchSolver_example_knapsack_with_conflicts_main) +target_sources(LocalSearchSolver_example_knapsack_with_conflicts_main PRIVATE + knapsack_with_conflicts_main.cpp) +target_link_libraries(LocalSearchSolver_example_knapsack_with_conflicts_main PUBLIC + LocalSearchSolver_example_knapsack_with_conflicts + Boost::program_options) +set_target_properties(LocalSearchSolver_example_knapsack_with_conflicts_main PROPERTIES OUTPUT_NAME "localsearchsolver_knapsack_with_conflicts") +install(TARGETS LocalSearchSolver_example_knapsack_with_conflicts_main) + + +add_library(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack INTERFACE) +target_link_libraries(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack INTERFACE + LocalSearchSolver_read_args + ORProblems::multidimensional_multiple_choice_knapsack) +target_include_directories(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::multidimensional_multiple_choice_knapsack ALIAS LocalSearchSolver_example_multidimensional_multiple_choice_knapsack) + +add_executable(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack_main) +target_sources(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack_main PRIVATE + multidimensional_multiple_choice_knapsack_main.cpp) +target_link_libraries(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack_main PUBLIC + LocalSearchSolver_example_multidimensional_multiple_choice_knapsack + Boost::program_options) +set_target_properties(LocalSearchSolver_example_multidimensional_multiple_choice_knapsack_main PROPERTIES OUTPUT_NAME "localsearchsolver_multidimensional_multiple_choice_knapsack") +install(TARGETS LocalSearchSolver_example_multidimensional_multiple_choice_knapsack_main) + + +add_library(LocalSearchSolver_example_quadratic_assignment INTERFACE) +target_link_libraries(LocalSearchSolver_example_quadratic_assignment INTERFACE + LocalSearchSolver_read_args + ORProblems::quadratic_assignment) +target_include_directories(LocalSearchSolver_example_quadratic_assignment INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::quadratic_assignment ALIAS LocalSearchSolver_example_quadratic_assignment) + +add_executable(LocalSearchSolver_example_quadratic_assignment_main) +target_sources(LocalSearchSolver_example_quadratic_assignment_main PRIVATE + quadratic_assignment_main.cpp) +target_link_libraries(LocalSearchSolver_example_quadratic_assignment_main PUBLIC + LocalSearchSolver_example_quadratic_assignment + Boost::program_options) +set_target_properties(LocalSearchSolver_example_quadratic_assignment_main PROPERTIES OUTPUT_NAME "localsearchsolver_quadratic_assignment") +install(TARGETS LocalSearchSolver_example_quadratic_assignment_main) + + +add_library(LocalSearchSolver_example_sequential_ordering INTERFACE) +target_link_libraries(LocalSearchSolver_example_sequential_ordering INTERFACE + LocalSearchSolver_read_args + ORProblems::sequential_ordering) +target_include_directories(LocalSearchSolver_example_sequential_ordering INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::sequential_ordering ALIAS LocalSearchSolver_example_sequential_ordering) + +add_executable(LocalSearchSolver_example_sequential_ordering_main) +target_sources(LocalSearchSolver_example_sequential_ordering_main PRIVATE + sequential_ordering_main.cpp) +target_link_libraries(LocalSearchSolver_example_sequential_ordering_main PUBLIC + LocalSearchSolver_example_sequential_ordering + Boost::program_options) +set_target_properties(LocalSearchSolver_example_sequential_ordering_main PROPERTIES OUTPUT_NAME "localsearchsolver_sequential_ordering") +install(TARGETS LocalSearchSolver_example_sequential_ordering_main) + + +add_library(LocalSearchSolver_example_scheduling_with_sdst_twt INTERFACE) +target_link_libraries(LocalSearchSolver_example_scheduling_with_sdst_twt INTERFACE + LocalSearchSolver_read_args + ORProblems::scheduling_with_sdst_twt) +target_include_directories(LocalSearchSolver_example_scheduling_with_sdst_twt INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::scheduling_with_sdst_twt ALIAS LocalSearchSolver_example_scheduling_with_sdst_twt) + +add_executable(LocalSearchSolver_example_scheduling_with_sdst_twt_main) +target_sources(LocalSearchSolver_example_scheduling_with_sdst_twt_main PRIVATE + scheduling_with_sdst_twt_main.cpp) +target_link_libraries(LocalSearchSolver_example_scheduling_with_sdst_twt_main PUBLIC + LocalSearchSolver_example_scheduling_with_sdst_twt + Boost::program_options) +set_target_properties(LocalSearchSolver_example_scheduling_with_sdst_twt_main PROPERTIES OUTPUT_NAME "localsearchsolver_scheduling_with_sdst_twt") +install(TARGETS LocalSearchSolver_example_scheduling_with_sdst_twt_main) + + +add_library(LocalSearchSolver_example_order_acceptance_and_scheduling INTERFACE) +target_link_libraries(LocalSearchSolver_example_order_acceptance_and_scheduling INTERFACE + LocalSearchSolver_read_args + ORProblems::order_acceptance_and_scheduling) +target_include_directories(LocalSearchSolver_example_order_acceptance_and_scheduling INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::order_acceptance_and_scheduling ALIAS LocalSearchSolver_example_order_acceptance_and_scheduling) + +add_executable(LocalSearchSolver_example_order_acceptance_and_scheduling_main) +target_sources(LocalSearchSolver_example_order_acceptance_and_scheduling_main PRIVATE + order_acceptance_and_scheduling_main.cpp) +target_link_libraries(LocalSearchSolver_example_order_acceptance_and_scheduling_main PUBLIC + LocalSearchSolver_example_order_acceptance_and_scheduling + Boost::program_options) +set_target_properties(LocalSearchSolver_example_order_acceptance_and_scheduling_main PROPERTIES OUTPUT_NAME "localsearchsolver_order_acceptance_and_scheduling") +install(TARGETS LocalSearchSolver_example_order_acceptance_and_scheduling_main) + + +add_library(LocalSearchSolver_example_job_sequencing_and_tool_switching INTERFACE) +target_link_libraries(LocalSearchSolver_example_job_sequencing_and_tool_switching INTERFACE + LocalSearchSolver_read_args + ORProblems::job_sequencing_and_tool_switching) +target_include_directories(LocalSearchSolver_example_job_sequencing_and_tool_switching INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::job_sequencing_and_tool_switching ALIAS LocalSearchSolver_example_job_sequencing_and_tool_switching) + +add_executable(LocalSearchSolver_example_job_sequencing_and_tool_switching_main) +target_sources(LocalSearchSolver_example_job_sequencing_and_tool_switching_main PRIVATE + job_sequencing_and_tool_switching_main.cpp) +target_link_libraries(LocalSearchSolver_example_job_sequencing_and_tool_switching_main PUBLIC + LocalSearchSolver_example_job_sequencing_and_tool_switching + Boost::program_options) +set_target_properties(LocalSearchSolver_example_job_sequencing_and_tool_switching_main PROPERTIES OUTPUT_NAME "localsearchsolver_job_sequencing_and_tool_switching") +install(TARGETS LocalSearchSolver_example_job_sequencing_and_tool_switching_main) + + +add_library(LocalSearchSolver_example_time_dependent_orienteering INTERFACE) +target_link_libraries(LocalSearchSolver_example_time_dependent_orienteering INTERFACE + LocalSearchSolver_read_args + ORProblems::time_dependent_orienteering) +target_include_directories(LocalSearchSolver_example_time_dependent_orienteering INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::time_dependent_orienteering ALIAS LocalSearchSolver_example_time_dependent_orienteering) + +add_executable(LocalSearchSolver_example_time_dependent_orienteering_main) +target_sources(LocalSearchSolver_example_time_dependent_orienteering_main PRIVATE + time_dependent_orienteering_main.cpp) +target_link_libraries(LocalSearchSolver_example_time_dependent_orienteering_main PUBLIC + LocalSearchSolver_example_time_dependent_orienteering + Boost::program_options) +set_target_properties(LocalSearchSolver_example_time_dependent_orienteering_main PROPERTIES OUTPUT_NAME "localsearchsolver_time_dependent_orienteering") +install(TARGETS LocalSearchSolver_example_time_dependent_orienteering_main) + + +add_library(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan INTERFACE) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan INTERFACE + LocalSearchSolver_read_args + ORProblems::permutation_flowshop_scheduling_makespan) +target_include_directories(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::permutation_flowshop_scheduling_makespan ALIAS LocalSearchSolver_example_permutation_flowshop_scheduling_makespan) + +add_executable(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan_main) +target_sources(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan_main PRIVATE + permutation_flowshop_scheduling_makespan_main.cpp) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan_main PUBLIC + LocalSearchSolver_example_permutation_flowshop_scheduling_makespan + Boost::program_options) +set_target_properties(LocalSearchSolver_example_permutation_flowshop_scheduling_makespan_main PROPERTIES OUTPUT_NAME "localsearchsolver_permutation_flowshop_scheduling_makespan") +install(TARGETS LocalSearchSolver_example_permutation_flowshop_scheduling_makespan_main) + + +add_library(LocalSearchSolver_example_permutation_flowshop_scheduling_tct INTERFACE) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_tct INTERFACE + LocalSearchSolver_read_args + ORProblems::permutation_flowshop_scheduling_tct) +target_include_directories(LocalSearchSolver_example_permutation_flowshop_scheduling_tct INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::permutation_flowshop_scheduling_tct ALIAS LocalSearchSolver_example_permutation_flowshop_scheduling_tct) + +add_executable(LocalSearchSolver_example_permutation_flowshop_scheduling_tct_main) +target_sources(LocalSearchSolver_example_permutation_flowshop_scheduling_tct_main PRIVATE + permutation_flowshop_scheduling_tct_main.cpp) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_tct_main PUBLIC + LocalSearchSolver_example_permutation_flowshop_scheduling_tct + Boost::program_options) +set_target_properties(LocalSearchSolver_example_permutation_flowshop_scheduling_tct_main PROPERTIES OUTPUT_NAME "localsearchsolver_permutation_flowshop_scheduling_tct") +install(TARGETS LocalSearchSolver_example_permutation_flowshop_scheduling_tct_main) + + +add_library(LocalSearchSolver_example_permutation_flowshop_scheduling_tt INTERFACE) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_tt INTERFACE + LocalSearchSolver_read_args + ORProblems::permutation_flowshop_scheduling_tt) +target_include_directories(LocalSearchSolver_example_permutation_flowshop_scheduling_tt INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::permutation_flowshop_scheduling_tt ALIAS LocalSearchSolver_example_permutation_flowshop_scheduling_tt) + +add_executable(LocalSearchSolver_example_permutation_flowshop_scheduling_tt_main) +target_sources(LocalSearchSolver_example_permutation_flowshop_scheduling_tt_main PRIVATE + permutation_flowshop_scheduling_tt_main.cpp) +target_link_libraries(LocalSearchSolver_example_permutation_flowshop_scheduling_tt_main PUBLIC + LocalSearchSolver_example_permutation_flowshop_scheduling_tt + Boost::program_options) +set_target_properties(LocalSearchSolver_example_permutation_flowshop_scheduling_tt_main PROPERTIES OUTPUT_NAME "localsearchsolver_permutation_flowshop_scheduling_tt") +install(TARGETS LocalSearchSolver_example_permutation_flowshop_scheduling_tt_main) + + +add_library(LocalSearchSolver_example_distributed_pfss_tct INTERFACE) +target_link_libraries(LocalSearchSolver_example_distributed_pfss_tct INTERFACE + LocalSearchSolver_read_args + ORProblems::distributed_pfss_tct) +target_include_directories(LocalSearchSolver_example_distributed_pfss_tct INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::distributed_pfss_tct ALIAS LocalSearchSolver_example_distributed_pfss_tct) + +add_executable(LocalSearchSolver_example_distributed_pfss_tct_main) +target_sources(LocalSearchSolver_example_distributed_pfss_tct_main PRIVATE + distributed_pfss_tct_main.cpp) +target_link_libraries(LocalSearchSolver_example_distributed_pfss_tct_main PUBLIC + LocalSearchSolver_example_distributed_pfss_tct + Boost::program_options) +set_target_properties(LocalSearchSolver_example_distributed_pfss_tct_main PROPERTIES OUTPUT_NAME "localsearchsolver_distributed_pfss_tct") +install(TARGETS LocalSearchSolver_example_distributed_pfss_tct_main) + + +add_library(LocalSearchSolver_example_traveling_repairman INTERFACE) +target_link_libraries(LocalSearchSolver_example_traveling_repairman INTERFACE + LocalSearchSolver_read_args + ORProblems::traveling_repairman) +target_include_directories(LocalSearchSolver_example_traveling_repairman INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::traveling_repairman ALIAS LocalSearchSolver_example_traveling_repairman) + +add_executable(LocalSearchSolver_example_traveling_repairman_main) +target_sources(LocalSearchSolver_example_traveling_repairman_main PRIVATE + traveling_repairman_main.cpp) +target_link_libraries(LocalSearchSolver_example_traveling_repairman_main PUBLIC + LocalSearchSolver_example_traveling_repairman + Boost::program_options) +set_target_properties(LocalSearchSolver_example_traveling_repairman_main PROPERTIES OUTPUT_NAME "localsearchsolver_traveling_repairman") +install(TARGETS LocalSearchSolver_example_traveling_repairman_main) + + +add_library(LocalSearchSolver_example_capacitated_vehicle_routing INTERFACE) +target_link_libraries(LocalSearchSolver_example_capacitated_vehicle_routing INTERFACE + LocalSearchSolver_read_args + ORProblems::capacitated_vehicle_routing) +target_include_directories(LocalSearchSolver_example_capacitated_vehicle_routing INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::capacitated_vehicle_routing ALIAS LocalSearchSolver_example_knapsack_with_conflicts) + +add_executable(LocalSearchSolver_example_capacitated_vehicle_routing_main) +target_sources(LocalSearchSolver_example_capacitated_vehicle_routing_main PRIVATE + capacitated_vehicle_routing_main.cpp) +target_link_libraries(LocalSearchSolver_example_capacitated_vehicle_routing_main PUBLIC + LocalSearchSolver_example_capacitated_vehicle_routing + Boost::program_options) +set_target_properties(LocalSearchSolver_example_capacitated_vehicle_routing_main PROPERTIES OUTPUT_NAME "localsearchsolver_capacitated_vehicle_routing") +install(TARGETS LocalSearchSolver_example_capacitated_vehicle_routing_main) + +add_executable(LocalSearchSolver_example_capacitated_vehicle_routing_dimacs_main) +target_sources(LocalSearchSolver_example_capacitated_vehicle_routing_dimacs_main PRIVATE + capacitated_vehicle_routing_dimacs_main.cpp) +target_link_libraries(LocalSearchSolver_example_capacitated_vehicle_routing_dimacs_main PUBLIC + LocalSearchSolver_example_capacitated_vehicle_routing + Boost::program_options) +set_target_properties(LocalSearchSolver_example_capacitated_vehicle_routing_dimacs_main PROPERTIES OUTPUT_NAME "localsearchsolver_capacitated_vehicle_routing_dimacs") +install(TARGETS LocalSearchSolver_example_capacitated_vehicle_routing_dimacs_main) + + +add_library(LocalSearchSolver_example_vehicle_routing_with_time_windows INTERFACE) +target_link_libraries(LocalSearchSolver_example_vehicle_routing_with_time_windows INTERFACE + LocalSearchSolver_read_args + ORProblems::vehicle_routing_with_time_windows) +target_include_directories(LocalSearchSolver_example_vehicle_routing_with_time_windows INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::vehicle_routing_with_time_windows ALIAS LocalSearchSolver_example_vehicle_routing_with_time_windows) + +add_executable(LocalSearchSolver_example_vehicle_routing_with_time_windows_main) +target_sources(LocalSearchSolver_example_vehicle_routing_with_time_windows_main PRIVATE + vehicle_routing_with_time_windows_main.cpp) +target_link_libraries(LocalSearchSolver_example_vehicle_routing_with_time_windows_main PUBLIC + LocalSearchSolver_example_vehicle_routing_with_time_windows + Boost::program_options) +set_target_properties(LocalSearchSolver_example_vehicle_routing_with_time_windows_main PROPERTIES OUTPUT_NAME "localsearchsolver_vehicle_routing_with_time_windows") +install(TARGETS LocalSearchSolver_example_vehicle_routing_with_time_windows_main) + +add_executable(LocalSearchSolver_example_vehicle_routing_with_time_windows_dimacs_main) +target_sources(LocalSearchSolver_example_vehicle_routing_with_time_windows_dimacs_main PRIVATE + vehicle_routing_with_time_windows_dimacs_main.cpp) +target_link_libraries(LocalSearchSolver_example_vehicle_routing_with_time_windows_dimacs_main PUBLIC + LocalSearchSolver_example_vehicle_routing_with_time_windows + Boost::program_options) +set_target_properties(LocalSearchSolver_example_vehicle_routing_with_time_windows_dimacs_main PROPERTIES OUTPUT_NAME "localsearchsolver_vehicle_routing_with_time_windows_dimacs") +install(TARGETS LocalSearchSolver_example_vehicle_routing_with_time_windows_dimacs_main) + + +add_library(LocalSearchSolver_example_team_orienteering INTERFACE) +target_link_libraries(LocalSearchSolver_example_team_orienteering INTERFACE + LocalSearchSolver_read_args + ORProblems::team_orienteering) +target_include_directories(LocalSearchSolver_example_team_orienteering INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::team_orienteering ALIAS LocalSearchSolver_example_team_orienteering) + +add_executable(LocalSearchSolver_example_team_orienteering_main) +target_sources(LocalSearchSolver_example_team_orienteering_main PRIVATE + team_orienteering_main.cpp) +target_link_libraries(LocalSearchSolver_example_team_orienteering_main PUBLIC + LocalSearchSolver_example_team_orienteering + Boost::program_options) +set_target_properties(LocalSearchSolver_example_team_orienteering_main PROPERTIES OUTPUT_NAME "localsearchsolver_team_orienteering") +install(TARGETS LocalSearchSolver_example_team_orienteering_main) + + +add_library(LocalSearchSolver_example_traveling_salesman_with_release_dates INTERFACE) +target_link_libraries(LocalSearchSolver_example_traveling_salesman_with_release_dates INTERFACE + LocalSearchSolver_read_args + ORProblems::traveling_salesman_with_release_dates) +target_include_directories(LocalSearchSolver_example_traveling_salesman_with_release_dates INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::traveling_salesman_with_release_dates ALIAS LocalSearchSolver_example_traveling_salesman_with_release_dates) + +add_executable(LocalSearchSolver_example_traveling_salesman_with_release_dates_main) +target_sources(LocalSearchSolver_example_traveling_salesman_with_release_dates_main PRIVATE + traveling_salesman_with_release_dates_main.cpp) +target_link_libraries(LocalSearchSolver_example_traveling_salesman_with_release_dates_main PUBLIC + LocalSearchSolver_example_traveling_salesman_with_release_dates + Boost::program_options) +set_target_properties(LocalSearchSolver_example_traveling_salesman_with_release_dates_main PROPERTIES OUTPUT_NAME "localsearchsolver_traveling_salesman_with_release_dates") +install(TARGETS LocalSearchSolver_example_traveling_salesman_with_release_dates_main) + + +add_library(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness INTERFACE) +target_link_libraries(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness INTERFACE + LocalSearchSolver_read_args + ORProblems::batch_scheduling_total_weighted_tardiness) +target_include_directories(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness INTERFACE + ${PROJECT_SOURCE_DIR}/include) +add_library(LocalSearchSolver::examples::batch_scheduling_total_weighted_tardiness ALIAS LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness) + +add_executable(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness_main) +target_sources(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness_main PRIVATE + batch_scheduling_total_weighted_tardiness_main.cpp) +target_link_libraries(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness_main PUBLIC + LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness + Boost::program_options) +set_target_properties(LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness_main PROPERTIES OUTPUT_NAME "localsearchsolver_batch_scheduling_total_weighted_tardiness") +install(TARGETS LocalSearchSolver_example_batch_scheduling_total_weighted_tardiness_main) diff --git a/examples/batch_scheduling_total_weighted_tardiness_main.cpp b/src/examples/batch_scheduling_total_weighted_tardiness_main.cpp similarity index 94% rename from examples/batch_scheduling_total_weighted_tardiness_main.cpp rename to src/examples/batch_scheduling_total_weighted_tardiness_main.cpp index 3c6548b..c7efe5e 100644 --- a/examples/batch_scheduling_total_weighted_tardiness_main.cpp +++ b/src/examples/batch_scheduling_total_weighted_tardiness_main.cpp @@ -1,5 +1,5 @@ -#include "examples/batch_scheduling_total_weighted_tardiness.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/batch_scheduling_total_weighted_tardiness.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace batch_scheduling_total_weighted_tardiness; diff --git a/examples/capacitated_vehicle_routing_dimacs_main.cpp b/src/examples/capacitated_vehicle_routing_dimacs_main.cpp similarity index 96% rename from examples/capacitated_vehicle_routing_dimacs_main.cpp rename to src/examples/capacitated_vehicle_routing_dimacs_main.cpp index 1dab670..0309477 100644 --- a/examples/capacitated_vehicle_routing_dimacs_main.cpp +++ b/src/examples/capacitated_vehicle_routing_dimacs_main.cpp @@ -1,4 +1,4 @@ -#include "examples/capacitated_vehicle_routing.hpp" +#include "localsearchsolver/examples/capacitated_vehicle_routing.hpp" #include "localsearchsolver/best_first_local_search.hpp" using namespace localsearchsolver; diff --git a/examples/capacitated_vehicle_routing_main.cpp b/src/examples/capacitated_vehicle_routing_main.cpp similarity index 96% rename from examples/capacitated_vehicle_routing_main.cpp rename to src/examples/capacitated_vehicle_routing_main.cpp index 04af21a..e5d5adc 100644 --- a/examples/capacitated_vehicle_routing_main.cpp +++ b/src/examples/capacitated_vehicle_routing_main.cpp @@ -1,5 +1,5 @@ -#include "examples/capacitated_vehicle_routing.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/capacitated_vehicle_routing.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace capacitated_vehicle_routing; diff --git a/examples/distributed_pfss_tct_main.cpp b/src/examples/distributed_pfss_tct_main.cpp similarity index 95% rename from examples/distributed_pfss_tct_main.cpp rename to src/examples/distributed_pfss_tct_main.cpp index d14afd9..1c4927e 100644 --- a/examples/distributed_pfss_tct_main.cpp +++ b/src/examples/distributed_pfss_tct_main.cpp @@ -1,5 +1,5 @@ -#include "examples/distributed_pfss_tct.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/distributed_pfss_tct.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace distributed_pfss_tct; diff --git a/examples/job_sequencing_and_tool_switching_main.cpp b/src/examples/job_sequencing_and_tool_switching_main.cpp similarity index 95% rename from examples/job_sequencing_and_tool_switching_main.cpp rename to src/examples/job_sequencing_and_tool_switching_main.cpp index 5d50d36..ec78869 100644 --- a/examples/job_sequencing_and_tool_switching_main.cpp +++ b/src/examples/job_sequencing_and_tool_switching_main.cpp @@ -1,5 +1,5 @@ -#include "examples/job_sequencing_and_tool_switching.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/job_sequencing_and_tool_switching.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace job_sequencing_and_tool_switching; diff --git a/examples/knapsack_with_conflicts_main.cpp b/src/examples/knapsack_with_conflicts_main.cpp similarity index 95% rename from examples/knapsack_with_conflicts_main.cpp rename to src/examples/knapsack_with_conflicts_main.cpp index 2e3852b..296f988 100644 --- a/examples/knapsack_with_conflicts_main.cpp +++ b/src/examples/knapsack_with_conflicts_main.cpp @@ -1,5 +1,5 @@ -#include "examples/knapsack_with_conflicts.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/knapsack_with_conflicts.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace knapsack_with_conflicts; diff --git a/examples/multidimensional_multiple_choice_knapsack_main.cpp b/src/examples/multidimensional_multiple_choice_knapsack_main.cpp similarity index 94% rename from examples/multidimensional_multiple_choice_knapsack_main.cpp rename to src/examples/multidimensional_multiple_choice_knapsack_main.cpp index e0a9c20..364c1b5 100644 --- a/examples/multidimensional_multiple_choice_knapsack_main.cpp +++ b/src/examples/multidimensional_multiple_choice_knapsack_main.cpp @@ -1,5 +1,5 @@ -#include "examples/multidimensional_multiple_choice_knapsack.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/multidimensional_multiple_choice_knapsack.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace multidimensional_multiple_choice_knapsack; diff --git a/examples/order_acceptance_and_scheduling_main.cpp b/src/examples/order_acceptance_and_scheduling_main.cpp similarity index 95% rename from examples/order_acceptance_and_scheduling_main.cpp rename to src/examples/order_acceptance_and_scheduling_main.cpp index 2ff7074..5da21bf 100644 --- a/examples/order_acceptance_and_scheduling_main.cpp +++ b/src/examples/order_acceptance_and_scheduling_main.cpp @@ -1,5 +1,5 @@ -#include "examples/order_acceptance_and_scheduling.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/order_acceptance_and_scheduling.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace order_acceptance_and_scheduling; diff --git a/examples/permutation_flowshop_scheduling_makespan_main.cpp b/src/examples/permutation_flowshop_scheduling_makespan_main.cpp similarity index 94% rename from examples/permutation_flowshop_scheduling_makespan_main.cpp rename to src/examples/permutation_flowshop_scheduling_makespan_main.cpp index 2975448..73b39f1 100644 --- a/examples/permutation_flowshop_scheduling_makespan_main.cpp +++ b/src/examples/permutation_flowshop_scheduling_makespan_main.cpp @@ -1,5 +1,5 @@ -#include "examples/permutation_flowshop_scheduling_makespan.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/permutation_flowshop_scheduling_makespan.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace permutation_flowshop_scheduling_makespan; diff --git a/examples/permutation_flowshop_scheduling_tct_main.cpp b/src/examples/permutation_flowshop_scheduling_tct_main.cpp similarity index 95% rename from examples/permutation_flowshop_scheduling_tct_main.cpp rename to src/examples/permutation_flowshop_scheduling_tct_main.cpp index 70a3faa..10adce2 100644 --- a/examples/permutation_flowshop_scheduling_tct_main.cpp +++ b/src/examples/permutation_flowshop_scheduling_tct_main.cpp @@ -1,5 +1,5 @@ -#include "examples/permutation_flowshop_scheduling_tct.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/permutation_flowshop_scheduling_tct.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace permutation_flowshop_scheduling_tct; diff --git a/examples/permutation_flowshop_scheduling_tt_main.cpp b/src/examples/permutation_flowshop_scheduling_tt_main.cpp similarity index 95% rename from examples/permutation_flowshop_scheduling_tt_main.cpp rename to src/examples/permutation_flowshop_scheduling_tt_main.cpp index 38e63b7..42d4465 100644 --- a/examples/permutation_flowshop_scheduling_tt_main.cpp +++ b/src/examples/permutation_flowshop_scheduling_tt_main.cpp @@ -1,5 +1,5 @@ -#include "examples/permutation_flowshop_scheduling_tt.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/permutation_flowshop_scheduling_tt.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace permutation_flowshop_scheduling_tt; diff --git a/examples/quadratic_assignment_main.cpp b/src/examples/quadratic_assignment_main.cpp similarity index 95% rename from examples/quadratic_assignment_main.cpp rename to src/examples/quadratic_assignment_main.cpp index 348ff8c..3309396 100644 --- a/examples/quadratic_assignment_main.cpp +++ b/src/examples/quadratic_assignment_main.cpp @@ -1,5 +1,5 @@ -#include "examples/quadratic_assignment.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/quadratic_assignment.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace quadratic_assignment; diff --git a/localsearchsolver/read_args.hpp b/src/examples/read_args.hpp similarity index 100% rename from localsearchsolver/read_args.hpp rename to src/examples/read_args.hpp diff --git a/examples/scheduling_with_sdst_twt_main.cpp b/src/examples/scheduling_with_sdst_twt_main.cpp similarity index 95% rename from examples/scheduling_with_sdst_twt_main.cpp rename to src/examples/scheduling_with_sdst_twt_main.cpp index 39d1adb..79a45ea 100644 --- a/examples/scheduling_with_sdst_twt_main.cpp +++ b/src/examples/scheduling_with_sdst_twt_main.cpp @@ -1,5 +1,5 @@ -#include "examples/scheduling_with_sdst_twt.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/scheduling_with_sdst_twt.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace scheduling_with_sdst_twt; diff --git a/examples/sequential_ordering_main.cpp b/src/examples/sequential_ordering_main.cpp similarity index 95% rename from examples/sequential_ordering_main.cpp rename to src/examples/sequential_ordering_main.cpp index bb5c60c..2906d4a 100644 --- a/examples/sequential_ordering_main.cpp +++ b/src/examples/sequential_ordering_main.cpp @@ -1,5 +1,5 @@ -#include "examples/sequential_ordering.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/sequential_ordering.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace sequential_ordering; diff --git a/examples/team_orienteering_main.cpp b/src/examples/team_orienteering_main.cpp similarity index 95% rename from examples/team_orienteering_main.cpp rename to src/examples/team_orienteering_main.cpp index bb20674..f5c26df 100644 --- a/examples/team_orienteering_main.cpp +++ b/src/examples/team_orienteering_main.cpp @@ -1,5 +1,5 @@ -#include "examples/team_orienteering.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/team_orienteering.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace team_orienteering; diff --git a/examples/time_dependent_orienteering_main.cpp b/src/examples/time_dependent_orienteering_main.cpp similarity index 95% rename from examples/time_dependent_orienteering_main.cpp rename to src/examples/time_dependent_orienteering_main.cpp index 3064d9c..cffb838 100644 --- a/examples/time_dependent_orienteering_main.cpp +++ b/src/examples/time_dependent_orienteering_main.cpp @@ -1,5 +1,5 @@ -#include "examples/time_dependent_orienteering.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/time_dependent_orienteering.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace time_dependent_orienteering; diff --git a/examples/traveling_repairman_main.cpp b/src/examples/traveling_repairman_main.cpp similarity index 95% rename from examples/traveling_repairman_main.cpp rename to src/examples/traveling_repairman_main.cpp index 99cebc8..7f47d02 100644 --- a/examples/traveling_repairman_main.cpp +++ b/src/examples/traveling_repairman_main.cpp @@ -1,5 +1,5 @@ -#include "examples/traveling_repairman.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/traveling_repairman.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace traveling_repairman; diff --git a/examples/traveling_salesman_with_release_dates_main.cpp b/src/examples/traveling_salesman_with_release_dates_main.cpp similarity index 95% rename from examples/traveling_salesman_with_release_dates_main.cpp rename to src/examples/traveling_salesman_with_release_dates_main.cpp index ae7b278..d3a0194 100644 --- a/examples/traveling_salesman_with_release_dates_main.cpp +++ b/src/examples/traveling_salesman_with_release_dates_main.cpp @@ -1,5 +1,5 @@ -#include "examples/traveling_salesman_with_release_dates.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/traveling_salesman_with_release_dates.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace traveling_salesman_with_release_dates; diff --git a/examples/variables.bzl b/src/examples/variables.bzl similarity index 100% rename from examples/variables.bzl rename to src/examples/variables.bzl diff --git a/examples/vehicle_routing_with_time_windows_dimacs_main.cpp b/src/examples/vehicle_routing_with_time_windows_dimacs_main.cpp similarity index 96% rename from examples/vehicle_routing_with_time_windows_dimacs_main.cpp rename to src/examples/vehicle_routing_with_time_windows_dimacs_main.cpp index 918942b..7f3aeb6 100644 --- a/examples/vehicle_routing_with_time_windows_dimacs_main.cpp +++ b/src/examples/vehicle_routing_with_time_windows_dimacs_main.cpp @@ -1,4 +1,4 @@ -#include "examples/vehicle_routing_with_time_windows.hpp" +#include "localsearchsolver/examples/vehicle_routing_with_time_windows.hpp" #include "localsearchsolver/best_first_local_search.hpp" using namespace localsearchsolver; diff --git a/examples/vehicle_routing_with_time_windows_main.cpp b/src/examples/vehicle_routing_with_time_windows_main.cpp similarity index 95% rename from examples/vehicle_routing_with_time_windows_main.cpp rename to src/examples/vehicle_routing_with_time_windows_main.cpp index 9133387..7b8485c 100644 --- a/examples/vehicle_routing_with_time_windows_main.cpp +++ b/src/examples/vehicle_routing_with_time_windows_main.cpp @@ -1,5 +1,5 @@ -#include "examples/vehicle_routing_with_time_windows.hpp" -#include "localsearchsolver/read_args.hpp" +#include "localsearchsolver/examples/vehicle_routing_with_time_windows.hpp" +#include "read_args.hpp" using namespace localsearchsolver; using namespace vehicle_routing_with_time_windows; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..e69de29