or-tools 0.15.0 → 0.16.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 +4 -4
- data/CHANGELOG.md +8 -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/linear.cpp +10 -11
- data/ext/or-tools/math_opt.cpp +13 -15
- data/ext/or-tools/network_flows.cpp +7 -6
- data/ext/or-tools/routing.cpp +18 -17
- data/ext/or-tools/vendor.rb +19 -19
- data/lib/or_tools/routing_model.rb +8 -4
- 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: a2c9e5edffd049efefd022fbb2d8473e922adb0d2d4bc7ca03fa87ec823929be
|
4
|
+
data.tar.gz: 9825d9ab9fe616f263a8c5bfa23f57795fee798c486ef6ad6aa34bd4c47a5dac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53958c2e8aff5a55240cc19b8423d5c6cd8244214b26a79d969fe920f8faab2ad354ff7ef62039b05071d7b166436696152ffd141dff68451f8c09f8d119d83f
|
7
|
+
data.tar.gz: 7abb3a8c5507f11796743b505351f285cbad89ab366fda35ae6b084f1835dcab8905f02fcb91e091bbeb142d097a8b314aadddc51a94d8285d257b6601e2e769
|
data/CHANGELOG.md
CHANGED
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/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,9 +1,10 @@
|
|
1
|
+
#include <vector>
|
2
|
+
|
1
3
|
#include <ortools/graph/max_flow.h>
|
2
4
|
#include <ortools/graph/min_cost_flow.h>
|
5
|
+
#include <rice/rice.hpp>
|
6
|
+
#include <rice/stl.hpp>
|
3
7
|
|
4
|
-
#include "ext.h"
|
5
|
-
|
6
|
-
using operations_research::NodeIndex;
|
7
8
|
using operations_research::SimpleMaxFlow;
|
8
9
|
using operations_research::SimpleMinCostFlow;
|
9
10
|
|
@@ -23,7 +24,7 @@ void init_network_flows(Rice::Module& m) {
|
|
23
24
|
.define_method("flow", &SimpleMaxFlow::Flow)
|
24
25
|
.define_method(
|
25
26
|
"solve",
|
26
|
-
[](SimpleMaxFlow& self, NodeIndex source, NodeIndex sink) {
|
27
|
+
[](SimpleMaxFlow& self, SimpleMaxFlow::NodeIndex source, SimpleMaxFlow::NodeIndex sink) {
|
27
28
|
auto status = self.Solve(source, sink);
|
28
29
|
|
29
30
|
if (status == SimpleMaxFlow::Status::OPTIMAL) {
|
@@ -41,7 +42,7 @@ void init_network_flows(Rice::Module& m) {
|
|
41
42
|
.define_method(
|
42
43
|
"source_side_min_cut",
|
43
44
|
[](SimpleMaxFlow& self) {
|
44
|
-
std::vector<NodeIndex> result;
|
45
|
+
std::vector<SimpleMaxFlow::NodeIndex> result;
|
45
46
|
self.GetSourceSideMinCut(&result);
|
46
47
|
|
47
48
|
Array ret;
|
@@ -53,7 +54,7 @@ void init_network_flows(Rice::Module& m) {
|
|
53
54
|
.define_method(
|
54
55
|
"sink_side_min_cut",
|
55
56
|
[](SimpleMaxFlow& self) {
|
56
|
-
std::vector<NodeIndex> result;
|
57
|
+
std::vector<SimpleMaxFlow::NodeIndex> result;
|
57
58
|
self.GetSinkSideMinCut(&result);
|
58
59
|
|
59
60
|
Array ret;
|
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;
|
@@ -24,37 +27,31 @@ using Rice::Object;
|
|
24
27
|
using Rice::String;
|
25
28
|
using Rice::Symbol;
|
26
29
|
|
27
|
-
namespace Rice::detail
|
28
|
-
{
|
30
|
+
namespace Rice::detail {
|
29
31
|
template<>
|
30
|
-
struct Type<RoutingNodeIndex>
|
31
|
-
{
|
32
|
+
struct Type<RoutingNodeIndex> {
|
32
33
|
static bool verify() { return true; }
|
33
34
|
};
|
34
35
|
|
35
36
|
template<>
|
36
|
-
class From_Ruby<RoutingNodeIndex>
|
37
|
-
{
|
37
|
+
class From_Ruby<RoutingNodeIndex> {
|
38
38
|
public:
|
39
39
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
40
40
|
|
41
|
-
RoutingNodeIndex convert(VALUE x)
|
42
|
-
{
|
41
|
+
RoutingNodeIndex convert(VALUE x) {
|
43
42
|
const RoutingNodeIndex index{From_Ruby<int>().convert(x)};
|
44
43
|
return index;
|
45
44
|
}
|
46
45
|
};
|
47
46
|
|
48
47
|
template<>
|
49
|
-
class To_Ruby<RoutingNodeIndex>
|
50
|
-
{
|
48
|
+
class To_Ruby<RoutingNodeIndex> {
|
51
49
|
public:
|
52
|
-
VALUE convert(RoutingNodeIndex const & x)
|
53
|
-
{
|
50
|
+
VALUE convert(RoutingNodeIndex const & x) {
|
54
51
|
return To_Ruby<int>().convert(x.value());
|
55
52
|
}
|
56
53
|
};
|
57
|
-
}
|
54
|
+
} // namespace Rice::detail
|
58
55
|
|
59
56
|
void init_routing(Rice::Module& m) {
|
60
57
|
auto rb_cRoutingSearchParameters = Rice::define_class_under<RoutingSearchParameters>(m, "RoutingSearchParameters");
|
@@ -253,7 +250,11 @@ void init_routing(Rice::Module& m) {
|
|
253
250
|
})
|
254
251
|
.define_method(
|
255
252
|
"cumulative",
|
256
|
-
[](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
|
+
}
|
257
258
|
return self.MakeCumulative(intervals, demands, capacity, name);
|
258
259
|
});
|
259
260
|
|
@@ -332,7 +333,7 @@ void init_routing(Rice::Module& m) {
|
|
332
333
|
.define_method("add_resource_group", &RoutingModel::AddResourceGroup)
|
333
334
|
.define_method("dimension_resource_group_indices", &RoutingModel::GetDimensionResourceGroupIndices)
|
334
335
|
.define_method("dimension_resource_group_index", &RoutingModel::GetDimensionResourceGroupIndex)
|
335
|
-
.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)
|
336
337
|
.define_method("disjunction_indices", &RoutingModel::GetDisjunctionIndices)
|
337
338
|
.define_method("disjunction_penalty", &RoutingModel::GetDisjunctionPenalty)
|
338
339
|
.define_method("disjunction_max_cardinality", &RoutingModel::GetDisjunctionMaxCardinality)
|
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.14.6206"
|
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-15.
|
14
|
-
checksum = "
|
13
|
+
filename = "or-tools_arm64_macOS-15.5_cpp_v#{version}.tar.gz"
|
14
|
+
checksum = "7dd3fc35acc74a85f44e39099dcc2caa698d7a99e659e8d8456ce25bafe4a63b"
|
15
15
|
else
|
16
|
-
filename = "or-tools_x86_64_macOS-15.
|
17
|
-
checksum = "
|
16
|
+
filename = "or-tools_x86_64_macOS-15.5_cpp_v#{version}.tar.gz"
|
17
|
+
checksum = "de7ed91b0fe90094fb5f5ebd19869b69a8d52b9752e456752208a22a05b14f7f"
|
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 = "be3855a32a7390c3957d43ebd3faec1610acdc28f06ef33cb50f1f72a9aa6621"
|
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 = "127a82bbbf304d26721bb9b41ecce2d66f21c757204ab5aa2cc37eaa6ffb7eb6"
|
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 = "7705a7c11e0db4ec1d7841e184acd204787174c6cbdb2fbd81169823ed148c6c"
|
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 = "646b53e8d355290c4627d6bad0d36baeff38dc43605d317ac02cb811688d4dd2"
|
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 = "285e8ec3a3399e45cdb4f67f48d4b65dbfa9c013b29036d409c72f96f0f34ab9"
|
45
45
|
elsif os == "arch" && !arm
|
46
46
|
filename = "or-tools_amd64_archlinux_cpp_v#{version}.tar.gz"
|
47
|
-
checksum = "
|
47
|
+
checksum = "6be039a13c3be7a3dbcdc413d455b43bba4590ce38859062898835effefb5ca4"
|
48
48
|
else
|
49
49
|
platform =
|
50
50
|
if Gem.win_platform?
|
@@ -127,14 +127,6 @@ Dir.mktmpdir do |extract_path|
|
|
127
127
|
tar_args = Gem.win_platform? ? ["--force-local"] : []
|
128
128
|
system "tar", "zxf", download_path, "-C", extract_path, "--strip-components=1", *tar_args
|
129
129
|
|
130
|
-
# licenses
|
131
|
-
license_files = Dir.glob("**/*{LICENSE,LICENCE,NOTICE,COPYING,license,licence,notice,copying}*", base: extract_path)
|
132
|
-
raise "License not found" unless license_files.any?
|
133
|
-
license_files.each do |file|
|
134
|
-
FileUtils.mkdir_p(File.join(path, File.dirname(file)))
|
135
|
-
FileUtils.mv(File.join(extract_path, file), File.join(path, file))
|
136
|
-
end
|
137
|
-
|
138
130
|
# include
|
139
131
|
FileUtils.mv(File.join(extract_path, "include"), File.join(path, "include"))
|
140
132
|
|
@@ -144,6 +136,14 @@ Dir.mktmpdir do |extract_path|
|
|
144
136
|
next if file.include?("libprotoc.")
|
145
137
|
FileUtils.mv(File.join(extract_path, file), File.join(path, file))
|
146
138
|
end
|
139
|
+
|
140
|
+
# licenses
|
141
|
+
license_files = Dir.glob("**/*{LICENSE,LICENCE,NOTICE,COPYING,license,licence,notice,copying}*", base: extract_path)
|
142
|
+
raise "License not found" unless license_files.any?
|
143
|
+
license_files.each do |file|
|
144
|
+
FileUtils.mkdir_p(File.join(path, File.dirname(file)))
|
145
|
+
FileUtils.mv(File.join(extract_path, file), File.join(path, file))
|
146
|
+
end
|
147
147
|
end
|
148
148
|
|
149
149
|
# export
|
@@ -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
|
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.16.0
|
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