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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d68bde7a38b8bf0a62ead7589727428da3ca212d
4
- data.tar.gz: 19deb3f77fffeece80b35ca0ed00825fbe5fca4d
3
+ metadata.gz: b02471f804f1086c6193730ce602be9cf03d3ab4
4
+ data.tar.gz: a9f7197bb1aeb4a1a707333244b6600fed798322
5
5
  SHA512:
6
- metadata.gz: 76162b58a10cd20302f53f413b38c1e2795fc1b63f26fe5e1f6851efc79eefd5e3dd62b17db606e136290e7ade442dbadc596e5a69ebdb8f4be7d8cf8edfdd3f
7
- data.tar.gz: 5c2341e5a8bdbab7f941b9e699e226b0db0ca2d90c7d891a447451a6928b0e068bbf9e69eee013a9d8bf25b55424e3bce98ab1910c812041b9a3aa9a1bef9db7
6
+ metadata.gz: 5268c02947e586c5ad74630a9d9aadbca40c29f9ea5078f0f2a31563fdc81016a0664fc8d1f5b0406a7a5fe5d63d4e0ddfbd526a555f6b02525b509271a7707f
7
+ data.tar.gz: 280a4f73804264683b9f65cfe42244934f12cf5a585a62e13f6d7cd8823466d1fc1fb43ff83d694fdf6d3e0a1e7cc0c29fbd373a53885f3b3b1f318435b6c283
@@ -1,3 +1,3 @@
1
1
  module Rulp
2
- VERSION = '0.0.43'
2
+ VERSION = '0.0.44'
3
3
  end
@@ -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)
@@ -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 %= options[:gap] ? "--mipgap #{options[:gap]}" : ""
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
 
@@ -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)
@@ -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.43
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: 2016-11-27 00:00:00.000000000 Z
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