ankane / or-tools-ruby

Operations research tools for Ruby
Apache License 2.0
171 stars 20 forks source link

Add int_var_with_integer_list_domain #52

Closed elliot-laster-ezc closed 8 months ago

elliot-laster-ezc commented 9 months ago

Adds the ability to define an int var with a list of integers as a domain. Don't love the long method name, and maybe we could use overloading?

ankane commented 9 months ago

Hi @elliot-laster-ezc, thanks for the PR! It looks like Python uses:

z = model.NewIntVarFromDomain(cp_model.Domain.FromValues([2, 3, 4, 7]), "z")

so think we should go with:

z = model.new_int_var_from_domain(ORTools::Domain.from_values([2, 3, 4, 7]), "z")

for consistency. Also, please leave out the changes to .gitignore.

ankane commented 8 months ago

Cleaning up stale PRs