Closed joegaudet closed 3 months ago
model = ORTools::CpModel.new a = model.new_bool_var('a') b = model.new_bool_var('b') c = model.new_bool_var('c') model.add([a,b,c].sum < 1) undefined method `+' for an instance of ORTools::BoolVar (NoMethodError)
Hi @joegaudet, for the constraint solver, you'll need to use model.sum([a, b, c]) instead of [a, b, c].sum.
model.sum([a, b, c])
[a, b, c].sum