Skip to content

Commit 806c52b

Browse files
committed
Adjustments for pr2028
1 parent 1374545 commit 806c52b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,7 @@ index 00000000..1367f037
600600
+
601601
+ // Overall glucose effect calculated as a sum of propotional, integral and differential effects
602602
+ proportionalCorrection = IntegralRetrospectiveCorrection.proportionalGain * currentDiscrepancyValue
603-
+ // Differential effect added only when negative, to avoid upward stacking with momentum, while still mitigating sluggishness of retrospective correction when discrepancies start decreasing
604-
+ if differentialDiscrepancy < 0.0 {
605-
+ differentialCorrection = IntegralRetrospectiveCorrection.differentialGain * differentialDiscrepancy
606-
+ } else {
607-
+ differentialCorrection = 0.0
608-
+ }
603+
+ differentialCorrection = IntegralRetrospectiveCorrection.differentialGain * differentialDiscrepancy
609604
+ let totalCorrection = proportionalCorrection + integralCorrection + differentialCorrection
610605
+ totalGlucoseCorrectionEffect = HKQuantity(unit: unit, doubleValue: totalCorrection)
611606
+ integralCorrectionEffectDuration = TimeInterval(minutes: integralCorrectionEffectMinutes)

0 commit comments

Comments
 (0)