Sunday 15 July 2012

java - Fuel chart smoothing algorithm -


I am developing a fleet management system and is one such thing that the fuel consumption of the vehicle comes from any data that comes from cannabis Used to be).

If any data value is between 0 and 100, this means percent, so if I get an integer 45, then that means the fuel in the tank is 45%.

However, if the vehicle is running, there may be incompatible data due to the ship's physics. For example, there may be a data series:

76,76,75,74,73,73,71,71,70 & lt; - This is a good pattern because it shows how fuel is going down. / P>

76,70,75,76,77,76,74,74,73,72,69,72,73,73,73,72,71 & lt; - This is not a good pattern due to leap, the fuel in the tank is not consistent and the figures I receive are not suitable for the user to display.

I want to make the prices smoother, but how many values ​​do I choose at a time, the result is different.

The main problem is that sometimes I have to get out of the moment to drain and refuel, which I should show in the chart, and it should not be smooth.

What kind of algorithms can I use to authenticate and represent my chart for the user?

Are there ways to fix refueling / drainage? If so, you can dynamically change your algorithm at that time.

Otherwise, I would recommend using exponential lubricant

Let D (0

With proper weight loss, it appears that "banship" will be removed, yet the incidence of fuel will be shown as a result.

This is not the only option, one example is more of the algorithm, but I hope you find it useful.

Short Editing: I did not realize that the exponential smoothing was the proper name. I used the technique only when displaying the frame rate in making games, so thank you to Kemper.

No comments:

Post a Comment