algorithmic modeling for Rhino
hello
i need a kind of solver to add a list of number toghader in order to reach a goal or to get as close as possible . for example: here is the list of number (2,3,4,7,20,25) goal = 105 out put number shoud be like this (25,25,25,25,4). it always start from the biggest number in the list and use then and add them up in order get more than given value, so it will choose the next digit to test .
best
maysan
Tags:
That is wonton of usefulness!
It's the little things...
Bigger numbers get preference.
--
David Rutten
david@mcneel.com
Trying to reach the goal value with as few as possible numbers, or as few as possible different values, or as closely as possible given the initial values, or other constraints will require a totally different algorithm.
--
David Rutten
david@mcneel.com
Yes, I understand that the approach is important, this is why I raised the question. In this particular example, I would expect that the '25-20-20-20-20-solution' is best, looking at the constraints that you mentioned above.
Though, ultimately this relies on the preference of the user.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by