Modified Master to replace profile sens with Chris Wilson's Dynamic ISF in OpenAPSSMB.

The rule of 277700 ISF using current BG is used for all predictions, while for dosing, if delta >=0 positive, or eventual BG > target bg with negative delta, current bg is used, however, if delta is -ve, future bg is used.
This commit is contained in:
t_j_s 2022-02-12 18:51:54 +00:00
parent f98175755e
commit 809827eb9e

View file

@ -736,7 +736,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
console.log("EventualBG is" +eventualBG+" ;");
if( glucose_status.delta >= 0 || bg > 60 && glucose_status.delta < 2 && glucose_status.delta > -2 && glucose_status.short_avgdelta > -2 && glucose_status.short_avgdelta < 2 ) {
if( glucose_status.delta >= 0 || bg > 60 && glucose_status.delta < 2 && glucose_status.delta > -2 && glucose_status.short_avgdelta > -2 && glucose_status.short_avgdelta < 2 || eventualBG > target_bg && glucose_status.delta < 0 ) {
var future_sens = ( 277700 / (TDD * bg) );
console.log("Future state sensitivity is " +future_sens+" using current bg due to no COB & small delta or variation");
rT.reason += "Dosing sensitivity: " +future_sens+" using current BG;";