Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.SleepTimeEstimateSensor Class Reference
Inheritance diagram for nl.sense_os.cortex.SleepTimeEstimateSensor:

Public Member Functions

 SleepTimeEstimateSensor (String name, SensePlatform sensePlatform)
 
 SleepTimeEstimateSensor (SensePlatform sensePlatform)
 
nl.sense_os.cortex.module.sleeptimeestimate.SleepTimeEstimate getSleepTimeEstimateModule ()
 
void onNewData (SensorDataPoint dataPoint)
 

Detailed Description

This is a wrapper class for the SleepTimeEstimate module.
This module gives a sleep estimate based on the observed values of the sleep_time module.
When the sleep_time module continuously returns 0 minutes of sleep during sleep period, this module will return an estimate based on the population and the sleep history of the user.
An estimate will only be calculated when:

  • the time is past PROP_ESTIMATE_RETURN_TIME and before PROP_SLEEP_END_TIME
  • it has at least PROP_ESTIMATE_RETURN_MIN_CNT sleep_time measurements
  • the latest sleep_time measurement was 0
  • the first sleep_time measurement was before PROP_SLEEP_END_TIME
    This module returns a value with the format:
    {"sleepTime":8.5, "start_date":1377242482, "end_date": 1377242482, "history_based"=1}
    Where the boolean field "history_based", indicates whether the current values are based on the population and history, or coming directly from the sleep_time module. The start_date will always be at or after the date of the first sleep_time measurement
    This module expects the input of the sleep_time sensor:
    {"sleepTime":8.5, "start_date":1377242482, "end_date": 1377242482}

Constructor & Destructor Documentation

nl.sense_os.cortex.SleepTimeEstimateSensor.SleepTimeEstimateSensor ( String  name,
SensePlatform  sensePlatform 
)

SleepTimeEstimateSensor constructor

See Also
SleepTimeEstimateSensor
Parameters
nameThe unique name of the SleepTimeEstimate module.
sensePlatformA SensePlatform object which is binded to the SenseService
nl.sense_os.cortex.SleepTimeEstimateSensor.SleepTimeEstimateSensor ( SensePlatform  sensePlatform)

SleepTimeEstimateSensor constructor

The SleepTimeEstimate module will be initialized with the following properties, these can be altered via getSleepTimeEstimateModule().setAIMProperty:
PROP_POPULATION_SLEEP_TIME = 8 hours
PROP_POPULATION_START_TIME = 23.5 o'clock
PROP_POPULATION_END_TIME = 7 o'clock
PROP_MIN_SLEEP_DURATION = 4 hours
PROP_GOAL_SLEEP_TIME_COUNT = 14 nights
PROP_ESTIMATE_RETURN_TIME = 6 o'clock
PROP_ESTIMATE_RETURN_MIN_CNT = 48 samples (4 hours every 5 minutes a sample)
PROP_SLEEP_END_TIME = 12 o'clock
PROP_MAX_SLEEP_DURATION = 14 hours
PROP_ESTIMATE_NOISE = 0.5 hours

Parameters
sensePlatformA SensePlatform object which is binded to the SenseService

Member Function Documentation

nl.sense_os.cortex.module.sleeptimeestimate.SleepTimeEstimate nl.sense_os.cortex.SleepTimeEstimateSensor.getSleepTimeEstimateModule ( )

Get the SleepTimeEstimate module

NB. Access the SleepTimeEstimate module instance using synchronized.

Returns
SleepTimeEstimate AIM

The documentation for this class was generated from the following file: