Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.Coach Class Reference
Inheritance diagram for nl.sense_os.cortex.coaching.Coach:
nl.sense_os.cortex.coaching.BiorhythmCoach nl.sense_os.cortex.coaching.CalibrationCoach nl.sense_os.cortex.coaching.ExerciseCoach nl.sense_os.cortex.coaching.JetLagCoach nl.sense_os.cortex.coaching.MentalResilienceCoach nl.sense_os.cortex.coaching.ShiftWorkCoach nl.sense_os.cortex.coaching.SleepDurationCoach

Classes

class  GOAL_INITIALIZATION
 
enum  STATUS
 
enum  TYPE
 

Public Member Functions

void sendDummyData ()
 
Coach.TYPE getCoachType ()
 
boolean initialize (boolean adaptive, GOAL_INITIALIZATION init)
 
JSONObject getGoal ()
 
List< TaskgetCurrentTasks ()
 
List< TaskgetFutureTasks (double start_time, double end_time)
 
List< TaskgetPastTasks (double start_time, double end_time)
 
Coach.STATUS getStatus ()
 
boolean requirementsAreUpdated (boolean reset)
 
boolean requirementsAreUpdated ()
 
void disable ()
 
List< JSONObject > getRequirements ()
 
void onNewData (SensorDataPoint dataPoint)
 
void pause ()
 
void resume ()
 
Task updateTaskValue (Task task)
 
void load ()
 
void setState (String state)
 

Protected Member Functions

 Coach (String name, SensePlatform sensePlatform, AIM aiModule, Coach.TYPE coach_type)
 
void handleRequirementsUpdate ()
 

Protected Attributes

List< AIMBase > submodules = new ArrayList<AIMBase>()
 
TYPE coach_type
 
boolean requirementsAreUpdated = false
 

Static Protected Attributes

static String TAG = "Coach"
 

Member Function Documentation

Coach.TYPE nl.sense_os.cortex.coaching.Coach.getCoachType ( )

Get the Coach type

The type of the Coach instance

Returns
The Coach.TYPE of the Coach
List<Task> nl.sense_os.cortex.coaching.Coach.getCurrentTasks ( )

Get the active Tasks

Get a list with the currently active Tasks for this Coach.
Tasks are active when the current time is between the start and end time of the task.
These Tasks have either the Task.STATUS SUCCEEDED, FAILED or IN_PROGRESS.

Returns
The list with active Tasks
List<Task> nl.sense_os.cortex.coaching.Coach.getFutureTasks ( double  start_time,
double  end_time 
)

Get the future Tasks

Get a list of tasks planned for a certain period in the future.
These Tasks are planned based on the goal of the Coach.
These Tasks have the Task.STATUS UNKNOWN.

Parameters
start_timeThe period's epoch start time in seconds
end_timeThe period's epoch end time in seconds
Returns
A list with Tasks planned for the future
JSONObject nl.sense_os.cortex.coaching.Coach.getGoal ( )

Get the goal values

Returns the goal values of the Coach for all the Task types (Tasks.TYPE) the Coach has.
The key values of the JSONObject are the Task.TYPE values of the Tasks the Coach has.

Returns
The goal values of each Task type in JSON representation
List<Task> nl.sense_os.cortex.coaching.Coach.getPastTasks ( double  start_time,
double  end_time 
)

Get the completed Tasks

Get a list of completed Tasks for a certain period.
These Tasks have either the Task.STATUS SUCCEEDED, FAILED or UNKNOWN.

Parameters
start_timeThe period's epoch start time in seconds
end_timeThe period's epoch end time in seconds
Returns
A list with completed Tasks
Coach.STATUS nl.sense_os.cortex.coaching.Coach.getStatus ( )

Get the status of the Coach

A Coach can have one of the following Coach.STATUS values

UNINITIALIZED: the Coach is not initialized with a GOAL_INITIALIZATION object.
CALIBRATING: the Coach is empirically determining the goal.
GOAL_INITIALIZED: the goal has been set but the coach has not created any tasks.
READY: the Coach has created Tasks and is ready.
PAUSE: the Coach is paused

Returns
The status of the Coach
boolean nl.sense_os.cortex.coaching.Coach.initialize ( boolean  adaptive,
GOAL_INITIALIZATION  init 
)

Initialize the Coach

When the Coach is initialized with adaptive = True, it will adjust it's Tasks based on the progress.
The GOAL_INITIALIZATION object sets how the goal values are determined.
The Coach should be initialized for the different tasks types (Task.TYPE values) it has.
This will enable the coach if it's disabled

Parameters
adaptiveSet whether the Coach should be adaptive (update the goal based on progress)
initSet how the goal is determined
Returns
Returns true if the initialization was successful, false otherwise.
void nl.sense_os.cortex.coaching.Coach.pause ( )

Pause the Coach

The current task will be set to the completed status.

boolean nl.sense_os.cortex.coaching.Coach.requirementsAreUpdated ( boolean  reset)

Get the requirements update status

Returns a boolean whether the requirements are updated

Parameters
resetResets the requirements are updated flag
Returns
Returns true if the requirements are updated
boolean nl.sense_os.cortex.coaching.Coach.requirementsAreUpdated ( )

Get the requirements update status

Returns a boolean whether the requirements are updated

Returns
Returns true if the requirements are updated
void nl.sense_os.cortex.coaching.Coach.resume ( )

Un-pause the Coach

The end time of to total coaching period will be increased with the total paused time if applicable.

void nl.sense_os.cortex.coaching.Coach.setState ( String  state)

Manually set the state of the AIM

Parameters
stateThe string representation of the JSON state

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