| File src/algs.cpp changed (mode: 100644) (index 1fae56c..5b54826) |
| ... |
... |
SmoothingAlg::estimate(int current, int total, int time) |
| 419 |
419 |
{ |
{ |
| 420 |
420 |
float v = float(current - lastProgress)/(time - lastTime); |
float v = float(current - lastProgress)/(time - lastTime); |
| 421 |
421 |
float a = alpha/100.0f; |
float a = alpha/100.0f; |
| 422 |
|
speed = v*a + speed*(1.0f - a); |
|
|
422 |
|
|
|
423 |
|
if (lastTime == 0) |
|
424 |
|
speed = v; |
|
425 |
|
else |
|
426 |
|
speed = v*a + speed*(1.0f - a); |
| 423 |
427 |
|
|
| 424 |
428 |
int eta = (floatEq<0.1f>(speed, 0) ? lastEta : (total - current)/speed); |
int eta = (floatEq<0.1f>(speed, 0) ? lastEta : (total - current)/speed); |
| 425 |
429 |
|
|
| File src/etabench.cpp changed (mode: 100644) (index 7b9a769..2384632) |
| ... |
... |
main(int argc, char *argv[]) |
| 97 |
97 |
std::make_unique<GravityAlg>(), |
std::make_unique<GravityAlg>(), |
| 98 |
98 |
std::make_unique<ImmediateAlg>(), |
std::make_unique<ImmediateAlg>(), |
| 99 |
99 |
std::make_unique<LookBackAlg>(20), |
std::make_unique<LookBackAlg>(20), |
|
100 |
|
std::make_unique<SmoothingAlg>(10), |
| 100 |
101 |
std::make_unique<SwitchAlg>(), |
std::make_unique<SwitchAlg>(), |
| 101 |
102 |
std::make_unique<WindowAlg>(20, 1.0f) |
std::make_unique<WindowAlg>(20, 1.0f) |
| 102 |
103 |
); |
); |
| |
| ... |
... |
main(int argc, char *argv[]) |
| 109 |
110 |
)), |
)), |
| 110 |
111 |
std::make_unique<ExponentialAlg>(1), |
std::make_unique<ExponentialAlg>(1), |
| 111 |
112 |
std::make_unique<ImmChangeLimitAlg>(), |
std::make_unique<ImmChangeLimitAlg>(), |
| 112 |
|
std::make_unique<SlownessAlg>(1), |
|
| 113 |
|
std::make_unique<SmoothingAlg>(10) |
|
|
113 |
|
std::make_unique<SlownessAlg>(1) |
| 114 |
114 |
); |
); |
| 115 |
115 |
|
|
| 116 |
116 |
auto profs = make_unique_vector<Profile>( |
auto profs = make_unique_vector<Profile>( |