or-tools 0.14.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/ext/or-tools/extconf.rb +2 -5
- data/ext/or-tools/routing.cpp +11 -18
- data/ext/or-tools/vendor.rb +16 -21
- data/lib/or_tools/routing_model.rb +0 -4
- data/lib/or_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea0dcf083694be566f08e7c531e3bbd7cd817fb454c6590a1edff5411e58b9c7
|
4
|
+
data.tar.gz: 334369dda3337181b10722f96a52211a079f29409e709a8bfd6685a3d9100916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/ext/or-tools/extconf.rb
CHANGED
@@ -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
|
-
#
|
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")
|
data/ext/or-tools/routing.cpp
CHANGED
@@ -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
|
-
"
|
350
|
+
"pickup_position",
|
350
351
|
[](RoutingModel& self, int64_t node_index) {
|
351
|
-
|
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
|
-
"
|
355
|
+
"delivery_position",
|
359
356
|
[](RoutingModel& self, int64_t node_index) {
|
360
|
-
|
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 ==
|
399
|
+
if (status == RoutingSearchStatus::ROUTING_NOT_SOLVED) {
|
407
400
|
return Symbol("not_solved");
|
408
|
-
} else if (status ==
|
401
|
+
} else if (status == RoutingSearchStatus::ROUTING_SUCCESS) {
|
409
402
|
return Symbol("success");
|
410
|
-
} else if (status ==
|
403
|
+
} else if (status == RoutingSearchStatus::ROUTING_FAIL) {
|
411
404
|
return Symbol("fail");
|
412
|
-
} else if (status ==
|
405
|
+
} else if (status == RoutingSearchStatus::ROUTING_FAIL_TIMEOUT) {
|
413
406
|
return Symbol("fail_timeout");
|
414
|
-
} else if (status ==
|
407
|
+
} else if (status == RoutingSearchStatus::ROUTING_INVALID) {
|
415
408
|
return Symbol("invalid");
|
416
409
|
} else {
|
417
410
|
throw std::runtime_error("Unknown solver status");
|
data/ext/or-tools/vendor.rb
CHANGED
@@ -3,18 +3,18 @@ require "fileutils"
|
|
3
3
|
require "net/http"
|
4
4
|
require "tmpdir"
|
5
5
|
|
6
|
-
version = "9.
|
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
|
-
checksum = "
|
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-
|
17
|
-
checksum = "
|
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 = "
|
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 = "
|
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 = "
|
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 = "
|
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 = "
|
44
|
+
checksum = "911143f50fe013fbd50d0dce460512106596adfc0f2ad9a2bc8afd218531bde4"
|
45
45
|
elsif os == "arch" && !arm
|
46
46
|
filename = "or-tools_amd64_archlinux_cpp_v#{version}.tar.gz"
|
47
|
-
checksum = "
|
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.
|
135
|
+
FileUtils.mv(File.join(extract_path, file), File.join(path, file))
|
136
136
|
end
|
137
137
|
|
138
138
|
# include
|
139
|
-
FileUtils.
|
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/
|
144
|
-
|
145
|
-
FileUtils.
|
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
|
data/lib/or_tools/version.rb
CHANGED
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.
|
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
|
+
date: 2025-02-17 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rice
|