rulp 0.0.43 → 0.0.44
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/lib/rulp/version.rb +1 -1
- data/lib/solvers/cbc.rb +2 -1
- data/lib/solvers/glpk.rb +4 -1
- data/lib/solvers/gurobi.rb +1 -0
- data/lib/solvers/scip.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b02471f804f1086c6193730ce602be9cf03d3ab4
|
4
|
+
data.tar.gz: a9f7197bb1aeb4a1a707333244b6600fed798322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5268c02947e586c5ad74630a9d9aadbca40c29f9ea5078f0f2a31563fdc81016a0664fc8d1f5b0406a7a5fe5d63d4e0ddfbd526a555f6b02525b509271a7707f
|
7
|
+
data.tar.gz: 280a4f73804264683b9f65cfe42244934f12cf5a585a62e13f6d7cd8823466d1fc1fb43ff83d694fdf6d3e0a1e7cc0c29fbd373a53885f3b3b1f318435b6c283
|
data/lib/rulp/version.rb
CHANGED
data/lib/solvers/cbc.rb
CHANGED
@@ -7,7 +7,8 @@ class Cbc < Solver
|
|
7
7
|
end
|
8
8
|
command %= [
|
9
9
|
options[:gap] ? "ratio #{options[:gap]}":"",
|
10
|
-
options[:node_limit] ? "maxN #{options[:node_limit]}":""
|
10
|
+
options[:node_limit] ? "maxN #{options[:node_limit]}":"",
|
11
|
+
options[:time_limit] ? "seconds #{options[:time_limit]}":""
|
11
12
|
]
|
12
13
|
|
13
14
|
exec(command)
|
data/lib/solvers/glpk.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
class Glpk < Solver
|
2
2
|
def solve
|
3
3
|
command = "#{executable} --lp #{@filename} %s --cuts --output #{@outfile}"
|
4
|
-
command %=
|
4
|
+
command %= [
|
5
|
+
options[:gap] ? "--mipgap #{options[:gap]}" : "",
|
6
|
+
options[:time_limit] ? "--tmlim #{options[:time_limit]}" : ""
|
7
|
+
]
|
5
8
|
exec(command)
|
6
9
|
end
|
7
10
|
|
data/lib/solvers/gurobi.rb
CHANGED
@@ -4,6 +4,7 @@ class Gurobi < Solver
|
|
4
4
|
command %= [
|
5
5
|
options[:gap] ? "MipGap=#{options[:gap]}":"",
|
6
6
|
options[:node_limit] ? "NodeLimit=#{options[:node_limit]}":"",
|
7
|
+
options[:time_limit] ? "TimeLimit=#{options[:time_limit]}":"",
|
7
8
|
ENV['RULP_GUROBI_CMD_ARGS'] ? ENV['RULP_GUROBI_CMD_ARGS'] : ''
|
8
9
|
]
|
9
10
|
exec(command)
|
data/lib/solvers/scip.rb
CHANGED
@@ -28,6 +28,9 @@ class Scip < Solver
|
|
28
28
|
if options[:gap]
|
29
29
|
existing_settings += "\nlimits/gap = #{options[:gap]}"
|
30
30
|
end
|
31
|
+
if options[:time_limit]
|
32
|
+
existing_settings += "\nlimits/time = #{options[:time_limit]}"
|
33
|
+
end
|
31
34
|
|
32
35
|
settings_file = get_settings_filename
|
33
36
|
IO.write(settings_file, existing_settings)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rulp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter Coppieters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple Ruby LP description DSL
|
14
14
|
email: wc@pico.net.nz
|