or-tools 0.5.2 → 0.5.3

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: 4e179505f9df7d80af6a316ca719594fa2a99839c8c26b0f33ee1551b4e7b2d3
4
- data.tar.gz: b05dc3c553d11112e55855bb91b0382a3a648a14848e5c9d6e3805bf52e009fb
3
+ metadata.gz: c16581924f813458dc535d2a8804bf02a7f0a605fac108d14894f13ed7af984a
4
+ data.tar.gz: 28bd124da203c4dd0ac50ee86aca3deb7ba283a1cbd711521985972a02bdcaa1
5
5
  SHA512:
6
- metadata.gz: fa77b818baf408c3cf30b56065f0b9b7f877358e1f0d39718a3ebc1f49fc4dae78da9678875c340895427f189074939e220ffa320207bea76bd0d7921f0675d7
7
- data.tar.gz: 7c174df348ad0835c93a56ecb51a6f9763aaba43f0d3fc3eaf0b8b745922a204d86ee6fae6ba3fba632b284179251decbbfce17b2a1dd1e608d91b96cf3ff9ec
6
+ metadata.gz: 0612e5bfcf96ba9ec2591dab7bbfe175625f874ff89e87a168d771a0f81948cb4d8d29e31de0487470eb3b993ef53b793ac25a0b078c5cc54385d4cd3bb159f9
7
+ data.tar.gz: dd548021defe7c1249ecee70790cb29f4c85a5ec04cace94cc9bfa0192b24d68e20040a7dd355b148f75f443bf882cc41ec3ea6613785a24aeb4a37674ca8017
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.5.3 (2021-08-02)
2
+
3
+ - Added more methods to `IntVar`, `IntervalVar`, and `Constraint`
4
+ - Added `RoutingModelParameters`
5
+
1
6
  ## 0.5.2 (2021-07-07)
2
7
 
3
8
  - Added `export_model_as_lp_format` and `export_model_as_mps_format` to `Solver`
@@ -4,12 +4,14 @@
4
4
  #include "ext.h"
5
5
 
6
6
  using operations_research::Assignment;
7
+ using operations_research::ConstraintSolverParameters;
7
8
  using operations_research::DefaultRoutingSearchParameters;
8
9
  using operations_research::FirstSolutionStrategy;
9
10
  using operations_research::LocalSearchMetaheuristic;
10
11
  using operations_research::RoutingDimension;
11
12
  using operations_research::RoutingIndexManager;
12
13
  using operations_research::RoutingModel;
14
+ using operations_research::RoutingModelParameters;
13
15
  using operations_research::RoutingNodeIndex;
14
16
  using operations_research::RoutingSearchParameters;
15
17
 
@@ -163,19 +165,45 @@ void init_routing(Rice::Module& m) {
163
165
 
164
166
  // not to be confused with operations_research::sat::IntVar
165
167
  rb_cIntVar
168
+ .define_method("var?", &operations_research::IntVar::IsVar)
169
+ .define_method("value", &operations_research::IntVar::Value)
170
+ .define_method("remove_value", &operations_research::IntVar::RemoveValue)
171
+ .define_method("remove_interval", &operations_research::IntVar::RemoveInterval)
172
+ .define_method("remove_values", &operations_research::IntVar::RemoveValues)
173
+ .define_method("set_values", &operations_research::IntVar::SetValues)
174
+ .define_method("size", &operations_research::IntVar::Size)
175
+ .define_method("contains", &operations_research::IntVar::Contains)
176
+ .define_method("old_min", &operations_research::IntVar::OldMin)
177
+ .define_method("old_max", &operations_research::IntVar::OldMax)
166
178
  .define_method(
167
179
  "set_range",
168
180
  [](operations_research::IntVar& self, int64_t new_min, int64_t new_max) {
169
181
  self.SetRange(new_min, new_max);
170
182
  });
171
183
 
172
- Rice::define_class_under<operations_research::IntervalVar>(m, "IntervalVar");
184
+ Rice::define_class_under<operations_research::IntervalVar>(m, "IntervalVar")
185
+ .define_method("start_min", &operations_research::IntervalVar::StartMin)
186
+ .define_method("start_max", &operations_research::IntervalVar::StartMax)
187
+ .define_method("set_start_min", &operations_research::IntervalVar::SetStartMin)
188
+ .define_method("set_start_max", &operations_research::IntervalVar::SetStartMax)
189
+ .define_method("set_start_range", &operations_research::IntervalVar::SetStartRange)
190
+ .define_method("old_start_min", &operations_research::IntervalVar::OldStartMin)
191
+ .define_method("old_start_max", &operations_research::IntervalVar::OldStartMax)
192
+ .define_method("end_min", &operations_research::IntervalVar::EndMin)
193
+ .define_method("end_max", &operations_research::IntervalVar::EndMax)
194
+ .define_method("set_end_min", &operations_research::IntervalVar::SetEndMin)
195
+ .define_method("set_end_max", &operations_research::IntervalVar::SetEndMax)
196
+ .define_method("set_end_range", &operations_research::IntervalVar::SetEndRange)
197
+ .define_method("old_end_min", &operations_research::IntervalVar::OldEndMin)
198
+ .define_method("old_end_max", &operations_research::IntervalVar::OldEndMax);
173
199
 
174
200
  Rice::define_class_under<RoutingDimension>(m, "RoutingDimension")
175
201
  .define_method("global_span_cost_coefficient=", &RoutingDimension::SetGlobalSpanCostCoefficient)
176
202
  .define_method("cumul_var", &RoutingDimension::CumulVar);
177
203
 
178
- Rice::define_class_under<operations_research::Constraint>(m, "Constraint");
204
+ Rice::define_class_under<operations_research::Constraint>(m, "Constraint")
205
+ .define_method("post", &operations_research::Constraint::Post)
206
+ .define_method("debug_string", &operations_research::Constraint::DebugString);
179
207
 
180
208
  Rice::define_class_under<operations_research::Solver>(m, "Solver2")
181
209
  .define_method(
@@ -209,8 +237,33 @@ void init_routing(Rice::Module& m) {
209
237
  return self.MakeCumulative(intervals, demands, capacity, name);
210
238
  });
211
239
 
240
+ Rice::define_class_under<ConstraintSolverParameters>(m, "ConstraintSolverParameters")
241
+ .define_method(
242
+ "trace_propagation=",
243
+ [](ConstraintSolverParameters& self, bool value) {
244
+ self.set_trace_propagation(value);
245
+ })
246
+ .define_method(
247
+ "trace_search=",
248
+ [](ConstraintSolverParameters& self, bool value) {
249
+ self.set_trace_search(value);
250
+ });
251
+
252
+ Rice::define_class_under<RoutingModelParameters>(m, "RoutingModelParameters")
253
+ .define_method(
254
+ "solver_parameters",
255
+ [](RoutingModelParameters& self) {
256
+ return self.mutable_solver_parameters();
257
+ });
258
+
259
+ m.define_singleton_function(
260
+ "default_routing_model_parameters",
261
+ []() {
262
+ return operations_research::DefaultRoutingModelParameters();
263
+ });
264
+
212
265
  Rice::define_class_under<RoutingModel>(m, "RoutingModel")
213
- .define_constructor(Rice::Constructor<RoutingModel, RoutingIndexManager>())
266
+ .define_constructor(Rice::Constructor<RoutingModel, RoutingIndexManager, RoutingModelParameters>(), Rice::Arg("index_manager"), Rice::Arg("parameters") = operations_research::DefaultRoutingModelParameters())
214
267
  .define_method(
215
268
  "register_transit_callback",
216
269
  [](RoutingModel& self, Object callback) {
@@ -1,3 +1,3 @@
1
1
  module ORTools
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
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.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-07 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.2.3
90
+ rubygems_version: 3.2.22
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Operations research tools for Ruby