Help with changing number of gene sliders between generations

Hello everyone!

First of all, I want to say thanks to the team behind Wallacei! Having an open-source software with such capabilities, clear documentation, and tutorials is extremely helpful!

I am working on a script to optimize the spatial orientation of several building “blocks” on a grid. The genes include the rotational orientation of the grid itself, a parameterized “courtyard” in the middle, and, of course, the height of each “block.”

However, since the number of individual “blocks” changes in each iteration according to the first two sliders listed above, I am using a script to define a custom gene list, whose length is updated each iteration according to the number of blocks that can fit on the grid.

However, I am running into issues with Wallacei as it still assumes the initial number of genes to be valid throughout the simulation, which creates problems such as it not correctly manipulating all the sliders.

What could I do to overcome this problem? One solution I can think of is to just have a long list of genes for the “floor height” gene list where some of the sliders are simply placeholders with no real effect, but I believe that would also lead me to erroneous results.

Thank you in advance for all your help!

Help.gh (106.1 KB)

Hello,

You can not use the variable length Gene pools objects. Some of the plugins provide this but it is not suitable for Wallacei. And theoretically it also does not align with the principles of evolution in nature. What you can do is to have a long list of genes and split it with the desired number of genes at every iteration. You can use split list component and for the length, you can get that information from an earlier operation upstream.

1 Like

Hello Milad,
Thank you so much for your swift and insightful response! Splitting the list seems to have worked!

1 Like