Grasshopper

algorithmic modeling for Rhino

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

Views: 1896

Replies to This Discussion

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.

Hey Daniel,

thanks for the tip! Sometimes asking can save a lot of time :) I know I am not the first one trying this (and failing) so maybe there can be a hint in the tooltip (I cannot look it up right now, forgive me once more if it's already there).

Having some kind of convergence criteria can be very helpful, but also blocking an efficient evolutionary optimization - e.g. a input configuration where convergence is only reached after a long time interrupts the evaluation of the other 10000xx individuals ..

Looking at your meshing experiments we talk a lot about trying that out for dynamic remeshing within an optimization cycle. Also for basic form-finding before karamba that does refine the shape 'somehow more exactly' or different, simply with another approach that is better suited for engineering purposes. Looking onto non-linear calculation with karamba that have been prepared by kangaroo.. or also, if someone has no access to non-linear calculations to make a first estimate on the behaviour within an evolutionary loop..

Having an API of course always is good :)

Thanks,

Robert

Hi Daniel,

thanks for the amazing plugins and sharing this trick, but I still wonder how to remain the vividly physical feeling under the method you mention(two booleans and high SubIterations like 1000) ? Or it couldn't be done in this version?

Because I use polygon curve and rotate it to be the initial closure shape and form a mesh with PressureForce. I want to change the initial shape by manipulating segments, radius etc. As I know after browse the forum, since the anchor points changed, it need to be reset manually to get simulated again, but I want to do it automatically. So is there any solution? 

thanks again!


Chinghang

Hi Daniel!

I tried your tip, but while the Out and ParticleOut outputs are correctly branched, the GeometryOut is not: it has only one branch containing all of the geometry.
Here you have a simple example of a catenary obtained in kangaroo. As you can see in the output I have both the catenary and the base line. I know that in this case I could use the polyline instead of the individual segments, so to have only two objects in the output, but this is not always the case. Is there any generally working method to sort them out?

thanks a lot!

Matteo

Attachments:

I found an easy way of achieving this was to use the listitem component. Especially if you graft the geometry input then for every piece of geometry you will get a list of outputs equal to the number of major iterations. Then the last item in the list will be the relevant one. 

However... even easier is to use the new ZombieKangaroo component which allows you to do everything you want without having to do any tricks and will output only the final geometry. It's in the latest release of Kangaroo. 

As jjsolly says, the new ZombieKangaroo component in the latest release addresses exactly this issue.

The way I would recommend to use it is to set up your simulation using the regular 'live' Kangaroo component, and see that things are working correctly, then just shift all the wires over to a ZombieKangaroo, and it outputs the final result directly without animation.

Hi Daniel,

I am doing the simulation with mesh machine as well but in that case, I need to use a reset button for remeshing. And then the mesh output of mesh machine is my input for zombie solver. Everything works fine but when I run Galapagos simulation some problems occur maybe because of the reset simulation from MeshMachine. 

Thank you

hex%20shell%20circle%20packing.gh

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service