The device and method calculate and deliver a dose of insulin and optionally glucagon into the subject. Online activation automatically controls the delivery of a corrected dose of insulin in response to normal glucose measurements from the sensor, while offline activation is autonomous with a single glucose measurement and prior online activation. Based on the information gathered, a corrected dose is calculated and delivered. In another aspect, off-line activation includes automatically calculating and administering a meal dose based on information autonomously collected during a previous on-line activation period. Both methods involve generating relevant control parameters that are tailored to the individual, continuously converged and potentially modified during the period of online operation. Control parameters are used in real time during off-line operation to adjust glucose levels without requiring user-supplied control parameters such as correction factors and insulin-to-carbohydrate ratios.装置及び方法は、対象内へのインスリン及び場合によりグルカゴンの用量を計算及び送達する。オンライン作動は、センサからの通常のグルコース測定値に応答して、インスリンの補正用量の送達を自動的に制御し、オフライン作動は、単独のグルコース測定値と、先行するオンライン作動中に自律的に収集された情報とに基づいて、補正用量を計算及び送達する。別の態様では、オフライン作動は、先行するオンライン作動期間中に自律的に収集された情報に基づいて、食事用量を自動的に計算及び投与することを含む。両方の方法は、個人に対して調整され、オンライン作動の期間中に連続的に収束され、かつ潜在的に修正される、関連する制御パラメータを生成することを含む。制御パラメータはオフライン作動の期間中にリアルタイムで使用されて、例えば補正因子及びインスリン-対-炭水化物比等のユーザ提供による制御パラメータを必要とすることなくグルコースレベルを調節する。