or-tools 0.14.2 → 0.15.1
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/NOTICE.txt +2 -2
- data/ext/or-tools/assignment.cpp +2 -2
- data/ext/or-tools/bin_packing.cpp +10 -11
- data/ext/or-tools/constraint.cpp +10 -11
- data/ext/or-tools/ext.cpp +3 -4
- data/ext/or-tools/extconf.rb +2 -5
- data/ext/or-tools/linear.cpp +10 -11
- data/ext/or-tools/math_opt.cpp +13 -15
- data/ext/or-tools/network_flows.cpp +4 -2
- data/ext/or-tools/routing.cpp +28 -34
- data/ext/or-tools/vendor.rb +16 -21
- data/lib/or_tools/routing_model.rb +8 -8
- data/lib/or_tools/version.rb +1 -1
- metadata +5 -6
- data/ext/or-tools/ext.h +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf6aeeb8a03deeb23478d655a7844b3e49115252fd8ad5cc7285074370580952
|
4
|
+
data.tar.gz: 67db36ddc806b7a2695ea89c9bb2dc3969161df739059e186aed6d67506c4348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65d8e93c059aa9df5501d8db5252279ede1b85601785663ff0ff41a9e1b5555976c5b9a4304ebfe557d9e9e7802ba30635644b8b857c219e4c925db4d18d8e24
|
7
|
+
data.tar.gz: 3a76c22bc257260861751d79a79cb94f880c4d8f5c82ab7b00d249da586ef05283c031f8517ca77621848b0e0fdc6993e1c81ac9f116d2cae50073dd25177109
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.15.1 (2025-06-18)
|
2
|
+
|
3
|
+
- Fixed error with Rice 4.6
|
4
|
+
|
5
|
+
## 0.15.0 (2025-02-17)
|
6
|
+
|
7
|
+
- Updated OR-Tools to 9.12
|
8
|
+
- Removed `pickup_positions` and `pickup_index_pairs` (use `pickup_position` instead)
|
9
|
+
- Removed `delivery_positions` and `delivery_index_pairs` (use `delivery_position` instead)
|
10
|
+
|
1
11
|
## 0.14.2 (2025-02-10)
|
2
12
|
|
3
13
|
- Fixed error with Rice 4.5
|
data/NOTICE.txt
CHANGED
data/ext/or-tools/assignment.cpp
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
#include <
|
1
|
+
#include <string>
|
2
|
+
#include <vector>
|
2
3
|
|
3
|
-
#include
|
4
|
+
#include <ortools/algorithms/knapsack_solver.h>
|
5
|
+
#include <rice/rice.hpp>
|
6
|
+
#include <rice/stl.hpp>
|
4
7
|
|
5
8
|
using operations_research::KnapsackSolver;
|
6
9
|
|
@@ -8,22 +11,18 @@ using Rice::Array;
|
|
8
11
|
using Rice::Object;
|
9
12
|
using Rice::Symbol;
|
10
13
|
|
11
|
-
namespace Rice::detail
|
12
|
-
{
|
14
|
+
namespace Rice::detail {
|
13
15
|
template<>
|
14
|
-
struct Type<KnapsackSolver::SolverType>
|
15
|
-
{
|
16
|
+
struct Type<KnapsackSolver::SolverType> {
|
16
17
|
static bool verify() { return true; }
|
17
18
|
};
|
18
19
|
|
19
20
|
template<>
|
20
|
-
class From_Ruby<KnapsackSolver::SolverType>
|
21
|
-
{
|
21
|
+
class From_Ruby<KnapsackSolver::SolverType> {
|
22
22
|
public:
|
23
23
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
24
24
|
|
25
|
-
KnapsackSolver::SolverType convert(VALUE x)
|
26
|
-
{
|
25
|
+
KnapsackSolver::SolverType convert(VALUE x) {
|
27
26
|
auto s = Symbol(x).str();
|
28
27
|
if (s == "branch_and_bound") {
|
29
28
|
return KnapsackSolver::KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER;
|
@@ -32,7 +31,7 @@ namespace Rice::detail
|
|
32
31
|
}
|
33
32
|
}
|
34
33
|
};
|
35
|
-
}
|
34
|
+
} // namespace Rice::detail
|
36
35
|
|
37
36
|
void init_bin_packing(Rice::Module& m) {
|
38
37
|
Rice::define_class_under<KnapsackSolver>(m, "KnapsackSolver")
|
data/ext/or-tools/constraint.cpp
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
#include <string>
|
2
|
+
#include <vector>
|
3
|
+
|
1
4
|
#include <google/protobuf/text_format.h>
|
2
5
|
#include <ortools/sat/cp_model.h>
|
3
|
-
|
4
|
-
#include
|
6
|
+
#include <rice/rice.hpp>
|
7
|
+
#include <rice/stl.hpp>
|
5
8
|
|
6
9
|
using operations_research::Domain;
|
7
10
|
using operations_research::sat::BoolVar;
|
@@ -27,22 +30,18 @@ using Rice::Symbol;
|
|
27
30
|
Class rb_cBoolVar;
|
28
31
|
Class rb_cSatIntVar;
|
29
32
|
|
30
|
-
namespace Rice::detail
|
31
|
-
{
|
33
|
+
namespace Rice::detail {
|
32
34
|
template<>
|
33
|
-
struct Type<LinearExpr>
|
34
|
-
{
|
35
|
+
struct Type<LinearExpr> {
|
35
36
|
static bool verify() { return true; }
|
36
37
|
};
|
37
38
|
|
38
39
|
template<>
|
39
|
-
class From_Ruby<LinearExpr>
|
40
|
-
{
|
40
|
+
class From_Ruby<LinearExpr> {
|
41
41
|
public:
|
42
42
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
43
43
|
|
44
|
-
LinearExpr convert(VALUE v)
|
45
|
-
{
|
44
|
+
LinearExpr convert(VALUE v) {
|
46
45
|
LinearExpr expr;
|
47
46
|
|
48
47
|
Rice::Object utils = Rice::define_module("ORTools").const_get("Utils");
|
@@ -64,7 +63,7 @@ namespace Rice::detail
|
|
64
63
|
return expr;
|
65
64
|
}
|
66
65
|
};
|
67
|
-
}
|
66
|
+
} // namespace Rice::detail
|
68
67
|
|
69
68
|
void init_constraint(Rice::Module& m) {
|
70
69
|
Rice::define_class_under<Domain>(m, "Domain")
|
data/ext/or-tools/ext.cpp
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#include <ortools/base/version.h>
|
2
2
|
#include <ortools/init/init.h>
|
3
|
-
|
4
|
-
#include
|
3
|
+
#include <rice/rice.hpp>
|
4
|
+
#include <rice/stl.hpp>
|
5
5
|
|
6
6
|
using operations_research::CppBridge;
|
7
7
|
using operations_research::CppFlags;
|
@@ -15,8 +15,7 @@ void init_network_flows(Rice::Module& m);
|
|
15
15
|
void init_routing(Rice::Module& m);
|
16
16
|
|
17
17
|
extern "C"
|
18
|
-
void Init_ext()
|
19
|
-
{
|
18
|
+
void Init_ext() {
|
20
19
|
auto m = Rice::define_module("ORTools");
|
21
20
|
|
22
21
|
m.define_singleton_function("lib_version", &operations_research::OrToolsVersionString);
|
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/linear.cpp
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
#include <
|
1
|
+
#include <memory>
|
2
|
+
#include <string>
|
2
3
|
|
3
|
-
#include
|
4
|
+
#include <ortools/linear_solver/linear_solver.h>
|
5
|
+
#include <rice/rice.hpp>
|
6
|
+
#include <rice/stl.hpp>
|
4
7
|
|
5
8
|
using operations_research::MPConstraint;
|
6
9
|
using operations_research::MPObjective;
|
@@ -15,21 +18,17 @@ using Rice::Object;
|
|
15
18
|
using Rice::String;
|
16
19
|
using Rice::Symbol;
|
17
20
|
|
18
|
-
namespace Rice::detail
|
19
|
-
{
|
21
|
+
namespace Rice::detail {
|
20
22
|
template<>
|
21
|
-
struct Type<MPSolver::OptimizationProblemType>
|
22
|
-
{
|
23
|
+
struct Type<MPSolver::OptimizationProblemType> {
|
23
24
|
static bool verify() { return true; }
|
24
25
|
};
|
25
26
|
|
26
27
|
template<>
|
27
|
-
struct From_Ruby<MPSolver::OptimizationProblemType>
|
28
|
-
{
|
28
|
+
struct From_Ruby<MPSolver::OptimizationProblemType> {
|
29
29
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
30
30
|
|
31
|
-
static MPSolver::OptimizationProblemType convert(VALUE x)
|
32
|
-
{
|
31
|
+
static MPSolver::OptimizationProblemType convert(VALUE x) {
|
33
32
|
auto s = Symbol(x).str();
|
34
33
|
if (s == "glop") {
|
35
34
|
return MPSolver::OptimizationProblemType::GLOP_LINEAR_PROGRAMMING;
|
@@ -40,7 +39,7 @@ namespace Rice::detail
|
|
40
39
|
}
|
41
40
|
}
|
42
41
|
};
|
43
|
-
}
|
42
|
+
} // namespace Rice::detail
|
44
43
|
|
45
44
|
void init_linear(Rice::Module& m) {
|
46
45
|
Rice::define_class_under<MPVariable>(m, "MPVariable")
|
data/ext/or-tools/math_opt.cpp
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
#include
|
2
|
-
#include "absl/status/statusor.h"
|
3
|
-
#include "ortools/base/init_google.h"
|
4
|
-
#include "ortools/math_opt/cpp/math_opt.h"
|
1
|
+
#include <string>
|
5
2
|
|
6
|
-
#include
|
3
|
+
#include <absl/log/check.h>
|
4
|
+
#include <absl/status/statusor.h>
|
5
|
+
#include <ortools/base/init_google.h>
|
6
|
+
#include <ortools/math_opt/cpp/math_opt.h>
|
7
|
+
#include <rice/rice.hpp>
|
8
|
+
#include <rice/stl.hpp>
|
7
9
|
|
8
10
|
using operations_research::math_opt::LinearConstraint;
|
9
11
|
using operations_research::math_opt::Model;
|
@@ -15,21 +17,17 @@ using operations_research::math_opt::Termination;
|
|
15
17
|
using operations_research::math_opt::TerminationReason;
|
16
18
|
using operations_research::math_opt::Variable;
|
17
19
|
|
18
|
-
namespace Rice::detail
|
19
|
-
{
|
20
|
+
namespace Rice::detail {
|
20
21
|
template<>
|
21
|
-
struct Type<SolverType>
|
22
|
-
{
|
22
|
+
struct Type<SolverType> {
|
23
23
|
static bool verify() { return true; }
|
24
24
|
};
|
25
25
|
|
26
26
|
template<>
|
27
|
-
struct From_Ruby<SolverType>
|
28
|
-
{
|
27
|
+
struct From_Ruby<SolverType> {
|
29
28
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
30
29
|
|
31
|
-
static SolverType convert(VALUE x)
|
32
|
-
{
|
30
|
+
static SolverType convert(VALUE x) {
|
33
31
|
auto s = Symbol(x).str();
|
34
32
|
if (s == "gscip") {
|
35
33
|
return SolverType::kGscip;
|
@@ -56,7 +54,7 @@ namespace Rice::detail
|
|
56
54
|
}
|
57
55
|
}
|
58
56
|
};
|
59
|
-
}
|
57
|
+
} // namespace Rice::detail
|
60
58
|
|
61
59
|
void init_math_opt(Rice::Module& m) {
|
62
60
|
auto mathopt = Rice::define_module_under(m, "MathOpt");
|
@@ -67,7 +65,7 @@ void init_math_opt(Rice::Module& m) {
|
|
67
65
|
.define_method(
|
68
66
|
"_eql?",
|
69
67
|
[](Variable& self, Variable &other) {
|
70
|
-
return
|
68
|
+
return static_cast<bool>(self == other);
|
71
69
|
});
|
72
70
|
|
73
71
|
Rice::define_class_under<LinearConstraint>(mathopt, "LinearConstraint");
|
@@ -1,7 +1,9 @@
|
|
1
|
+
#include <vector>
|
2
|
+
|
1
3
|
#include <ortools/graph/max_flow.h>
|
2
4
|
#include <ortools/graph/min_cost_flow.h>
|
3
|
-
|
4
|
-
#include
|
5
|
+
#include <rice/rice.hpp>
|
6
|
+
#include <rice/stl.hpp>
|
5
7
|
|
6
8
|
using operations_research::NodeIndex;
|
7
9
|
using operations_research::SimpleMaxFlow;
|
data/ext/or-tools/routing.cpp
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
#include <string>
|
2
|
+
#include <vector>
|
3
|
+
|
1
4
|
#include <ortools/constraint_solver/routing.h>
|
2
5
|
#include <ortools/constraint_solver/routing_parameters.h>
|
3
|
-
|
4
|
-
#include
|
6
|
+
#include <rice/rice.hpp>
|
7
|
+
#include <rice/stl.hpp>
|
5
8
|
|
6
9
|
using operations_research::Assignment;
|
7
10
|
using operations_research::ConstraintSolverParameters;
|
@@ -15,6 +18,7 @@ using operations_research::RoutingModel;
|
|
15
18
|
using operations_research::RoutingModelParameters;
|
16
19
|
using operations_research::RoutingNodeIndex;
|
17
20
|
using operations_research::RoutingSearchParameters;
|
21
|
+
using operations_research::RoutingSearchStatus;
|
18
22
|
|
19
23
|
using Rice::Array;
|
20
24
|
using Rice::Class;
|
@@ -23,37 +27,31 @@ using Rice::Object;
|
|
23
27
|
using Rice::String;
|
24
28
|
using Rice::Symbol;
|
25
29
|
|
26
|
-
namespace Rice::detail
|
27
|
-
{
|
30
|
+
namespace Rice::detail {
|
28
31
|
template<>
|
29
|
-
struct Type<RoutingNodeIndex>
|
30
|
-
{
|
32
|
+
struct Type<RoutingNodeIndex> {
|
31
33
|
static bool verify() { return true; }
|
32
34
|
};
|
33
35
|
|
34
36
|
template<>
|
35
|
-
class From_Ruby<RoutingNodeIndex>
|
36
|
-
{
|
37
|
+
class From_Ruby<RoutingNodeIndex> {
|
37
38
|
public:
|
38
39
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
39
40
|
|
40
|
-
RoutingNodeIndex convert(VALUE x)
|
41
|
-
{
|
41
|
+
RoutingNodeIndex convert(VALUE x) {
|
42
42
|
const RoutingNodeIndex index{From_Ruby<int>().convert(x)};
|
43
43
|
return index;
|
44
44
|
}
|
45
45
|
};
|
46
46
|
|
47
47
|
template<>
|
48
|
-
class To_Ruby<RoutingNodeIndex>
|
49
|
-
{
|
48
|
+
class To_Ruby<RoutingNodeIndex> {
|
50
49
|
public:
|
51
|
-
VALUE convert(RoutingNodeIndex const & x)
|
52
|
-
{
|
50
|
+
VALUE convert(RoutingNodeIndex const & x) {
|
53
51
|
return To_Ruby<int>().convert(x.value());
|
54
52
|
}
|
55
53
|
};
|
56
|
-
}
|
54
|
+
} // namespace Rice::detail
|
57
55
|
|
58
56
|
void init_routing(Rice::Module& m) {
|
59
57
|
auto rb_cRoutingSearchParameters = Rice::define_class_under<RoutingSearchParameters>(m, "RoutingSearchParameters");
|
@@ -252,7 +250,11 @@ void init_routing(Rice::Module& m) {
|
|
252
250
|
})
|
253
251
|
.define_method(
|
254
252
|
"cumulative",
|
255
|
-
[](operations_research::Solver& self,
|
253
|
+
[](operations_research::Solver& self, Array rb_intervals, std::vector<int64_t> demands, int64_t capacity, const std::string& name) {
|
254
|
+
std::vector<operations_research::IntervalVar*> intervals;
|
255
|
+
for (const Object v : rb_intervals) {
|
256
|
+
intervals.push_back(Rice::detail::From_Ruby<operations_research::IntervalVar*>().convert(v.value()));
|
257
|
+
}
|
256
258
|
return self.MakeCumulative(intervals, demands, capacity, name);
|
257
259
|
});
|
258
260
|
|
@@ -331,7 +333,7 @@ void init_routing(Rice::Module& m) {
|
|
331
333
|
.define_method("add_resource_group", &RoutingModel::AddResourceGroup)
|
332
334
|
.define_method("dimension_resource_group_indices", &RoutingModel::GetDimensionResourceGroupIndices)
|
333
335
|
.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") = (
|
336
|
+
.define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = static_cast<int64_t>(1), Rice::Arg("_penalty_cost_behavior") = RoutingModel::PenaltyCostBehavior::PENALIZE_ONCE)
|
335
337
|
.define_method("disjunction_indices", &RoutingModel::GetDisjunctionIndices)
|
336
338
|
.define_method("disjunction_penalty", &RoutingModel::GetDisjunctionPenalty)
|
337
339
|
.define_method("disjunction_max_cardinality", &RoutingModel::GetDisjunctionMaxCardinality)
|
@@ -346,22 +348,14 @@ void init_routing(Rice::Module& m) {
|
|
346
348
|
.define_method("add_pickup_and_delivery", &RoutingModel::AddPickupAndDelivery)
|
347
349
|
.define_method("add_pickup_and_delivery_sets", &RoutingModel::AddPickupAndDeliverySets)
|
348
350
|
.define_method(
|
349
|
-
"
|
351
|
+
"pickup_position",
|
350
352
|
[](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;
|
353
|
+
return self.GetPickupPosition(node_index);
|
356
354
|
})
|
357
355
|
.define_method(
|
358
|
-
"
|
356
|
+
"delivery_position",
|
359
357
|
[](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;
|
358
|
+
return self.GetDeliveryPosition(node_index);
|
365
359
|
})
|
366
360
|
.define_method("num_of_singleton_nodes", &RoutingModel::GetNumOfSingletonNodes)
|
367
361
|
.define_method("unperformed_penalty", &RoutingModel::UnperformedPenalty)
|
@@ -403,15 +397,15 @@ void init_routing(Rice::Module& m) {
|
|
403
397
|
[](RoutingModel& self) {
|
404
398
|
auto status = self.status();
|
405
399
|
|
406
|
-
if (status ==
|
400
|
+
if (status == RoutingSearchStatus::ROUTING_NOT_SOLVED) {
|
407
401
|
return Symbol("not_solved");
|
408
|
-
} else if (status ==
|
402
|
+
} else if (status == RoutingSearchStatus::ROUTING_SUCCESS) {
|
409
403
|
return Symbol("success");
|
410
|
-
} else if (status ==
|
404
|
+
} else if (status == RoutingSearchStatus::ROUTING_FAIL) {
|
411
405
|
return Symbol("fail");
|
412
|
-
} else if (status ==
|
406
|
+
} else if (status == RoutingSearchStatus::ROUTING_FAIL_TIMEOUT) {
|
413
407
|
return Symbol("fail_timeout");
|
414
|
-
} else if (status ==
|
408
|
+
} else if (status == RoutingSearchStatus::ROUTING_INVALID) {
|
415
409
|
return Symbol("invalid");
|
416
410
|
} else {
|
417
411
|
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
|
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module ORTools
|
2
2
|
class RoutingModel
|
3
|
-
def solve(
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
def solve(
|
4
|
+
solution_limit: nil,
|
5
|
+
time_limit: nil,
|
6
|
+
lns_time_limit: nil,
|
7
|
+
first_solution_strategy: nil,
|
8
|
+
local_search_metaheuristic: nil,
|
9
|
+
log_search: nil
|
10
|
+
)
|
7
11
|
search_parameters = ORTools.default_routing_search_parameters
|
8
12
|
search_parameters.solution_limit = solution_limit if solution_limit
|
9
13
|
search_parameters.time_limit = time_limit if time_limit
|
@@ -13,9 +17,5 @@ module ORTools
|
|
13
17
|
search_parameters.log_search = log_search unless log_search.nil?
|
14
18
|
solve_with_parameters(search_parameters)
|
15
19
|
end
|
16
|
-
|
17
|
-
# previous names
|
18
|
-
alias_method :pickup_index_pairs, :pickup_positions
|
19
|
-
alias_method :delivery_index_pairs, :delivery_positions
|
20
20
|
end
|
21
21
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rice
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 4.5.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 4.5.0
|
26
26
|
email: andrew@ankane.org
|
27
27
|
executables: []
|
28
28
|
extensions:
|
@@ -37,7 +37,6 @@ files:
|
|
37
37
|
- ext/or-tools/bin_packing.cpp
|
38
38
|
- ext/or-tools/constraint.cpp
|
39
39
|
- ext/or-tools/ext.cpp
|
40
|
-
- ext/or-tools/ext.h
|
41
40
|
- ext/or-tools/extconf.rb
|
42
41
|
- ext/or-tools/linear.cpp
|
43
42
|
- ext/or-tools/math_opt.cpp
|
@@ -86,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
85
|
- !ruby/object:Gem::Version
|
87
86
|
version: '0'
|
88
87
|
requirements: []
|
89
|
-
rubygems_version: 3.6.
|
88
|
+
rubygems_version: 3.6.7
|
90
89
|
specification_version: 4
|
91
90
|
summary: Operations research tools for Ruby
|
92
91
|
test_files: []
|
data/ext/or-tools/ext.h
DELETED