C#C
C#2y ago
Angius

Random temperature curve generation too biased

I'm trying to create a system for a game that would randomize temperature. Not fully randomly, though, I need a more natural curve.
So, my idea: introduce a bias that would change towards zero, the faster the more the current temperature diverges from zero. That zero could later be replaced with any desired temperature.
Unfortunately, most of the charts I could generate come out horribly biased. Sometimes they're in range -80 to 0, sometimes -10 to 100, very rarely (about 15% chances) are they more sane in a - 20 to 30 range, for example.
Here's the source code and my most recently generated charts: https://github.com/Atulin/TemperatureSimulation
out.png
Was this page helpful?