Scheduler
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mdp::MdpModel Class Reference

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...
 
ActionselectAction (bool updateModel=true)
 Returns the optimal action for the current timestep. More...
 
ActionselectActionWithoutUpdate ()
 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< Contextcontext
 
LearningStrategylearningStrategy {nullptr}
 
std::vector< state_tstateHistory
 
std::vector< action_tactionHistory
 
std::vector< double > rewardHistory
 
bool recordHistory {false}
 

Detailed Description

The main class of the MDP framework.

Definition at line 35 of file mdpModel.h.

Constructor & Destructor Documentation

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.

MdpModel::~MdpModel ( )
virtual

Definition at line 68 of file mdpModel.cpp.

Member Function Documentation

void MdpModel::constructContext ( std::shared_ptr< StateSpace stateSpace,
std::shared_ptr< ActionSpace actionSpace,
std::shared_ptr< MdpConfiguration conf 
)
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.

void MdpModel::record ( state_t  state,
action_t  action,
double  reward 
)
protected

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

See also
MdpModel::selectAction

Definition at line 84 of file mdpModel.cpp.

void MdpModel::setConstraintList ( std::shared_ptr< ConstraintList list)

Definition at line 162 of file mdpModel.cpp.

void MdpModel::setLearningStrategy ( )
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.

Member Data Documentation

std::vector<action_t> Mdp::MdpModel::actionHistory
protected

Definition at line 79 of file mdpModel.h.

std::shared_ptr<Context> Mdp::MdpModel::context
protected

Definition at line 74 of file mdpModel.h.

LearningStrategy* Mdp::MdpModel::learningStrategy {nullptr}
protected

Definition at line 75 of file mdpModel.h.

bool Mdp::MdpModel::recordHistory {false}
protected

Definition at line 81 of file mdpModel.h.

std::vector<double> Mdp::MdpModel::rewardHistory
protected

Definition at line 80 of file mdpModel.h.

std::vector<state_t> Mdp::MdpModel::stateHistory
protected

Definition at line 78 of file mdpModel.h.


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