AIM
|
#include <ShiftWorkTask.h>
Public Member Functions | |
ShiftWorkTask (Task::Type taskType, double startDate, double endDate, AIMValue target) | |
virtual void | setReminderMessageTime (double time) |
Public Member Functions inherited from CoachingEngine::Task | |
Task (TaskDescription::Type taskType, double startDate, double endDate, AIMValue target) | |
virtual | ~Task () |
virtual void | doTick () |
virtual std::vector< AIMValue > | getRequirements () const |
virtual bool | requirementsAreUpdated (bool reset=true) const |
virtual void | addTrigger (std::function< bool(double, AIMValue)> triggerFunction) |
virtual void | sendMessage (double timestamp, MsgType msgType) |
virtual void | setFinalStatus (Status finalStatus) |
virtual void | finishTask () |
virtual const std::map < std::string, AIMValue > & | getProperties () |
virtual void | setProperties (const std::map< std::string, AIMValue > &properties) |
virtual void | setValueManually (const AIMValue &data) |
virtual void | setTarget (const AIMValue &data) |
Public Member Functions inherited from AIM | |
AIM (std::string name="") | |
AIM (const AIM &other) | |
AIM & | operator= (const AIM &rhs) |
virtual void | addDataSubscriber (const std::string &key, AIM *subscriber) |
virtual void | removeDataSubscriber (const std::string &key) |
virtual AIMValue | setProperty (const std::string &key, AIMValue value) |
virtual AIMValue | getProperty (std::string key) const |
virtual void | sendData () |
virtual void | addData (const AIMData &data) |
virtual std::string | exportProperties () |
virtual std::vector< std::pair < std::string, AIMValue > > | getOutputData (bool clear_output=false) |
virtual std::vector< std::pair < std::string, AIMValue > > | getInputData (bool clear_input=false) |
virtual AIM * | getDataSubscriber (std::string subscriber) |
virtual std::string | getName () const |
Public Member Functions inherited from CoachingEngine::TaskDescription | |
TaskDescription (Type taskTypeId, double startDate, double endDate, std::string description, AIMValue target) | |
TaskDescription (const TaskDescription &other) | |
TaskDescription () | |
virtual double | getStartDate () const |
virtual double | getEndDate () const |
virtual std::string | getDescription () const |
virtual AIMValue | getTarget () const |
virtual AIMValue | getCurrentValue () const |
virtual Status | getStatus () const |
virtual Type | getTaskType () const |
virtual bool | isCompleted () |
virtual AIMValue | aimValueRepresentation () |
Static Public Attributes | |
static const std::string | PROP_REMINDER_MESSAGE_TIME = "reminder_message_time" |
Static Public Attributes inherited from CoachingEngine::Task | |
static const std::string | MSG_FIELD_TASK_TYPE = "task_type" |
static const std::string | MSG_FIELD_TASK_START_TIME = "task_start_time" |
static const std::string | MSG_FIELD_TYPE = "msg_type" |
static const std::string | MSG_FIELD_VALUE = "value" |
static const std::string | MSG_FIELD_TARGET = "target" |
static const std::string | MSG_FIELD_GENERATION_TIME = "generation_time" |
static const std::string | MSG_FIELD_TRIGGER_TIME = "trigger_time" |
static const std::string | PROP_TASK_TYPE = "task_type" |
static const std::string | PROP_START_TIME = "start_time" |
static const std::string | PROP_END_TIME = "end_time" |
static const std::string | PROP_DESCRIPTION = "description" |
static const std::string | PROP_TARGET = "target" |
static const std::string | PROP_VALUE = "value" |
static const std::string | PROP_STATUS = "status" |
static const std::string | PROP_COMPLETED = "completed" |
static const std::string | PROP_LAST_DATA = "last_data" |
static const std::string | PROP_HAS_MANUAL_VALUE = "has_manual_value" |
Static Public Attributes inherited from AIM | |
static const std::string | VERSION = AIM_VERSION |
Protected Member Functions | |
virtual void | processDateValue (const std::string &sensor, const AIMValue &dateValue) |
virtual void | initializeTriggers () |
Protected Member Functions inherited from CoachingEngine::Task | |
virtual void | evaluateTriggers (double time, AIMValue data) |
Protected Member Functions inherited from AIM | |
void | setDataSubscribers (const std::map< std::string, AIM * > &subscribers) |
void | setInputDataQueue (const InputDataQueue &inputDataQueue) |
void | setOutputDataQueue (const AIMDataQueue &outputDataQueue) |
Additional Inherited Members | |
Public Types inherited from CoachingEngine::Task | |
enum | MsgType { TASK_START = 0, TASK_COMPLETE, TASK_SUCCESS, TASK_FAIL, TASK_ENCOURAGEMENT, TASK_REMINDER, TASK_STATUS_UNKNOWN } |
Public Types inherited from AIM | |
typedef std::pair< std::string, AIMValue > | AIMData |
typedef std::queue< AIMData > | AIMDataQueue |
typedef std::queue< AIMValue > | AIMValueQueue |
typedef std::map< std::string, AIMValueQueue > | InputDataQueue |
Public Types inherited from CoachingEngine::TaskDescription | |
enum | Status { UNKNOWN, SUCCEEDED, FAILED } |
enum | Type { NONE = 0, BE_ACTIVE, SLEEP, BE_RESILIENT, CALIBRATING, SLEEP_PERIOD_STAY_AWAKE, SLEEP_PERIOD_GO_TO_SLEEP, TAKE_MELATONIN, SLEEPY, UNWINDING, WAKING_UP, ACTIVE, BRIGHT_LIGHT, DIMMED_LIGHT, EXERCISE, TAKE_CAFFEINE, HAVE_BREAKFAST, HAVE_LUNCH, HAVE_DINNER, HAVE_SNACK, EAT_EXTRA_TODAY, FIRST_NIGHT_MELATONIN, FULLY_ADJUSTED, TASK_MR_WORRIES, TASK_MR_CONTROL, TASK_MR_SUPPORT, TASK_MR_FLEXIBILITY, TASK_MR_CONFIDENCE, TASK_MR_MOTIVATION, TASK_MR_RELAXATION } |
Static Public Member Functions inherited from CoachingEngine::TaskDescription | |
static std::string | taskTypeToString (Type taskType) |
static Type | stringToTaskType (std::string taskType) |
Public Attributes inherited from CoachingEngine::Task | |
Clock | clock |
Protected Attributes inherited from CoachingEngine::Task | |
std::vector< std::function < bool(double, AIMValue)> > | triggers |
bool | triggersInitialized |
Protected Attributes inherited from AIM | |
std::string | name |
std::vector< AIMValue > | requirements |
bool | requirementsUpdated |
std::map< std::string, AIM * > | dataSubscribers |
std::map< std::string, AIMValue > | properties |
InputDataQueue | inputDataQueue |
AIMDataQueue | outputDataQueue |
Protected Attributes inherited from CoachingEngine::TaskDescription | |
Type | taskType |
double | startDate |
double | endDate |
std::string | description |
AIMValue | target |
AIMValue | currentValue |
Status | status |
bool | completed |
A task to have a good rhythm. This task is measured using the flight_plan sensor.
|
protectedvirtual |
Function to initialize the triggers Will be called after the clock has been initialized in the doTick function.
Implements CoachingEngine::Task.
|
protectedvirtual |
Function to process date value. This function should be implemented by the Task implementation.
Reimplemented from CoachingEngine::Task.