Parametrically enabling/disabling Galapagos genomes

Hi everyone,

I’m trying to set up a definition where some parameters should be active as Galapagos genomes, and others I’d like to switch off and just use as fixed values. Basically, in some runs I want a slider/genepool to be part of the optimization, and in others I want to disconnect it and replace it with a default number.

Is there a straightforward way to programmatically connect/disconnect a slider or genepool from Galapagos? Ideally without extra plugins, but if MetaHopper or a small script is the practical route I’d be open to that.

Also, if there are other GA optimizers for Grasshopper that support this kind of on/off genome setup more directly, I’d be interested to hear recommendations.

Thanks!

Sorry if my question is silly: couldn’t you pass data streams into a gate or filter with a True/False toggle or a value list based on whatever criteria you have (use sliders/genes vs fixed values)?

Thanks René, not silly at all — I had the same thought initially (or maybe GPT did :D).

Most GA solvers use a kind of special connection that doesn’t behave like a traditional wire between components. These wires are preprogrammed to snap only onto certain components like sliders or genepools. Some other GA solvers (like Tunny) handle sliders/genepools more like normal wires, but they’re probably transferring the component ID instead of just data. Because of that, adding gates or filters didn’t work in my experiments.

I also tried to “hack” it by setting up a Genepool with a single zero range — basically one fixed value — but Galapagos gave me an error. Looks like zero-range values aren’t possible.

Oh dear, then I tried using Heteroptera’s Pool Controller to set 0 values, and that actually managed to deactivate the Genepool while keeping Galapagos happy with no errors. That’s great!

So it looks like the case might be resolved, but I’ll wait to see if anyone else has more ideas.

Got it - sounds like both gpt and I should be banned from answering! DEFINITELY foolish of me to make that suggestion incorrectly. I might not use galapagos daily, but have used it enough times to know this and still forgot!! I must have thought you meant to filter/alternate the fitness value, not the genomes, which is not the same question/problem and still obviously that’s not what you typed lol. Oops! I’m glad you got it work!

giphy

No worries René - your comment pushed me to test again, I learned how Tunny with Stream/Dispatch works and even found that 0-value Genepool trick that solved one of my issues :raising_hands:

Edit: still hunting the option for slider deactivation!

Hi @DanielK1

Most GA solvers use a kind of special connection that doesn’t behave like a traditional wire between components. These wires are preprogrammed to snap only onto certain components like sliders or genepools. Some other GA solvers (like Tunny) handle sliders/genepools more like normal wires, but they’re probably transferring the component ID instead of just data. Because of that, adding gates or filters didn’t work in my experiments

Tunny’s wires may look like ordinary colored wires, but as pointed out, they behave differently from normal wires. They perform many tasks, such as retrieving component IDs, changing values, and expiring at the appropriate time.

No worries René - your comment pushed me to test again, I learned how Tunny with Stream/Dispatch works and even found that 0-value Genepool trick that solved one of my issues

Tunny can functionally optimize a specific variable within a genopool connected by wires by fixing it to a constant value during optimization.

However, you cannot change it during optimization.

You must stop, change the setting, and restart the optimization.

Hi,

I’m not trying to switch genomes/variables during a run, but to set up different configurations before starting. Right now I have ~20 Galapagos components (one per setup), which is hard to manage. Ideally I’d like a parametric way to enable only the relevant sliders/genepools so a single GA component can be reused.

Any idea how to fully disable a connected slider so Galapagos (or other solvers) won’t treat it as part of the search?

what about something like this?

galapagos connects to all genomes but you select wich ones actually influence your fitness function. the rest just goes randomly, without having any influence and without you caring about them