Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binary variables to be evaluated as true or false #250

Closed
Wikunia opened this issue Feb 12, 2021 · 0 comments
Closed

Allow binary variables to be evaluated as true or false #250

Wikunia opened this issue Feb 12, 2021 · 0 comments

Comments

@Wikunia
Copy link
Owner

Wikunia commented Feb 12, 2021

Currently one often has to write

@constraint(m, bool_var == 1 || other_bool_var == 1)

instead of

@constraint(m, bool_var || other_bool_var)

one should also support

@constraint(m, !bool_var || other_bool_var)

I think this is fine when bool_var is binary even though there is no truthy and falsy in Julia.

One needs to create some JuMP parse functions for this and create a new linear equal to constraint and flag it as check_for_binary_variable to later check if it's a binary and otherwise throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant