or-tools 0.8.2 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f76c7d5e0a5232ea519e3d96773c1c62ec718c4431f26d770db31881680662a
4
- data.tar.gz: 951a90e2c6a30418ebc6c267a55205acb0946048278ee822912767b2a639ebc3
3
+ metadata.gz: bab501da2187c3426bc8bb6a6c5e034a5995f4dcb33efee1df302a4465eac105
4
+ data.tar.gz: ea4a061510dfb8fe566d4a52763bc3d0e65b342e31848b255c770fbcf22a410b
5
5
  SHA512:
6
- metadata.gz: be8e00e0553d9413a4d213af5647cccd46baaf3f724981c7e3234d08420cf44cc039a5ef24b6f35460ba36644d6690ba697b19c6f62a647a0ddda5af447f887d
7
- data.tar.gz: 1219df9128db35f3fec3c040b19c9a66a26a08c9222a97ef10aec5c09173bb256e7c35cbeb528d6bf2c5f81ebc06c58149f3f2f48a8dc1e5ac370b668b6f20df
6
+ metadata.gz: 603dd8a2db9e6ac69bffd6a8c1b405b75763a3965f655633f80c6bff5cf3a3c5419c7cb7d0d008ce4783937d1628289f27a344ec8f468603e3c7135158880845
7
+ data.tar.gz: 90659981897847d2c3c89afb0c9bdc86300990a4766812fd742ea4ea5901e8d246fbda2ff9e36ed28fe9828fe70e36246ad8cbe7a25eff2db0ef4c96b750d9a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.9.1 (2023-03-11)
2
+
3
+ - Added `solution_info` to `CpSolver`
4
+
5
+ ## 0.9.0 (2022-12-02)
6
+
7
+ - Updated OR-Tools to 9.5
8
+ - Added `solve_from_assignment_with_parameters` to `RoutingModel`
9
+ - Improved `inspect` and `to_s` for expressions
10
+
1
11
  ## 0.8.2 (2022-11-05)
2
12
 
3
13
  - Added support for bool vars to `add_hint`
@@ -370,6 +370,11 @@ void init_constraint(Rice::Module& m) {
370
370
  throw std::runtime_error("Unknown solver status");
371
371
  }
372
372
  })
373
+ .define_method(
374
+ "solution_info",
375
+ [](CpSolverResponse& self) {
376
+ return self.solution_info();
377
+ })
373
378
  .define_method(
374
379
  "sufficient_assumptions_for_infeasibility",
375
380
  [](CpSolverResponse& self) {
@@ -47,7 +47,6 @@ namespace Rice::detail
47
47
  void init_linear(Rice::Module& m) {
48
48
  Rice::define_class_under<LinearRange>(m, "LinearRange");
49
49
 
50
- // TODO remove in 0.8.0
51
50
  auto rb_cLinearExpr = Rice::define_class_under<LinearExpr>(m, "LinearExpr");
52
51
  rb_cLinearExpr.define_constructor(Rice::Constructor<LinearExpr>());
53
52
 
@@ -388,6 +388,11 @@ void init_routing(Rice::Module& m) {
388
388
  [](RoutingModel& self, const RoutingSearchParameters& search_parameters) {
389
389
  return self.SolveWithParameters(search_parameters);
390
390
  })
391
+ .define_method(
392
+ "solve_from_assignment_with_parameters",
393
+ [](RoutingModel& self, const Assignment* assignment, const RoutingSearchParameters& search_parameters) {
394
+ return self.SolveFromAssignmentWithParameters(assignment, search_parameters);
395
+ })
391
396
  .define_method("compute_lower_bound", &RoutingModel::ComputeLowerBound)
392
397
  .define_method("status",
393
398
  [](RoutingModel& self) {
@@ -4,15 +4,15 @@ require "fileutils"
4
4
  require "net/http"
5
5
  require "tmpdir"
6
6
 
7
- version = "9.4.1874"
7
+ version = "9.5.2237"
8
8
 
9
9
  if RbConfig::CONFIG["host_os"] =~ /darwin/i
10
10
  if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
11
- filename = "or-tools_arm64_MacOsX-12.5_cpp_v#{version}.tar.gz"
12
- checksum = "ebc185bcb0a056a2704fb1c5175d5c11cc21a7e0634be65139cea55bb6a021ce"
11
+ filename = "or-tools_arm64_macOS-13.0.1_cpp_v#{version}.tar.gz"
12
+ checksum = "9041ccb29618bce793c68eaa30a01b1fbaa6491656bddd942753d9a412544db7"
13
13
  else
14
- filename = "or-tools_x86_64_MacOsX-12.5_cpp_v#{version}.tar.gz"
15
- checksum = "d03c706b51a6ef7aa77886dc3f135baaac52c00803bb548c286fbdeb4a419acd"
14
+ filename = "or-tools_x86_64_macOS-13.0.1_cpp_v#{version}.tar.gz"
15
+ checksum = "f4af2bfd3b19cff6056e01abcddf1f5a54a0da891cafd73a25a671a3abd17c76"
16
16
  end
17
17
  else
18
18
  # try /etc/os-release with fallback to /usr/lib/os-release
@@ -27,25 +27,25 @@ else
27
27
 
28
28
  if os == "ubuntu" && os_version == "22.04"
29
29
  filename = "or-tools_amd64_ubuntu-22.04_cpp_v#{version}.tar.gz"
30
- checksum = "d7e222fc4f30c9864bfa3062accc8b4dd291c3166ba9cf3576c6c86eded71940"
30
+ checksum = "acecd79867f4bd5f6b91d95743fc858e939d8611e534914a540ee4f46c535247"
31
31
  elsif os == "ubuntu" && os_version == "20.04"
32
32
  filename = "or-tools_amd64_ubuntu-20.04_cpp_v#{version}.tar.gz"
33
- checksum = "1b09f0f60b5aab83aeec468842e4a166cd3a4e7910e807f55bc7f96d5dffabdb"
33
+ checksum = "506b420e1b1232440e49680e55ae087000f2c92b1009e46417c774d8332f217b"
34
34
  elsif os == "ubuntu" && os_version == "18.04"
35
35
  filename = "or-tools_amd64_ubuntu-18.04_cpp_v#{version}.tar.gz"
36
- checksum = "ef73ebd4ca0f82a1179fdb2aded3c2a85dfe2ab275d91b8a5b147a653ca861ab"
36
+ checksum = "96ee5b4f3cf6dfece6dc54a78c6aa4a55dae5bd7d4f4176b332d3f3aa6cd973f"
37
37
  elsif os == "debian" && os_version == "11"
38
38
  filename = "or-tools_amd64_debian-11_cpp_v#{version}.tar.gz"
39
- checksum = "651c62147f231fb90635c522e0a2c799e3de3991c2c75f7c6acb721e7b78946c"
39
+ checksum = "00bef600d0e2452544484f26f49bada4f717d7735f9d65c3961def8ab83876d3"
40
40
  elsif os == "debian" && os_version == "10"
41
41
  filename = "or-tools_amd64_debian-10_cpp_v#{version}.tar.gz"
42
- checksum = "36088bc6c6fbb96539245db7cddf498f77ae3e7b7c2cc8f6d7d89d76f90751fb"
42
+ checksum = "a45c566dbfe818386bc1aa061a167650c691f447b2937cdc8bdb1e9054ba4715"
43
43
  elsif os == "centos" && os_version == "8"
44
44
  filename = "or-tools_amd64_centos-8_cpp_v#{version}.tar.gz"
45
- checksum = "da2cb303ae332d207592f21bb504e4e2e33dc1b1e8f5747d413c082d9d05504a"
45
+ checksum = "af82328d06c402917735482045e7abc37a6f9258db3d607d6efc62c27f765334"
46
46
  elsif os == "centos" && os_version == "7"
47
47
  filename = "or-tools_amd64_centos-7_cpp_v#{version}.tar.gz"
48
- checksum = "9eaf0178467f4d2fdbe496f62223809aa43e313548cc6cb716e661c00472b4ff"
48
+ checksum = "3d28bdd3ab27224b80960393c7f51e7c228ae78297c28e4ae79bc6c269ae44fe"
49
49
  else
50
50
  platform =
51
51
  if Gem.win_platform?
@@ -9,12 +9,11 @@ module ORTools
9
9
  end
10
10
 
11
11
  def to_s
12
- "#{left.inspect} #{operator} #{right.inspect}"
12
+ "#{left} #{operator} #{right}"
13
13
  end
14
14
 
15
- # TODO add class
16
15
  def inspect
17
- to_s
16
+ "#<#{self.class.name} #{to_s}>"
18
17
  end
19
18
  end
20
19
  end
@@ -41,6 +41,10 @@ module ORTools
41
41
  end
42
42
  end
43
43
 
44
+ def solution_info
45
+ @response.solution_info
46
+ end
47
+
44
48
  def sufficient_assumptions_for_infeasibility
45
49
  @response.sufficient_assumptions_for_infeasibility
46
50
  end
@@ -1,5 +1,4 @@
1
1
  module ORTools
2
- # TODO change to VariableExpr in 0.8.0
3
2
  class MPVariable < LinearExpr
4
3
  def add_self_to_coeff_map_or_stack(coeffs, multiplier, stack)
5
4
  coeffs[self] += multiplier
@@ -13,7 +13,11 @@ module ORTools
13
13
  if @coef == -1
14
14
  "-#{@expr}"
15
15
  else
16
- "(#{@coef} * #{@expr})"
16
+ expr = @expr.to_s
17
+ if expr.include?("+") || expr.include?("-")
18
+ expr = "(#{expr})"
19
+ end
20
+ "#{@coef} * #{expr}"
17
21
  end
18
22
  end
19
23
 
@@ -22,9 +22,8 @@ module ORTools
22
22
  name
23
23
  end
24
24
 
25
- # TODO add class
26
25
  def inspect
27
- to_s
26
+ "#<#{self.class.name} #{to_s}>"
28
27
  end
29
28
  end
30
29
  end
@@ -27,7 +27,7 @@ module ORTools
27
27
  def to_s
28
28
  vars.map do |v|
29
29
  k = v[0]
30
- k = k.respond_to?(:name) ? k.name : k.inspect
30
+ k = k.respond_to?(:name) ? k.name : k.to_s
31
31
  if v[1] == 1
32
32
  k
33
33
  else
@@ -36,9 +36,8 @@ module ORTools
36
36
  end.join(" + ").sub(" + -", " - ")
37
37
  end
38
38
 
39
- # TODO add class
40
39
  def inspect
41
- to_s
40
+ "#<#{self.class.name} #{to_s}>"
42
41
  end
43
42
 
44
43
  private
@@ -17,7 +17,7 @@ module ORTools
17
17
  end
18
18
 
19
19
  def to_s
20
- "(#{@array.map(&:to_s).join(" + ")})"
20
+ "#{@array.map(&:to_s).reject { |v| v == "0" }.join(" + ")}".gsub(" + -", " - ")
21
21
  end
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module ORTools
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: or-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-05 00:00:00.000000000 Z
11
+ date: 2023-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.3.7
95
+ rubygems_version: 3.4.6
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Operations research tools for Ruby