-
Notifications
You must be signed in to change notification settings - Fork 368
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
Defining domain specific individuals #483
Comments
Is the only change to store some additional data? If yes, you can store attributes direclty in
Then each individual has the attribute |
Thank you, yes I have already tried this. It works for me only for storing boolean or numerical values. Maybe strings also?!. But I want to store objects, as I have a lot of simulation parameters in a simulation output. Is it possible to store objects? Of course I could try to store it as strings and then create objects out of strings, but this is not really convenient. |
It should also work for dictionaries. Checkout the following code:
Does this also work for your use case? |
No it does not work. When I execute your code, I get the following output on my machine:
|
Interesting. When I run the code I am getting
|
Have you found what your issue was? Can you try a different Python and/or numpy version and see if you get the same output? |
So I have tried for now the latest Pymoo version with both Python3.10 and Python3.8 it failed. See here: https://colab.research.google.com/drive/1e-k8pTzDM0jq0PvbF4a4HYPRW4RVD6lT?usp=sharing |
Can you check if this issue persists in pymoo 0.6.1? I just ran your notebook and I think it should be fixed. |
I am pretty confident it is fixed. Please comment here and ask me to reopen if not. Thanks! |
Thank you, it works now. Can you maybe shortly elaborate what the reason was? In case I encounter sth similiar in my personal projects. |
Unfortunately, as much as I would like to I can not pinpoint this to a specific commit. |
I have developed a framework (https://git.fortiss.org/opensbt/opensbt-core) based on pymoo for applying heuristic algorithms for critical test case generation in the automated driving domain.
In this domain, an individual is basically a driving scenario (velocity of the car, position of the car etc...) and evaluation of the individual requires simulating the driving system for that scenario, yielding simulation traces. The problem is, I need to store that traces in the individual. As I understand, the current individual implementation does not allow me to subclass it to define a domain specific individual. For that reason, I am using monkey patching do replace the basic individual by my specific one:
https://git.fortiss.org/opensbt/opensbt-core/-/blob/main/model_ga/individual.py?ref_type=heads
https://git.fortiss.org/opensbt/opensbt-core/-/blob/main/run.py?ref_type=heads#L3-4
Is this there any other workaround I have missed?
Thank you.
The text was updated successfully, but these errors were encountered: