Kangaroo

THIS FORUM IS NO LONGER ACTIVE. PLEASE POST ANY NEW QUESTIONS OR DISCUSSION ON:

https://discourse.mcneel.com/c/grasshopper/kangaroo

The discussions here are preserved for reference, but new questions posted here are likely to go unanswered.

Kangaroo is a Live Physics engine for interactive simulation, optimization and form-finding directly within Grasshopper.

Reset Simulation Override - galapagos etc.

Hey Daniel,

have you ever thought of a feature for kangaroo that enables it to be used within an e.g. galapagos evaluation network? Basic funtionality is there by setting the internal iterations to a sufficiently high number so the final result is immediately put out.

The main hook is that you have to alternatingly switch the boolean toggle for resetting the simulation which is a bit tricky (or I just didnt figure it out):

- option 1: loop kangaroo with something like hoopsnake (which cannot be triggered but also must be started manually, so this option is no option)

- option 2: a setup of data dams, counters and whatsoever to use every second evaluation cycle generated by galapagos (or similar) to reset the simulation. the other set of cycles is artificially "thrown away" by setting the fitness in that iteration very very bad. Also you have to make sure to maintain the same input geometry to kangaroo for two cycles - and there's the point i havent figured out so far: the output of the actual kangaroo result then does not correspond to the genome galapagos had intended for it ...

so i kindly ask for the possibility of an additional setup-input for kangaroo that says something like 'auto-reset' and 'forces kangaroo physics to automatically reset every time it's inputs get expired/changed'.

i know kangaroo makes use of static variables to be able to provide its 'live physics feeling' over changing inputs, but sometimes it's also VERY useful to use it e.g. as a little helper for relaxation etc. just within an bigger optimization setup.

Would be great if you could think about that a second,

keep up the great work

Best

Robert

  • up

    Daniel Piker

    Hi Robert,

    I'm quite excited about seeing more of how kangaroo can fit together with other optimization techniques, so definitely want to do all I can to help here!

    The basic trick I have used in the past to get it to work with Galapagos or HoopSnake is to input a list of two booleans "True,False" into the SimulationReset input of Kangaroo, with the SubIterations setting set fairly high. The output will then have 2 branches, the second one being the relaxed one. Thus there is no need for a timer, and the solution will recalculate whenever the inputs are changed.

    Hope that makes sense.

    I'm also thinking in the next version of adding the option to output the result only when the total kinetic energy has fallen below some user defined threshold...

    (It will also have a significantly sped up Reset step, because I initially wrote it thinking this would only be run quite rarely at the start of a simulation, so it was totally brute-force, comparing all points to each other to make the connections, but there are some simple ways of improving this)

    ...and in the longer term I am working on an API that should make using Kangaroo in custom loops more flexible.

    6