AIToolbox
A library that offers tools for AI problem solving.
CooperativeModel.hpp
Go to the documentation of this file.
1
#ifndef AI_TOOLBOX_FACTORED_COOPERATIVE_MDP_MODEL_HEADER_FILE
2
#define AI_TOOLBOX_FACTORED_COOPERATIVE_MDP_MODEL_HEADER_FILE
3
4
#include <
AIToolbox/Factored/MDP/Types.hpp
>
5
#include <
AIToolbox/Factored/Utils/FactoredMatrix.hpp
>
6
#include <
AIToolbox/Factored/Utils/BayesianNetwork.hpp
>
7
8
namespace
AIToolbox::Factored::MDP
{
18
class
CooperativeModel
{
19
public
:
28
CooperativeModel
(
DDNGraph
graph,
DDN::TransitionMatrix
transitions,
FactoredMatrix2D
rewards,
double
discount = 1.0);
29
47
CooperativeModel
(
const
CooperativeModel
&);
48
67
std::tuple<State, double>
sampleSR
(
const
State
& s,
const
Action
& a)
const
;
68
86
double
sampleSR
(
const
State
& s,
const
Action
& a,
State
* s1)
const
;
87
108
std::tuple<State, Rewards>
sampleSRs
(
const
State
& s,
const
Action
& a)
const
;
109
126
void
sampleSRs
(
const
State
& s,
const
Action
& a,
State
* s1,
Rewards
* rews)
const
;
127
133
void
setDiscount
(
double
d);
134
140
const
State
&
getS
()
const
;
141
147
const
Action
&
getA
()
const
;
148
154
double
getDiscount
()
const
;
155
165
double
getTransitionProbability
(
const
State
& s,
const
Action
& a,
const
State
& s1)
const
;
166
176
double
getExpectedReward
(
const
State
& s,
const
Action
& a,
const
State
& s1)
const
;
177
183
const
DDN
&
getTransitionFunction
()
const
;
184
190
const
FactoredMatrix2D
&
getRewardFunction
()
const
;
191
197
const
DDNGraph
&
getGraph
()
const
;
198
199
private
:
200
double
discount_;
201
202
DDNGraph
graph_;
203
DDN
transitions_;
204
FactoredMatrix2D
rewards_;
205
206
mutable
RandomEngine
rand_;
207
};
208
}
209
210
#endif
AIToolbox::Factored::MDP::CooperativeModel::getRewardFunction
const FactoredMatrix2D & getRewardFunction() const
This function returns the reward function of the MDP.
AIToolbox::Factored::Rewards
Vector Rewards
Definition:
Types.hpp:71
AIToolbox::Factored::MDP
Definition:
CooperativePrioritizedSweeping.hpp:13
AIToolbox::Factored::State
Factors State
Definition:
Types.hpp:67
AIToolbox::Factored::MDP::CooperativeModel::getExpectedReward
double getExpectedReward(const State &s, const Action &a, const State &s1) const
This function returns the stored expected reward for the specified transition.
AIToolbox::Factored::MDP::CooperativeModel::getTransitionProbability
double getTransitionProbability(const State &s, const Action &a, const State &s1) const
This function returns the stored transition probability for the specified transition.
AIToolbox::Factored::MDP::CooperativeModel::getDiscount
double getDiscount() const
This function returns the currently set discount factor.
AIToolbox::Factored::FactoredMatrix2D
This class represents a factored 2D matrix.
Definition:
FactoredMatrix.hpp:140
AIToolbox::Factored::MDP::CooperativeModel::getGraph
const DDNGraph & getGraph() const
This function returns the underlying DDNGraph of the CooperativeExperience.
AIToolbox::Factored::MDP::CooperativeModel::getS
const State & getS() const
This function returns the state space of the world.
FactoredMatrix.hpp
BayesianNetwork.hpp
AIToolbox::Factored::DynamicDecisionNetwork::TransitionMatrix
std::vector< Matrix2D > TransitionMatrix
Definition:
BayesianNetwork.hpp:276
AIToolbox::Factored::MDP::CooperativeModel::CooperativeModel
CooperativeModel(DDNGraph graph, DDN::TransitionMatrix transitions, FactoredMatrix2D rewards, double discount=1.0)
Basic constructor.
AIToolbox::Factored::DynamicDecisionNetworkGraph
This class represents the structure of a dynamic decision network.
Definition:
BayesianNetwork.hpp:52
AIToolbox::RandomEngine
std::mt19937 RandomEngine
Definition:
Types.hpp:14
AIToolbox::Factored::DynamicDecisionNetwork
This class represents a Dynamic Decision Network with factored actions.
Definition:
BayesianNetwork.hpp:275
AIToolbox::Factored::MDP::CooperativeModel::getA
const Action & getA() const
This function returns the action space of the MDP.
AIToolbox::Factored::Action
Factors Action
Definition:
Types.hpp:69
AIToolbox::Factored::MDP::CooperativeModel::sampleSR
std::tuple< State, double > sampleSR(const State &s, const Action &a) const
This function samples the MDP with the specified state action pair.
AIToolbox::Factored::MDP::CooperativeModel::getTransitionFunction
const DDN & getTransitionFunction() const
This function returns the transition function of the MDP.
AIToolbox::Factored::MDP::CooperativeModel
This class models a cooperative MDP.
Definition:
CooperativeModel.hpp:18
AIToolbox::Factored::MDP::CooperativeModel::setDiscount
void setDiscount(double d)
This function sets a new discount factor for the Model.
Types.hpp
AIToolbox::Factored::MDP::CooperativeModel::sampleSRs
std::tuple< State, Rewards > sampleSRs(const State &s, const Action &a) const
This function samples the MDP with the specified state action pair.