Algorithm 1 Meal Detection and Estimation Algorithm |
Require:,
|
Ensure: Output meal size,
|
Initialise model parameters from memory |
|
for
do
|
|
Compare and
|
Let k be number of samples where <
|
if k > N AND
BG/t ≥ 1 then ▹ Activate meal detection |
|
|
while error
AND
do ▹ Perform meal estimation
|
if fine_search then
|
|
else
|
|
end if
|
|
|
|
if error then
|
|
Activate fine_search
|
end if
|
if verify appropriate glucose dynamics then
|
▹ Discard meal estimate |
break
|
end if
|
end while
|
else
|
|
end if
|
end for |