AIToolbox
A library that offers tools for AI problem solving.
TigerAntelope.hpp
Go to the documentation of this file.
1 #ifndef AI_TOOLBOX_FACTORED_MDP_TIGER_ANTELOPE_HEADER_FILE
2 #define AI_TOOLBOX_FACTORED_MDP_TIGER_ANTELOPE_HEADER_FILE
3 
5 
7 
8 namespace AIToolbox::Factored::MDP {
23  class TigerAntelope {
24  public:
31  TigerAntelope(unsigned width, unsigned height);
32 
41  std::tuple<State, Rewards> sampleSRs(const State & s, const Action & a) const;
42 
54  bool isTerminalState(const State & s) const;
55 
59  State getS() const;
60 
64  Action getA() const;
65 
69  double getDiscount() const;
70 
74  size_t getAntelopeState() const;
75 
79  const AIToolbox::MDP::GridWorld & getGrid() const;
80 
84  std::string printState(const State & s) const;
85 
86  private:
88  size_t antelopePosition_;
89 
90  mutable RandomEngine rand_;
91  };
92 }
93 
94 #endif
AIToolbox::MDP::GridWorld
This class represents a simple rectangular gridworld.
Definition: GridWorld.hpp:23
AIToolbox::Factored::MDP::TigerAntelope::getS
State getS() const
This function returns the state space of the model.
AIToolbox::Factored::MDP::TigerAntelope::getA
Action getA() const
This function returns the action space of the model.
AIToolbox::Factored::MDP::TigerAntelope::sampleSRs
std::tuple< State, Rewards > sampleSRs(const State &s, const Action &a) const
This function allows to sample a new state and rewards.
AIToolbox::Factored::MDP
Definition: CooperativePrioritizedSweeping.hpp:13
AIToolbox::Factored::MDP::TigerAntelope::getDiscount
double getDiscount() const
This function returns the discount factor of the model.
AIToolbox::Factored::State
Factors State
Definition: Types.hpp:67
CooperativeModel.hpp
GridWorld.hpp
AIToolbox::Factored::MDP::TigerAntelope::getAntelopeState
size_t getAntelopeState() const
This function returns the state where the antelope is located.
AIToolbox::Factored::MDP::TigerAntelope::isTerminalState
bool isTerminalState(const State &s) const
This function returns whether a state is terminal.
AIToolbox::RandomEngine
std::mt19937 RandomEngine
Definition: Types.hpp:14
AIToolbox::Factored::MDP::TigerAntelope::getGrid
const AIToolbox::MDP::GridWorld & getGrid() const
This function returns a reference to the internal GridWorld.
AIToolbox::Factored::Action
Factors Action
Definition: Types.hpp:69
AIToolbox::Factored::MDP::TigerAntelope
This class represents a 2-agent tiger antelope environment.
Definition: TigerAntelope.hpp:23
AIToolbox::Factored::MDP::TigerAntelope::printState
std::string printState(const State &s) const
This function returns a graphical representation of a State.
AIToolbox::Factored::MDP::TigerAntelope::TigerAntelope
TigerAntelope(unsigned width, unsigned height)
Basic constructor.