icub-client
|
Drive scheduler for the reactiveLayer Version:1.0 More...
Classes | |
struct | DriveOutCZ |
class | AllostaticDrive |
class | AllostaticController |
Enumerations | |
enum | OutCZ { UNDER, OVER, UNDEFINED } |
enum | DriveUpdateMode { SENSATION_ON, SENSATION_OFF } |
Drive scheduler for the reactiveLayer Version:1.0
On top of the homeostasis module, the allostatic controller monitors all needs in homeostasis and triggers corresponding behaviors in function of which need requires to be addressed sooner. We call this pre-defined sensory-motor association a drive. This module creates needs in homeostasis from a config file or RPC command, and provides an interface to freeze them and change their parameters depending on their internal values. This module is strongly dependent on sensationManager, homeostasis and behaviorManager and is the core of the reactiveLayer. See the default.ini config file to see an example on how to define a new drive.
struct DriveOutCZ |
Definition at line 28 of file allostaticController.h.
Class Members | ||
---|---|---|
OutCZ | level | |
string | name |
class AllostaticDrive |
Definition at line 42 of file allostaticController.h.
Public Member Functions | |
AllostaticDrive () | |
bool | interrupt_ports () |
Interrupt ports of the drive. More... | |
bool | close_ports () |
Close ports of the drive. More... | |
Bottle | update (DriveUpdateMode mode) |
void | triggerBehavior (OutCZ mode) |
triggers a behavior if needs are out of threshold More... | |
Public Attributes | |
string | name |
Name of the drive. More... | |
bool | active |
bool | manualMode |
Port * | behaviorUnderPort |
Port to be used when drive falls below homeostatic level. More... | |
Port * | behaviorOverPort |
Port to be used when drive hits upper threshold of homeostatic level. More... | |
Port * | homeoPort |
Port to homeostasis module. More... | |
BufferedPort< Bottle > * | inputSensationPort |
Port from sensationManager. More... | |
Bottle | behaviorUnderCmd |
Command to be send to behaviorUnderPort when drive falls below homeostatic level. More... | |
Bottle | behaviorOverCmd |
Command to be send to behaviorOverPort when drive hits upper threshold of homeostatic level. More... | |
Bottle | sensationOnCmd |
Bottle | sensationOffCmd |
Bottle | beforeTriggerCmd |
Bottle | afterTriggerCmd |
|
inline |
Definition at line 55 of file allostaticController.h.
bool AllostaticDrive::close_ports | ( | ) |
Close ports of the drive.
Definition at line 440 of file allostaticController.cpp.
bool AllostaticDrive::interrupt_ports | ( | ) |
Interrupt ports of the drive.
Definition at line 427 of file allostaticController.cpp.
void AllostaticDrive::triggerBehavior | ( | OutCZ | mode | ) |
triggers a behavior if needs are out of threshold
mode | under or below threshold |
Definition at line 489 of file allostaticController.cpp.
Bottle AllostaticDrive::update | ( | DriveUpdateMode | mode | ) |
Definition at line 462 of file allostaticController.cpp.
bool AllostaticDrive::active |
Definition at line 46 of file allostaticController.h.
Bottle AllostaticDrive::afterTriggerCmd |
Definition at line 53 of file allostaticController.h.
Bottle AllostaticDrive::beforeTriggerCmd |
Definition at line 53 of file allostaticController.h.
Bottle AllostaticDrive::behaviorOverCmd |
Command to be send to behaviorOverPort when drive hits upper threshold of homeostatic level.
Definition at line 52 of file allostaticController.h.
Port* AllostaticDrive::behaviorOverPort |
Port to be used when drive hits upper threshold of homeostatic level.
Definition at line 48 of file allostaticController.h.
Bottle AllostaticDrive::behaviorUnderCmd |
Command to be send to behaviorUnderPort when drive falls below homeostatic level.
Definition at line 51 of file allostaticController.h.
Port* AllostaticDrive::behaviorUnderPort |
Port to be used when drive falls below homeostatic level.
Definition at line 47 of file allostaticController.h.
Port* AllostaticDrive::homeoPort |
Port to homeostasis module.
Definition at line 49 of file allostaticController.h.
BufferedPort<Bottle>* AllostaticDrive::inputSensationPort |
Port from sensationManager.
Definition at line 50 of file allostaticController.h.
bool AllostaticDrive::manualMode |
Definition at line 46 of file allostaticController.h.
string AllostaticDrive::name |
Name of the drive.
Definition at line 45 of file allostaticController.h.
Bottle AllostaticDrive::sensationOffCmd |
Definition at line 53 of file allostaticController.h.
Bottle AllostaticDrive::sensationOnCmd |
Definition at line 53 of file allostaticController.h.
class AllostaticController |
Definition at line 86 of file allostaticController.h.
Public Member Functions | |
AllostaticController () | |
bool | configure (yarp::os::ResourceFinder &rf) |
bool | interruptModule () |
bool | close () |
double | getPeriod () |
bool | updateModule () |
bool | updateAllostatic () |
updateAllostatic Update the drives accordingly to the stimuli More... | |
bool | Normalize (vector< double > &vec) |
Normalize normalize drive priorities. More... | |
DriveOutCZ | chooseDrive () |
chooseDrive Choose a drive out of CZ, according to drive priorities More... | |
bool | respond (const Bottle &cmd, Bottle &reply) |
|
inline |
Definition at line 120 of file allostaticController.h.
DriveOutCZ AllostaticController::chooseDrive | ( | ) |
chooseDrive Choose a drive out of CZ, according to drive priorities
Definition at line 312 of file allostaticController.cpp.
bool AllostaticController::close | ( | ) |
Definition at line 30 of file allostaticController.cpp.
bool AllostaticController::configure | ( | yarp::os::ResourceFinder & | rf | ) |
Definition at line 117 of file allostaticController.cpp.
|
inline |
Definition at line 129 of file allostaticController.h.
bool AllostaticController::interruptModule | ( | ) |
Definition at line 3 of file allostaticController.cpp.
bool AllostaticController::Normalize | ( | vector< double > & | vec | ) |
Normalize normalize drive priorities.
vec | list of priorities for each drive |
Definition at line 273 of file allostaticController.cpp.
bool AllostaticController::respond | ( | const Bottle & | cmd, |
Bottle & | reply | ||
) |
Definition at line 390 of file allostaticController.cpp.
bool AllostaticController::updateAllostatic | ( | ) |
updateAllostatic Update the drives accordingly to the stimuli
Definition at line 363 of file allostaticController.cpp.
bool AllostaticController::updateModule | ( | ) |
Definition at line 284 of file allostaticController.cpp.
enum DriveUpdateMode |
Enumerator | |
---|---|
SENSATION_ON | |
SENSATION_OFF |
Definition at line 37 of file allostaticController.h.
enum OutCZ |
Enumerator | |
---|---|
UNDER | |
OVER | |
UNDEFINED |
Definition at line 23 of file allostaticController.h.