Grasshopper

algorithmic modeling for Rhino

I have an issue with galapagos threshold.

My definition shows a couple triangles and the angles in between their normals and xy plane in red text tags and a blue text tag showing intersection angle of two triangles.

I thought I could use galapagos to find out by how much I need to rotate a single triangle in order to get that one angle to exactly 120.0°

Galapagos genome would be a rotation angle on xy plane.

Fitness is something like my desired value (120.0°) or a subtraction or division, I don't understand clearly.

Now how can I make the solver stop when fitness is 120°

Threshold is confusing

Views: 2781

Attachments:

Replies to This Discussion

Galapagos can only maximize or minimize.

A ration(division) can deviate from 1 in both directions, so it's no real use here.

Typically distances (in general terms) make good fitness values. In your case, this would be the distance (Abs(x-120)) from your desired angle. Distance fitnesses can be minimized regardless of their reference values.

Hi Hannes,

Long time no see, my friend.

Galapagos can also "search" for a specific number by typing the desired number into the "Fitness" type box, on the same place where "Minimize" or "Maximize" is.
But in accordance to his definition that will not solve his problem.

Hey djordje,

threshold is actually meant to be a kind of tolerance for the fitness. Like if you only need to find one significant digit for the angle, you can set threshold to 0.1.

The solver will just abort if it finds a fitness below(or above) threshold. So here there might be a genome with an angle of 90°. If you minimize and set a threshold of 120°, this is a valid solution and Galapagos will abort, reporting 90° as best solution.

...at least, that is what I understand from Davids post here (Galapagos constrain)

Thank you for the explanation Hannes.

Now I am the confused one. I thought his goal was to fit the triangle in accordance to other two ones, regardless of the angle value.

I guess I was wrong.

thanks Hannes, problem solved! Never heard of Abs before so thanks again!

Hi Martin,

What you are trying to do is to rotate that triangle in order to fit it perfectly with other two ones, right?

In that case angle of exactly 120,000000 degrees is not what you are looking for but rather: 120.179918.

I added a new components to your code (one grouped in purple color).
Just run the Galapagos with fitness set to Minimum, and you will get your triangle fit in place.

Attachments:

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