-
Notifications
You must be signed in to change notification settings - Fork 60
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
Integer Problem with MILX and MIPM #99
Comments
Do you have an error stacktrace? |
Hi, Thanks, the code works fine with SPX, but with MILX, it returns me the following inexact error
|
Did you use Also check the offspring vector type, it should be |
No, I have been using MIPM throughout.
I see that MIPM preserves integer types correctly Evolutionary.jl/src/mutations.jl Line 238 in cf3f2fb
Evolutionary.jl/src/recombinations.jl Line 337 in cf3f2fb
For example, in the paper you cite, it states "In order to ensure that, after crossover and mutation operations have been performed, the integer restrictions are satisfied, the following truncation procedure is applied." |
The error trace points to |
This is definitely your code project and so I am not as familiar, but it seems to me that the error is appearing because you can't copy a float into an int in line 108 of |
Correct, so your offspring array should allow such change. If the offspring is Int vector, you'll get the error. |
Thanks. Exactly, but the paper states that "In order to ensure that, after crossover and mutation operations have been performed, the integer restrictions are satisfied, the following truncation procedure is applied." The offspring array is defined here automatically to inherit parent's type Line 69 in cf3f2fb
Shouldn't MILX be automatically truncating (if it supports integer inputs) for the elements of the parent vectors that are integers? |
The paper discusses an additional truncation step (in section 2.4 of the paper), which is missing. The |
I agree; just so we're on the same page, I think you're doing the truncation in Evolutionary.jl/src/mutations.jl Line 238 in cf3f2fb
but not in |
Yes, you're correct. However, I'm not sure that adding the truncation to the MILX will be a good move. The resulting offspring will always have integer values. I need to reread the paper about that issue. |
Hi,
Thanks for the great package.
I've been testing out an integer minimization problem with GA using
mutation = MIPM(lx,ux)
andcrossover = MILX()
based on https://github.com/wildart/Evolutionary.jl/blob/master/examples/mixedint.jl.I have been getting an Int(some float) error. I am wondering if it's due to the fact that MILX needs a truncation that MIPM performs here
Evolutionary.jl/src/mutations.jl
Line 238 in cf3f2fb
Thanks!
The text was updated successfully, but these errors were encountered: