Grasshopper

algorithmic modeling for Rhino

Hello all,

I've a configuration 'problem'. See the image for more detail.

The idea is to place bars on a line. However, there are a few rules.

Strict rules:

Start at 0, a new bar starts at 12 and it is forbidden to have two bars at 18.

Flexible rules:

These are the percentages, the accuracy of the match determines a certain amount of fit.

What exactly is the problem? Well, I don't know what a good strategy is to tackle this problem. For example, I can make a python script that randomly picks the bars and when it lands on 18 it will remove the last one and try another. I can execute that script for 20 times and pick the best fit. But that doesn't seem very intelligent, are there better ways?

Views: 377

Attachments:

Replies to This Discussion

If you want to place bars in a line of 24 units in 0, 12 and 18 in an optimal way, try to evaluate the length 0, 12 and 18 of the line. :V
Sorry i did not understand the problem. xD

Well you've to match the bars with the line, for example 6, 3, 3, 2, 3, 4, 3 would be a fit because it has a gap at 12 and covers the 18. But it doesn't really fit with the percentages. So how can I come close to the percentages and following the rules.

I guess, my problem description isn't accurate. Because now you just fill in some percentages. You've the line, your puzzle. And there are bars of different lengths, 2,3,4,6. The percentages don't tell anything about the length of the bars but the number of bars required for 'the best fit'.

If you can meet the requirements of the line and this division:

One bar of length 2

Three bars of length 3

Four bars of length 4

Two bars of length 6

Then it would be the perfect fit.

Yeah, I'm looking into the recursive solution, just like how you would solve this as a person; just randomly trying to put bars on the line and when it doesn't fit go one or two steps back in your formula.

I guess there is always a solution, only the fitness can vary widely.

Question was; is this intelligent or are there better ways.

If I'm right; you can just run that recursive thing 20 times and pick the one with the best fit, but it won't be able to narrow down solutions, because it is just randomly picking bars. It will not learn from its previous fitness like Galapagos does?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service