I’m trying to use genetics algorithms (GA), but i got a bug where each time the solver change the gene pool, it record the previous fitness.
though my research it seems it’s because there was 4 “ticks”, or “calculus shockwave” (i don’t know the real word) where the first still using the previous gene pool data, and only the second relies of the new genes. Then, the GA only reads the first one. At the end, i’m just facing wrong association of fitness and genes, resulting in a non-converting problem.
I tried to get back to the “split tick” source, which i blamed on “stream gates” from heteroptera plug-in. After deleting them from my gh, i still had 2 ticks. These last split seems to come right after the gene pool, but i wasn’t able to locate it neither understand what the hell is happening.
I used “data record” to register each tick. Hre is the result
Basically after the initial expiration ‘shockwave’ the components are calculated in back-to-front order, triggering calculations from their expired upstream components.
This gets quite complicated if you work with components that store data between solutions or remotely trigger solution refreshes and changes in other components, as I believe most of these genetic-algorithm plugins behave.
However It’s probably not a good idea to rely on the invisible back-to-front ordering for the correct operation of your code, as that can easily change when copying and refactoring parts of your definition.
Have you tried using the Data Dam component to explicitly partition your definition into stages? This way you can be sure that whatever is on the left of the dam is entirely finished before proceeding to the right side.
That’s true I mostly run into these issues with the Kangaroo solver and having to do expensive refreshes on the canvas multiple times to get data to propagate fully - in that context Data Dams really help with understanding and controlling the flow.
@hobbes.stocker What are these mysterious looking components?
The vba component only calculate once and contains :
If x <= 2 Then
A = 0
Else
A = 1
End If
I tried to test this part in stand-alone, and everything is normal.
@qythium these are “heteroptera” component, i already use stream gates, but their “streaming” component family contains other element i tried, to solve my problem. @DavidRutten have you an idea of what is happening ?
Can you replace the VB script for a ‘larger than’ component, just to see what happens. It should be capable of producing the same functionality and the problem starts right after. Just a test.
I finally found which component made all that mess :
the stream freeze/gate component from heteroptera is the one !
by replacing them with the “stream filter” component, I finaly have 1 expiration wave after each actualization of my gene pool, thus, only one fitness value per actualization. Now fitness value and gene pool are again linked together !
My coworker just told me he never had this kind of problem with this component. It’s maybe a update or something that create that.
Robert vier (octopus main dev) gave me really cool info about how the all thing work : so check also this post : Octopus : Uncomprehensive results