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

Logical expressions not supported #366

Open
blegat opened this issue Oct 29, 2024 · 1 comment
Open

Logical expressions not supported #366

blegat opened this issue Oct 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@blegat
Copy link

blegat commented Oct 29, 2024

We would like to use InfiniteOpt as interface for https://github.com/dionysos-dev/Dionysos.jl. For this, we would need to use || constraints but we get into an error with InfiniteOpt:

using InfiniteOpt
model = InfiniteModel()
@infinite_parameter(model, t  [0, 1])
@variable(model, x, Infinite(t))
@constraint(model, (x(0) <= 1.0 || x(0) >= 0.0) := true)

give the error:

ERROR: `_all_function_variables` not defined for expression of type GenericNonlinearExpr{GeneralVariableRef}.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _all_function_variables(f::GenericNonlinearExpr{GeneralVariableRef})
   @ InfiniteOpt ~/.julia/packages/InfiniteOpt/2oc8E/src/expressions.jl:609
 [3] add_constraint(model::InfiniteModel, c::ScalarConstraint{…}, name::String; is_info_constr::Bool)
   @ InfiniteOpt ~/.julia/packages/InfiniteOpt/2oc8E/src/constraints.jl:292
 [4] add_constraint(model::InfiniteModel, c::ScalarConstraint{…}, name::String)
   @ InfiniteOpt ~/.julia/packages/InfiniteOpt/2oc8E/src/constraints.jl:285
 [5] macro expansion
   @ ~/.julia/packages/JuMP/V9nZm/src/macros/@constraint.jl:173 [inlined]
 [6] macro expansion
   @ ~/.julia/packages/JuMP/V9nZm/src/macros.jl:393 [inlined]
 [7] top-level scope
   @ ~/.julia/dev/Dionysos/dionysos-main/examples/planning_path_infiniteopt.jl:68
Some type information was truncated. Use `show(err)` to see complete types.
@blegat blegat added the bug Something isn't working label Oct 29, 2024
@pulsipher
Copy link
Collaborator

Hi @blegat,

I believe this will not be a problem with the master branch this it has updates to the nonlinear expressions. Can you please confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants