Scheduler
priorityState.h
Go to the documentation of this file.
1 
10 #ifndef PRIORITYSTATE_H
11 #define PRIORITYSTATE_H
12 
13 
14 #include <memory>
15 #include <string>
16 
17 namespace Mdp
18 {
19 
20 
21 class DomainModel;
22 class StateSpacBuilder;
23 class StateSpace;
24 
32 {
33 friend StateSpaceBuilder;
34 friend StateSpace;
35 public:
36  virtual ~PriorityState(){};
39  virtual std::string getName()=0;
43  virtual bool isInState()=0;
44 protected:
45  template<typename T>
46  std::shared_ptr<T> getModel()
47  {
48  std::shared_ptr<T> model = std::dynamic_pointer_cast<T>(domainModel);
49  if (model == nullptr)
50  throw std::runtime_error("inconsistent domain model type");
51  return model;
52  }
53  std::shared_ptr<DomainModel> domainModel{nullptr};
54 };
55 
56 }
57 
58 
59 
60 
61 
62 
63 
64 #endif
65 
66 
67 
68 
virtual ~PriorityState()
Definition: priorityState.h:36
virtual bool isInState()=0
Given the information provided by the DomainModel, this function checks if the system is in that stat...
Definition: action.h:18
virtual std::string getName()=0
returns the name of that state
std::shared_ptr< DomainModel > domainModel
Definition: priorityState.h:53
a single state of the state space
Definition: priorityState.h:31
std::shared_ptr< T > getModel()
Definition: priorityState.h:46
builds a domain specific state space