I'm trying to create a fitness function, where I can calculate the score of a value. The closer it gets to x, the higher the value. Yes it could be linear, but I'd prefer to have it exponential. I just don't know what term to even google for anymore...
Basically the idea is the same as a 100 meter dash runner going from 23 seconds to 22 seconds is not a big deal, but going from 9.9 to 9.8 is a dramatic difference. Except that in this case, instead of just above a min value, I want it to be as close as possible. So for example cutting a board in half, the closer to the middle on either side, the better the score.
So in the graph above, y is the max score I want to assign, it could be say 100, 1000, etc. pts. In terms of ideal value, I'd like to be able to say the ideal is maybe 12 and they managed to achieve 11. What score (y) do they get?
They should also be able to score anywhere from 0 to infinity, but as it gets closer to 0 and as it goes to infinity (or a max value), how do I determine the score?
In other words, what would the equation be?