InsulinModel.swift 837 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // InsulinModel.swift
  3. // LoopKit
  4. //
  5. // Created by Pete Schwamb on 7/26/17.
  6. // Copyright © 2017 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. public protocol InsulinModel: CustomDebugStringConvertible {
  10. /// Returns the percentage of total insulin effect remaining at a specified interval after delivery; also known as Insulin On Board (IOB).
  11. /// Return value is within the range of 0-1
  12. ///
  13. /// - Parameters:
  14. /// - time: The interval after insulin delivery
  15. func percentEffectRemaining(at time: TimeInterval) -> Double
  16. /// The expected duration, including any effect delay, of an insulin dose, from the time of the dose
  17. var effectDuration: TimeInterval { get }
  18. /// The time after the dose where the effect becomes non-zero
  19. var delay: TimeInterval { get }
  20. }