@@ -34,9 +34,9 @@ def initialize
34
34
end
35
35
36
36
@weights . interpolate_gaps!
37
- @weights . precompute_moving_average! ( 0.1 , 0.1 , goal , rate )
37
+ @weights . precompute_moving_average! ( 0.05 , 0.05 , goal , rate )
38
38
@weights . predict_weights! ( rate , goal , 30 )
39
- @weights . precompute_moving_average! ( 0.1 , 0.1 , goal , rate )
39
+ @weights . precompute_moving_average! ( 0.05 , 0.05 , goal , rate )
40
40
41
41
precompute_inputs_at
42
42
precompute_base_rate_at
@@ -349,17 +349,16 @@ def separator
349
349
def log_since start
350
350
remaining = 0
351
351
start . upto ( Date . today ) do |date |
352
- remaining += allowed_kcal ( date )
353
352
puts
354
353
puts "#{ format_date ( date ) } : (#{ quantize ( allowed_kcal ( date ) ) } )"
355
354
puts
356
- remaining = allowed_kcal ( date )
355
+ remaining = quantize ( allowed_kcal ( date ) )
357
356
inputs_at ( date ) . each do |i |
358
357
entry ( quantize ( i . kcal ) , i . description )
359
- remaining -= i . kcal
358
+ remaining -= quantize ( i . kcal )
360
359
end
361
360
separator
362
- entry ( quantize ( remaining ) , "remaining (#{ ( 100 -100.0 *quantize ( remaining ) /quantize ( allowed_kcal ( date ) ) ) . round } % used)" )
361
+ entry ( remaining , "remaining (#{ ( 100 -100.0 *remaining /quantize ( allowed_kcal ( date ) ) ) . round } % used)" )
363
362
end
364
363
if kcal_balance > 0 and @config . has ( "balance_start" )
365
364
cost = if @config . has ( "balance_factor" )
0 commit comments