I'm trying to initialize this class from the JaCop constraint programming library from jRuby. I am using the correct type of arguments, but for some reason I keep getting this error message:
NameError: no constructor for arguments
(
org.jruby.RubyArray,
org.jruby.RubyArray,
org.jruby.RubyArray,
JaCoP.core.IntVar,
JaCoP.core.IntVar)
on Java::JaCoPConstraintsKnapsack::Knapsack
(root) at rb/knapsack.rb:24
The code that it points to is this:
k = Jacop::Knapsack.new(@values, @weights, quantity, knapsackCapacity, knapsackProfit)
The signature of the Java class constructor is this:
public Knapsack(int[] profits,
int[] weights,
IntVar[] quantity,
IntVar knapsackCapacity,
IntVar knapsackProfit)
I don't understand why jRuby complains that constructor is not found because it should be able to find this.