-
Hi Julian, Please, I need your help to fix my code using Pymoo in Python. Next, I will explain what I need to do: My code starts finding a "value simulated" as follows:
This "value simulated" is used in class "MyProblem" in order to affect the behavior of the constraint "g1" as follows:
I need this "value_simulated" affect constraint "g1" only during generation #1. During next generations "value_simulated" must be replaced by the min value that will be found in the population. By that reason I coded the class "Callback" to detect this min value, but I don't know how to call this value in the next generations in order to replace the "value_simulated" in the problem, callback is coded as follows:
I used the function "notify", but I suspect that the right function is "update", but I don't know how to use the function "update". The last part of my code is the following:
Could you help me please to fix my code in order to affect constaint "g1" correctly in each generation? I will appreciate your help a lot! Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
What about passing the evaluation population during initialization? Does this resolve this issue? |
Beta Was this translation helpful? Give feedback.
Thank you Julian for your advice.
I tried by declaring a global variable inside the Callback Class and with this I was able to use this variable inside the constraint in every generation.