#include <ControlPolicy.h>
Public Types | |
typedef ControlPolicy *(* | ControlPolicyCreateFunction) (const char *) |
Public Member Functions | |
ControlPolicy () | |
virtual | ~ControlPolicy () |
virtual void | reset () |
virtual void | computeAction (MatNd *action, const MatNd *observation)=0 |
Static Public Member Functions | |
static void | registerType (const char *name, ControlPolicyCreateFunction creator) |
static ControlPolicy * | create (const char *name, const char *dataFile) |
static ControlPolicy * | create (PropertySource *config) |
static std::vector< std::string > | getTypeNames () |
Base class for a control policy that computes the actions from a given observation vector.
Definition at line 47 of file ControlPolicy.h.
typedef ControlPolicy*(* Rcs::ControlPolicy::ControlPolicyCreateFunction) (const char *) |
Policy factory function. Should read a policy from a file.
Definition at line 53 of file ControlPolicy.h.
Rcs::ControlPolicy::ControlPolicy | ( | ) |
Definition at line 95 of file ControlPolicy.cpp.
|
virtual |
Definition at line 100 of file ControlPolicy.cpp.
|
pure virtual |
Compute the action according to the policy.
[out] | action | matrix to store the action in |
[in] | observation | current observed state |
Implemented in Rcs::SimpleControlPolicy, and Rcs::TorchPolicy.
|
static |
Load a saved policy.
[in] | name | policy type name |
[in] | dataFile | file to load |
Definition at line 52 of file ControlPolicy.cpp.
|
static |
Load a saved policy defined by the given configuration.
[in] | config | property config, containing type and file entries |
Definition at line 77 of file ControlPolicy.cpp.
|
static |
List available policy names.
Definition at line 86 of file ControlPolicy.cpp.
|
static |
Register a control policy type.
[in] | name | policy type name |
[in] | creator | factory function |
Definition at line 46 of file ControlPolicy.cpp.
|
virtual |
Reset internal state if any. The default implementation does nothing.
Reimplemented in Rcs::TorchPolicy.
Definition at line 105 of file ControlPolicy.cpp.