Use an exponential function for setting boundary limits for a fitness function?

fitnessfunction.gh (30.9 KB)
I am writing a fitness function for Galapagos and I want certain values not to exceed a boundary limit. I would like to use an exponential function for this, which will go very steep if it exceeds a limit, so I can set Galapagos to minimize and then Galapagos will prevent to exceed the limit value.


I would prefer to use e^x because of its properties (45degrees at x = 0). But my computer is having a real hard time cracking these large numbers and many times it crashes. (And also when I graph e^x ir any other exponential function by plugging in a range of numbers in de function component, the Rhino viewport is not displaying the output in any of the side views, but only in perspective mode.)

So I am looking for a way to bypass this problem.

So one of the things I came up with not to use ‘e’ but a number closer to 1 to make the graph less steep, so I can make sure all the values of my grasshopper definition stay within a range that will prevent the numbers to get too big to handle. Something like: a^(X+b), with ‘a’ for example 1.05 instead of e, and to with a value that will give 45 degrees at zero. I have yet to find out how to calculate ‘b’ for that, that would be my goal.

Could there be other possibilities as well?

Any useful suggestions, information or resources would be very much appreciated!