-
Notifications
You must be signed in to change notification settings - Fork 387
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
The repair is not passed to the mating argument of the MixedVariableGA class #575
Comments
Without having tried it myself, |
@blankjul Yes, actually it is what I mean and it took me sometime to figure out. The customized repair not only has to be passed for the MixedVariableGA itself, but also has to be explicitly passed to MixedVariableMating. So the initialization of a MixedVariableGA with a customized repaire would be something like below, which is not very handy to use.
If it is not by design, maybe we can consider to first check whether repair is in the kwargs, if it is, then also "add" it to the mating? |
This actually is by design. The main reason is that the mating creates I was thinking about this statement
Does this imply if you DO NOT pass it to MixedVariableGA it does not work? I would think ONLY passing it to MixedVariableMating should be sufficient. Can you quickly check if this is the case? |
Hi @blankjul , sorry for the late reply. No, only passing the repair to the mating does not work. I have a minimum working example based on https://pymoo.org/customization/mixed.html to reproduce the test. My pymoo version is 0.6.1.1. So I want to apply a simple constraint to force x['b'] + x['y'] + x['z'] = 5
I hope this is enough for you to reproduce the test and let me know if you need anything else.
|
Fair point! I have just checked the code and can reproduce it! In fact, not passing it will make the initial population to be non-repaired. But all individuals will be repaired later on! |
Not sure whether this is by design, suppose I want to have a customized repair for MixedVariableGA. But this customized repair is not passed to the mating argument
pymoo/pymoo/core/mixed.py
Line 160 in af8d260
As a consequence, the mated population may not follow the constraints defined in the customized repair unless it is specifically passed such as
mating=MixedVariableMating(eliminate_duplicates=MixedVariableDuplicateElimination(), repair=some_repair())
The text was updated successfully, but these errors were encountered: