Skip to content
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

Mortality implementation #80

Open
florianhartig opened this issue Oct 4, 2017 · 1 comment
Open

Mortality implementation #80

florianhartig opened this issue Oct 4, 2017 · 1 comment

Comments

@florianhartig
Copy link
Member

Comment Tankred: Right now the fitness can take values above 1. According to the mortality based reproduction, an individual can't die when its fitness is greater than or equal to 1. However, we are staying in this while loop till we reach numerOfRuns deaths. This seems to me like a huge ressource sink. The m_mortalityStrength variable tries to solve this problem. Every m_mortalityStrength'th step the randomly chosen individual dies, no matter its fitness. Still all steps in between can potentially "get stuck" for a long time.

@TankredO
Copy link
Contributor

TankredO commented Oct 4, 2017

It works right now, so i am not really keen on changing it. However, if we change it, it might be worth to look at some kind of Roulette Wheel Selection with replacement. E.g. calculate all weights once (n x m, very expensive calculation of fitness) and then select according to fitness (n x m again, but inexpensive). Now comes the bad part (at least I don't know how to do it better): when drawing one individual, it must removed from the roulette list/array or whatever data structure. This is potentially n x m for each draw. To solve this we could use a hashmap. But a hashmap potentially uses massive memory. I am sure there must be a better way to do this. I'm just leaving this here to remember it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants