or-tools 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2974585825c8e1f3d50aabc494131861eef79c80468a889537f58b2dd3926be
4
- data.tar.gz: 5f9b8fe4574a30ebea1fba0b53a91475683e68fe5e535ba99047a6f2b3a16173
3
+ metadata.gz: ea0dcf083694be566f08e7c531e3bbd7cd817fb454c6590a1edff5411e58b9c7
4
+ data.tar.gz: 334369dda3337181b10722f96a52211a079f29409e709a8bfd6685a3d9100916
5
5
  SHA512:
6
- metadata.gz: 48fc84cebe3a922044a98909dd8b06d61712ea1bdf06014b99a0a92dd4406766facd99cd3f2c99425257642ef08ad5a489d9ee87f354cf7f5d16a3d7ff306d5e
7
- data.tar.gz: 6edc981eb8b47f716f607be3e7c28a59c49076810a7fcbda7077fcc3a1abcf420fe58c17d372a40447f435e7abfd68879fc471b0c8c86afdd4d1610786b0489e
6
+ metadata.gz: 2d8956c463c473ceabe4803f23076d8c96617a4abbd64b7bc2873492bd9e41eed50929567ae71acdf42ea42c8bbbaf4716b132f27eae56cb307f311692444fa3
7
+ data.tar.gz: 4ca6955eb037764eae4fc99861b904298c9bb519bc5ff2a19d5709f24f2f1e3de72f3827a953c90f9e006bc5122dc122ff51ece505784b5b3db49d5a0aaa8a5e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.15.0 (2025-02-17)
2
+
3
+ - Updated OR-Tools to 9.12
4
+ - Removed `pickup_positions` and `pickup_index_pairs` (use `pickup_position` instead)
5
+ - Removed `delivery_positions` and `delivery_index_pairs` (use `delivery_position` instead)
6
+
1
7
  ## 0.14.2 (2025-02-10)
2
8
 
3
9
  - Fixed error with Rice 4.5
@@ -1,6 +1,6 @@
1
1
  require "mkmf-rice"
2
2
 
3
- $CXXFLAGS << " -std=c++17 $(optflags) -DUSE_CBC"
3
+ $CXXFLAGS << " -std=c++17 $(optflags) -DUSE_CBC -DOR_PROTO_DLL="
4
4
 
5
5
  # show warnings
6
6
  $CXXFLAGS << " -Wall -Wextra"
@@ -32,10 +32,7 @@ end
32
32
  # find_header and find_library first check without adding path
33
33
  # which can cause them to find system library
34
34
  $INCFLAGS << " -I#{inc}"
35
- # could support shared libraries for protobuf and abseil
36
- # but keep simple for now
37
- raise "libprotobuf.a not found" unless File.exist?("#{lib}/libprotobuf.a")
38
- $LDFLAGS.prepend("-Wl,-rpath,#{rpath} -L#{lib} #{lib}/libprotobuf.a ")
35
+ $LDFLAGS.prepend("-Wl,-rpath,#{rpath} -L#{lib} ")
39
36
  raise "OR-Tools not found" unless have_library("ortools")
40
37
 
41
38
  create_makefile("or_tools/ext")
@@ -15,6 +15,7 @@ using operations_research::RoutingModel;
15
15
  using operations_research::RoutingModelParameters;
16
16
  using operations_research::RoutingNodeIndex;
17
17
  using operations_research::RoutingSearchParameters;
18
+ using operations_research::RoutingSearchStatus;
18
19
 
19
20
  using Rice::Array;
20
21
  using Rice::Class;
@@ -331,7 +332,7 @@ void init_routing(Rice::Module& m) {
331
332
  .define_method("add_resource_group", &RoutingModel::AddResourceGroup)
332
333
  .define_method("dimension_resource_group_indices", &RoutingModel::GetDimensionResourceGroupIndices)
333
334
  .define_method("dimension_resource_group_index", &RoutingModel::GetDimensionResourceGroupIndex)
334
- .define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = (int64_t)1)
335
+ .define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = (int64_t)1, Rice::Arg("_penalty_cost_behavior") = RoutingModel::PenaltyCostBehavior::PENALIZE_ONCE)
335
336
  .define_method("disjunction_indices", &RoutingModel::GetDisjunctionIndices)
336
337
  .define_method("disjunction_penalty", &RoutingModel::GetDisjunctionPenalty)
337
338
  .define_method("disjunction_max_cardinality", &RoutingModel::GetDisjunctionMaxCardinality)
@@ -346,22 +347,14 @@ void init_routing(Rice::Module& m) {
346
347
  .define_method("add_pickup_and_delivery", &RoutingModel::AddPickupAndDelivery)
347
348
  .define_method("add_pickup_and_delivery_sets", &RoutingModel::AddPickupAndDeliverySets)
348
349
  .define_method(
349
- "pickup_positions",
350
+ "pickup_position",
350
351
  [](RoutingModel& self, int64_t node_index) {
351
- std::vector<std::pair<int, int>> positions;
352
- for (const auto& v : self.GetPickupPositions(node_index)) {
353
- positions.emplace_back(v.pd_pair_index, v.alternative_index);
354
- }
355
- return positions;
352
+ return self.GetPickupPosition(node_index);
356
353
  })
357
354
  .define_method(
358
- "delivery_positions",
355
+ "delivery_position",
359
356
  [](RoutingModel& self, int64_t node_index) {
360
- std::vector<std::pair<int, int>> positions;
361
- for (const auto& v : self.GetDeliveryPositions(node_index)) {
362
- positions.emplace_back(v.pd_pair_index, v.alternative_index);
363
- }
364
- return positions;
357
+ return self.GetDeliveryPosition(node_index);
365
358
  })
366
359
  .define_method("num_of_singleton_nodes", &RoutingModel::GetNumOfSingletonNodes)
367
360
  .define_method("unperformed_penalty", &RoutingModel::UnperformedPenalty)
@@ -403,15 +396,15 @@ void init_routing(Rice::Module& m) {
403
396
  [](RoutingModel& self) {
404
397
  auto status = self.status();
405
398
 
406
- if (status == RoutingModel::ROUTING_NOT_SOLVED) {
399
+ if (status == RoutingSearchStatus::ROUTING_NOT_SOLVED) {
407
400
  return Symbol("not_solved");
408
- } else if (status == RoutingModel::ROUTING_SUCCESS) {
401
+ } else if (status == RoutingSearchStatus::ROUTING_SUCCESS) {
409
402
  return Symbol("success");
410
- } else if (status == RoutingModel::ROUTING_FAIL) {
403
+ } else if (status == RoutingSearchStatus::ROUTING_FAIL) {
411
404
  return Symbol("fail");
412
- } else if (status == RoutingModel::ROUTING_FAIL_TIMEOUT) {
405
+ } else if (status == RoutingSearchStatus::ROUTING_FAIL_TIMEOUT) {
413
406
  return Symbol("fail_timeout");
414
- } else if (status == RoutingModel::ROUTING_INVALID) {
407
+ } else if (status == RoutingSearchStatus::ROUTING_INVALID) {
415
408
  return Symbol("invalid");
416
409
  } else {
417
410
  throw std::runtime_error("Unknown solver status");
@@ -3,18 +3,18 @@ require "fileutils"
3
3
  require "net/http"
4
4
  require "tmpdir"
5
5
 
6
- version = "9.11.4210"
6
+ version = "9.12.4544"
7
7
 
8
8
  arch = RbConfig::CONFIG["host_cpu"]
9
9
  arm = arch.match?(/arm|aarch64/i)
10
10
 
11
11
  if RbConfig::CONFIG["host_os"].match?(/darwin/i)
12
12
  if arm
13
- filename = "or-tools_arm64_macOS-14.6.1_cpp_v#{version}.tar.gz"
14
- checksum = "a106668eb1975c1672874ef24b4f8e2e56669467a63349e5ea8ef5419814c31b"
13
+ filename = "or-tools_arm64_macOS-15.3.1_cpp_v#{version}.tar.gz"
14
+ checksum = "02f89e54bd8d86e6e069f843aeed10a444ff329052e5a7fd732c5e4ec4f845fb"
15
15
  else
16
- filename = "or-tools_x86_64_macOS-14.6.1_cpp_v#{version}.tar.gz"
17
- checksum = "cc87a7f8c68ec4fed6c6de6565b0b625f2f0047185a8a4449ef4b5a305b60e55"
16
+ filename = "or-tools_x86_64_macOS-15.3.1_cpp_v#{version}.tar.gz"
17
+ checksum = "515af60e73e7fa620bab7f4a7d60b9069075d814453d91906aa39993d714f28d"
18
18
  end
19
19
  else
20
20
  # try /etc/os-release with fallback to /usr/lib/os-release
@@ -29,22 +29,22 @@ else
29
29
 
30
30
  if os == "ubuntu" && os_version == "24.04" && !arm
31
31
  filename = "or-tools_amd64_ubuntu-24.04_cpp_v#{version}.tar.gz"
32
- checksum = "71761d93171b111fca736647a6cd00cb9e606474df597a8b48f3f5f2c73d4c0f"
32
+ checksum = "71128e095024707bf9835faf4558cbe34acb79345e899bd532f3008a493a8970"
33
33
  elsif os == "ubuntu" && os_version == "22.04" && !arm
34
34
  filename = "or-tools_amd64_ubuntu-22.04_cpp_v#{version}.tar.gz"
35
- checksum = "f613574d4eae01afd966c8bde199990cbd9fad46035e675d71f17f5c7477eed4"
35
+ checksum = "cb42ea7d7799a01fea7cdaafacbdfc67180d85f39532c6d2a8c4cfb419bd07ed"
36
36
  elsif os == "ubuntu" && os_version == "20.04" && !arm
37
37
  filename = "or-tools_amd64_ubuntu-20.04_cpp_v#{version}.tar.gz"
38
- checksum = "190b85f4510cab55fcb50b9850a0e2f94b2bdf5e266580650efbc5aaab760683"
38
+ checksum = "ea51589fe80bd9cd4fb6203bd1e956b311cdb1d21bbd14f7b6dad75c81d3583c"
39
39
  elsif os == "debian" && os_version == "11" && !arm
40
40
  filename = "or-tools_amd64_debian-11_cpp_v#{version}.tar.gz"
41
- checksum = "a8354696f365aa13a2375da5f8f6cfd8785430681addcd887bfd194851dd4710"
41
+ checksum = "dcee63b726569bd99c134e0e920173f955feae5856c3370a0bed03fdc995af50"
42
42
  elsif os == "debian" && os_version == "12" && !arm
43
43
  filename = "or-tools_amd64_debian-12_cpp_v#{version}.tar.gz"
44
- checksum = "9fda332f2f9d3b5647d85dd65de145ea3e2a1543714bf588f82da8ec57721cbf"
44
+ checksum = "911143f50fe013fbd50d0dce460512106596adfc0f2ad9a2bc8afd218531bde4"
45
45
  elsif os == "arch" && !arm
46
46
  filename = "or-tools_amd64_archlinux_cpp_v#{version}.tar.gz"
47
- checksum = "ac892a949d871294b7e26b0730440ab8629b4021bf3c1641bc7c8fb09b45081f"
47
+ checksum = "18c1d929e2144e9d9602659ea2fa790bd2a150f72c32c38a97f571839816d132"
48
48
  else
49
49
  platform =
50
50
  if Gem.win_platform?
@@ -132,22 +132,17 @@ Dir.mktmpdir do |extract_path|
132
132
  raise "License not found" unless license_files.any?
133
133
  license_files.each do |file|
134
134
  FileUtils.mkdir_p(File.join(path, File.dirname(file)))
135
- FileUtils.cp(File.join(extract_path, file), File.join(path, file))
135
+ FileUtils.mv(File.join(extract_path, file), File.join(path, file))
136
136
  end
137
137
 
138
138
  # include
139
- FileUtils.cp_r(File.join(extract_path, "include"), File.join(path, "include"))
139
+ FileUtils.mv(File.join(extract_path, "include"), File.join(path, "include"))
140
140
 
141
141
  # shared library
142
142
  FileUtils.mkdir(File.join(path, "lib"))
143
- Dir.glob("lib/libortools.{9.dylib,so.9}", base: extract_path) do |file|
144
- so_path = File.join(path, file)
145
- FileUtils.cp(File.join(extract_path, file), so_path)
146
- ext = file.end_with?(".dylib") ? "dylib" : "so"
147
- File.symlink(so_path, File.join(path, "lib/libortools.#{ext}"))
148
- end
149
- ["lib/libprotobuf.a"].each do |file|
150
- FileUtils.cp(File.join(extract_path, file), File.join(path, file))
143
+ Dir.glob("lib/lib*{.dylib,.so,.so.*}", base: extract_path) do |file|
144
+ next if file.include?("libprotoc.")
145
+ FileUtils.mv(File.join(extract_path, file), File.join(path, file))
151
146
  end
152
147
  end
153
148
 
@@ -13,9 +13,5 @@ module ORTools
13
13
  search_parameters.log_search = log_search unless log_search.nil?
14
14
  solve_with_parameters(search_parameters)
15
15
  end
16
-
17
- # previous names
18
- alias_method :pickup_index_pairs, :pickup_positions
19
- alias_method :delivery_index_pairs, :delivery_positions
20
16
  end
21
17
  end
@@ -1,3 +1,3 @@
1
1
  module ORTools
2
- VERSION = "0.14.2"
2
+ VERSION = "0.15.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: or-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-10 00:00:00.000000000 Z
10
+ date: 2025-02-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rice