Sha256: e20ed1e39739bc3e47ad75b3a524e5c82416e656d80a0812098a863fec46b90d

Contents?: true

Size: 598 Bytes

Versions: 17

Compression:

Stored size: 598 Bytes

Contents

require_relative 'test_helper'
##
#
# Given 50 items of varying prices
# Get the minimal sum of 10 items that equals at least $15 dollars
#
##
class InfeasibleTest < Minitest::Test
  def setup
    @items       = 30.times.map(&Shop_Item_b)
    items_count = @items.sum
    @items_costs = @items.map{|item| item * Random.rand(1.0...5.0)}.sum

    @problem =
    Rulp::Min( @items_costs ) [
      items_count  >= 10,
      @items_costs  >= 150_000
    ]
  end

  def test_simple
    each_solver do |solver|
      assert_raises RuntimeError do
        @problem.send(solver)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rulp-0.0.44 test/test_infeasible.rb
rulp-0.0.43 test/test_infeasible.rb
rulp-0.0.42 test/test_infeasible.rb
rulp-0.0.41 test/test_infeasible.rb
rulp-0.0.40 test/test_infeasible.rb
rulp-0.0.39 test/test_infeasible.rb
rulp-0.0.38 test/test_infeasible.rb
rulp-0.0.37 test/test_infeasible.rb
rulp-0.0.36 test/test_infeasible.rb
rulp-0.0.35 test/test_infeasible.rb
rulp-0.0.34 test/test_infeasible.rb
rulp-0.0.33 test/test_infeasible.rb
rulp-0.0.32 test/test_infeasible.rb
rulp-0.0.29 test/test_infeasible.rb
rulp-0.0.27 test/test_infeasible.rb
rulp-0.0.26 test/test_infeasible.rb
rulp-0.0.25 test/test_infeasible.rb