Closed matheusdiogenesandrade closed 1 year ago
In a sense, it's a "feature" for now, CP.Implication
is only implemented for integer types: https://github.com/JuliaConstraints/CPLEXCP.jl/blob/32947f04ec2688b4aca5b74dcedd9bb72749aa01/src/MOI/wrapper_constraints_cp_reification.jl#L219-L251
The fix could be easy: I think it just amounts to https://github.com/JuliaConstraints/CPLEXCP.jl/commit/5716d1dd2f4821ff9321d2fce8232ebe52d365d7. It's currently untested: could you tell me if it's working with that patch?
Hi there.
This is a continuation of the thread created here.
I am trying to model the constraint formula
if x = 10 then p + 5 = q
. But, I am not being able to model this with CPLEXCP.jl. We could simply create a variabler
.Which could be implemented as below:
However, by doing so, for each
p
andq
, we would have to create another variabler
. Therefore, I am looking for different ways of doing this without creating a new variable. One snippet I tried was this one:Which just worked perfectly well. However, when we change the variables type to
Float
, things go strange. Let's take the code below.But, by doing so, I obtained the following error:
From the list of presented candidates, the one below seems to be the most suitable.
It seems that the function signature is forcing the affine expressions to be defined within integer coefficients, however, I do not think that the JavaCPOptimizer forces this requirement, at least so far I couldn't find anything.
Am I missing some inner step?
Thanks and regards.