Scheduler
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transitionMatrix.h
Go to the documentation of this file.
1 
10 #ifndef MDPTRANSITIONMATRIX_H
11 #define MDPTRANSITIONMATRIX_H
12 
13 #include <memory>
14 #include <ostream>
15 #include <vector>
16 
17 #include "state.h"
18 #include "action_impl.h"
19 
20 namespace Utils{class RandomGenerator;}
21 
22 namespace Mdp
23 {
24 
26 {
27 public:
28  TransitionMatrix(int nbOfStates, int nbOfActions);
30  void set(state_t from, state_t to, action_t action, double proba);
37  double get(state_t from, state_t to, action_t action);
44  double get(size_t stateAndAction, state_t to);
45  void initializeRandomly(std::shared_ptr<Utils::RandomGenerator> gen);
46  void print(std::ostream& stream);
47 private:
48  double *getArray();
49 
50  double *matrix{nullptr};
51  size_t nbOfStates;
52  size_t nbOfActions;
53 };
54 
55 
56 }
57 
58 #endif
size_t action_t
Definition: action_impl.h:18
Definition: action.h:18
size_t state_t
Definition: state.h:19
Definition: context.h:16