Scheduler
|
The main class of the MDP framework. More...
#include <mdpModel.h>
Public Member Functions | |
MdpModel (std::shared_ptr< StateSpace > stateSpace, std::shared_ptr< ActionSpace > actionSpace, std::shared_ptr< MdpConfiguration > conf) | |
virtual | ~MdpModel () |
void | init () |
call this function first More... | |
void | end () |
call this function at the end More... | |
Action * | selectAction (bool updateModel=true) |
Returns the optimal action for the current timestep. More... | |
Action * | selectActionWithoutUpdate () |
similar to selectAction, but without updating the model More... | |
void | setConstraintList (std::shared_ptr< ConstraintList > list) |
void | setRewards (std::shared_ptr< Rewards > rewards) |
void | printReportsToFile (std::string folder) |
Print reports to file. More... | |
void | printSummary (std::ostream &stream) |
void | printPolicy (std::ostream &stream) |
Protected Member Functions | |
virtual void | constructContext (std::shared_ptr< StateSpace > stateSpace, std::shared_ptr< ActionSpace > actionSpace, std::shared_ptr< MdpConfiguration > conf) |
virtual void | setLearningStrategy () |
void | record (state_t state, action_t action, double reward) |
Protected Attributes | |
std::shared_ptr< Context > | context |
LearningStrategy * | learningStrategy {nullptr} |
std::vector< state_t > | stateHistory |
std::vector< action_t > | actionHistory |
std::vector< double > | rewardHistory |
bool | recordHistory {false} |
The main class of the MDP framework.
Definition at line 35 of file mdpModel.h.
MdpModel::MdpModel | ( | std::shared_ptr< StateSpace > | stateSpace, |
std::shared_ptr< ActionSpace > | actionSpace, | ||
std::shared_ptr< MdpConfiguration > | conf | ||
) |
Definition at line 34 of file mdpModel.cpp.
|
virtual |
Definition at line 68 of file mdpModel.cpp.
|
protectedvirtual |
Definition at line 48 of file mdpModel.cpp.
void MdpModel::end | ( | ) |
call this function at the end
Definition at line 79 of file mdpModel.cpp.
void MdpModel::init | ( | ) |
call this function first
Definition at line 72 of file mdpModel.cpp.
void MdpModel::printPolicy | ( | std::ostream & | stream | ) |
Definition at line 122 of file mdpModel.cpp.
void MdpModel::printReportsToFile | ( | std::string | folder | ) |
Print reports to file.
Prints the content of the transition matrix, the policy table, and a summary, each in its own file the folder in which those files should be written
Definition at line 103 of file mdpModel.cpp.
void MdpModel::printSummary | ( | std::ostream & | stream | ) |
Definition at line 141 of file mdpModel.cpp.
Definition at line 129 of file mdpModel.cpp.
Action * MdpModel::selectAction | ( | bool | updateModel = true | ) |
Returns the optimal action for the current timestep.
Definition at line 89 of file mdpModel.cpp.
Action * MdpModel::selectActionWithoutUpdate | ( | ) |
similar to selectAction, but without updating the model
Definition at line 84 of file mdpModel.cpp.
void MdpModel::setConstraintList | ( | std::shared_ptr< ConstraintList > | list | ) |
Definition at line 162 of file mdpModel.cpp.
|
protectedvirtual |
Definition at line 42 of file mdpModel.cpp.
void MdpModel::setRewards | ( | std::shared_ptr< Rewards > | rewards | ) |
Definition at line 167 of file mdpModel.cpp.
|
protected |
Definition at line 79 of file mdpModel.h.
|
protected |
Definition at line 74 of file mdpModel.h.
|
protected |
Definition at line 75 of file mdpModel.h.
|
protected |
Definition at line 81 of file mdpModel.h.
|
protected |
Definition at line 80 of file mdpModel.h.
|
protected |
Definition at line 78 of file mdpModel.h.