How to trigger "ladybug_fly" component within Octopus

Greetings. I have a workflow that uses the “ladybug_fly” component to animate a slider with 6 steps. At each step, a point in time daylight analysis is run, and I am using a data recorder to record the results of each simulation and stream to a .csv file. On the sixth and final step, i use a component called “Run Executable” to run some custom R scripts that read the .csv file, and the results of the R script are then read back into Grasshopper. This all works great when i am manually triggering the “ladybug_fly” component using the boolean toggle.

I would now like to hook a few parameters up to Octopus, and have the process run automatically. However, i am challenged as to how i would trigger the “ladybug_fly” component within Octopus.

the “ladybug_fly” component is triggered with a Boolean True/False, that gets reset to False once it is done. And my understanding is that it requires a human “click” to True to get the process going.

Since i am just using it to animate a single slider, I suppose i could also just try to “animate” the slider. But in either case, i am struggling to find a way to run a loop within Octopus, where Octopus triggers the loop (e.g. “ladybug_fly” component) automatically at each optimization step.

Any suggestions would be appreciated. The workflow is rather elaborate, but it boils down to this issue stated above.

Hi @Octagon26,

I’m not sure if that will work and not because you have to set the runs manually. Each run of fly component triggers a new Grasshopper Solution. I assume Octopus collect the results as each solution change which means it will collect the results 6 times.

If it’s only a single slider why don’t you use DataTrees to implement all 6 iterations in a single run?

As Mostapha said - if its only 6 values on a single slider you could just “extract” each value.
In case you still wanted to try (although Im not sure if it would solve your problem) you could try something like that: Put data recorders on all your genome sliders (ones connected to octopus). When you right click on these you can set a record limit of 2 values. Than add an expression: If (first value)=(second value), 0, 1. Mass addition on these values, and expression: If MassAdditionResult>0, True, False. Connect this expression to ladybug fly. This way it would “trigger” fly each time there is a change on at least one slider (so each Octopus iteration).

That is quite messy :). You could also check this thread on old GH forums

Wujo and Mostapha,

Thanks for the suggestions. Indeed, the slider with 6 values is only a test of the workflow, indicating daylight simulations for 6 points in time over the year. Once i get that working in an optimization loop (e.g. Octopus) the goal would be to increase to 100s or 1000s of point-in-time simulations (per each Octopus iteration!).

…Basically a brute force approach using “regular” Radiance simulations because i am using LARK spectral components.

This might be a good case to try Honeybee[+] and develop your own component to generate all the cases on each iteration and read the result back. Not sure how LARK is using Honeybee but it should be translatable to Honeybee[+]. You can find the latest API documentation here:

I can also support you with some simple examples if you decide to try this workflow.

In the short term, i tried Wujo’s suggestion to trigger “Let it Fly” and got it working. the catch is that the “Let it Fly” component requires a manual mouse click each time it runs for the human to approve the number of iterations. This is a valuable feature, but i would like to disable it in this case so that i can run in a loop. I realize I am going in a somewhat messy route, but if i can get the loop going then I can see what my results look like and in the long term i would explore redeveloping the whole thing in Honeybee[+], which i have not yet had time to start exploring, but is the bright future …

I haven’t tested it but commenting out these lines should remove the message for approving the iterations: