Grasshopper

algorithmic modeling for Rhino

Hey all,
I am trying to use galapagos to adjust the integer inputs of items to create lines who's length falls within a certain range. It seems pretty straight forward but for some reason when it finishes I always have like 4 lines that meet the criteria and about twenty that dont. any ideas?

N

Views: 853

Attachments:

Replies to This Discussion

I believe its your fitness function that needs work. My understanding of Galapagos is that it requires one number to optimize and it looks like your definition is feeding it 41 numbers. You'll want to create a function that sums the difference (from your target length) of all the lines and then set Galapagos to minimize. You could work the function so that it adds a large value for any difference that falls outside your tolerance so that genome is particularly unfit.
yeah that makes sense. i was thinking that the fitness would be maximized if it fell within that range but i guess thats just picking a number within the range. makes sense now thank you!
Sitting down to do it, I ended up taking a different approach. I used < > operations and logic gates to determine if a value was within your range. Then I found the total number that were true and subtracted from it the number that that were not. In this case you'd set Galapagos to maximize. I didn't have points you were using so I didn't run it, but this should provide an answer with more in the range than not. ;)
Attachments:
thanks a lot i'll try it out. I just did something similar but still without the results im looking for. thanks for your time!

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