Sha256: 493622eee9c3195df48ce5064e8812593203fee3d9efb5de6ec27d76dda078ac

Contents?: true

Size: 575 Bytes

Versions: 5

Compression:

Stored size: 575 Bytes

Contents

class Solver
  def initialize(filename)
    @filename = filename
    @outfile = "/tmp/#{executable}-output.txt"
    raise StandardError.new("Couldn't find solver #{executable}!") if `which #{executable}`.length == 0
    @solver_exists = true
  end

  def store_results(variables)
    puts "Not yet implemented"
  end

  def executable
    self.class.executable
  end

  def solver_exists?
    @solver_exists || false
  end

  def self.exists?
    return `which #{self.executable}`.length != 0
  end
end

require_relative 'cbc'
require_relative 'scip'
require_relative 'glpk'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rulp-0.0.9 lib/solvers/solvers.rb
rulp-0.0.8 lib/solvers/solvers.rb
rulp-0.0.7 lib/solvers/solvers.rb
rulp-0.0.6 lib/solvers/solvers.rb
rulp-0.0.5 lib/solvers/solvers.rb