Due numerial rounds, in the optimal solution of my model, value.(x) are not binary.
How can I round value.(x) where the index h range depends on i? I have tried round.(value.(x)) but this does not work.
This should work for the output. Perhaps even round.(Int, value.(x)).
But you can’t use this as a constraint inside the model. Solvers do not use exact arithmetic. They use a tolerance to check if the variable is “binary” so you can get small values like 1e-8 or nearly one values like 0.99999999 or 1.00000001. This should be considered “0” and “1” for practical purposes.