Grasshopper

algorithmic modeling for Rhino

Is there a way to control galapagos via coding?

Hi,

I am doing something with galapagos these days and I found I need more control on this nice component. For example, I need my code(C# component in grasshopper) detect whether galapagos has finished solving and continue excecuting the code in the C# component. Sometimes, I need C# component to start the galapagos component rather than clicking the "start" button inside galapagos. 

Could you tell me if there's a way to do this? or, if I use visual studio instead, is there a way to reference the galapagos assemblies and control the galapagos in that way? If this is the way to go, is there a help doc on the library of galapagos? I used the .NET Reflector to see the the galapagos.dll and could not figure out a way to use this.

 

Thanks!

-Jerome

Views: 768

Replies to This Discussion

Hi Jerome,

 

Galapagos is a separate assembly, so if you want to access it you'll either have to use Reflection all the time (major pain in the *ss) or somehow reference the assembly.

 

I actually can't think of a way to see whether Galapagos is done or not, and I wrote the damn thing. The window and the Galapagos component are defined in the GalapagosComponents.gha assembly, not Galapagos.dll.

 

I can't help but feel that what you are trying to achieve is much broader than just finding two functions on Galapagos, but it's hard to tell.

 

I can add additional functions directly on the Galapagos component that would allow you to get this information and maybe even start a solution. You'll probably need to use Reflection to access these, but we can minimize the pain involved. Does this sound like a solution of sorts?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you, David.

I am not a veteran in coding, so I always hesitate to use genetic algorithm packages available out there while there's a so easy-to-use Galapagos components inside grasshopper. Adding additional functions on the Galapagos would be a fantastic solution to this problem. I know enhancing this component is not an easy job, but I still want to ask when will the next generation of Galapagos component released?

 

Thanks!

-Jerome

Hopefully not too long from now. I'm working mostly on custom ribbon layouts now but I'm sure I can sneak in a few additions to Galapagos. It doesn't sound very difficult so probably won't take more than an hour to add some basic properties and methods.

 

I'm hoping to release sometime late next week, but I tend to underestimate the time needed to make a UI from scratch (still).

 

At any rate, I can easily release a small Galapagos update (no installer, just a new gha).

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you David!

Looking forward to this new gha!

 

Thanks!

-Jerome

For me at least, using reflection isn't a huge deal breaker.  A bitch, yes, but definitely worth it.  Having control of starting/stopping a solution would be definitely needed.  I'm not sure if there could be (or are) events that are fired at the end of each iteration with details and the ability to stop the solution through the event.  I'm somewhat hesitant to mention that because as big a pain as Reflection is, adding events through Reflection is pulling teeth.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service