Skip to content

Commit 629d7f9

Browse files
committed
Adjustments for pr2028
1 parent 806c52b commit 629d7f9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

algorithm_experiments/archive/2023-07-22_main_combined_1988_2008.patch

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,7 @@ index 00000000..e6ece1c7
550550
+
551551
+ // Overall glucose effect calculated as a sum of propotional, integral and differential effects
552552
+ proportionalCorrection = IntegralRetrospectiveCorrection.proportionalGain * currentDiscrepancyValue
553-
+ // Differential effect added only when negative, to avoid upward stacking with momentum, while still mitigating sluggishness of retrospective correction when discrepancies start decreasing
554-
+ if differentialDiscrepancy < 0.0 {
555-
+ differentialCorrection = IntegralRetrospectiveCorrection.differentialGain * differentialDiscrepancy
556-
+ } else {
557-
+ differentialCorrection = 0.0
558-
+ }
553+
+ differentialCorrection = IntegralRetrospectiveCorrection.differentialGain * differentialDiscrepancy
559554
+ let totalCorrection = proportionalCorrection + integralCorrection + differentialCorrection
560555
+ totalGlucoseCorrectionEffect = HKQuantity(unit: unit, doubleValue: totalCorrection)
561556
+ integralCorrectionEffectDuration = TimeInterval(minutes: integralCorrectionEffectMinutes)

0 commit comments

Comments
 (0)