MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
DecPOMDPDiscrete.h
Go to the documentation of this file.
1
28
/* Only include this header file once. */
29
#ifndef _DECPOMDPDISCRETE_H_
30
#define _DECPOMDPDISCRETE_H_ 1
31
32
/* the include directives */
33
#include <vector>
34
#include <string>
35
#include "
Globals.h
"
36
#include "
MultiAgentDecisionProcessDiscrete.h
"
37
#include "
RewardModel.h
"
38
#include "
DecPOMDP.h
"
39
#include "
DecPOMDPDiscreteInterface.h
"
40
41
class
RGet
;
42
56
class
DecPOMDPDiscrete
:
57
virtual
public
DecPOMDPDiscreteInterface
,
58
public
MultiAgentDecisionProcessDiscrete
,
59
public
DecPOMDP
60
{
61
private
:
63
bool
_m_initialized
;
64
65
protected
:
66
68
RewardModel
*
_m_p_rModel
;
69
70
public
:
71
72
// Constructor, destructor and copy assignment.
74
76
DecPOMDPDiscrete
(std::string name=
"received unspec. by DecPOMDPDiscrete"
,
77
std::string descr=
"received unspec. by DecPOMDPDiscrete"
,
78
std::string pf=
"received unspec. by DecPOMDPDiscrete"
);
79
81
~DecPOMDPDiscrete
();
82
83
//data manipulation (set) functions:
85
88
bool
SetInitialized
(
bool
b);
90
void
CreateNewRewardModel
();
92
void
SetReward
(
Index
sI,
Index
jaI,
double
r)
93
{
_m_p_rModel
->
Set
(sI, jaI, r);}
94
96
void
SetReward
(
Index
sI,
Index
jaI,
Index
sucSI,
double
r);
97
99
void
SetReward
(
Index
sI,
Index
jaI,
Index
sucSI,
Index
joI,
100
double
r);
101
102
// 'get' functions:
104
double
GetReward
(
Index
sI,
Index
jaI)
const
105
{
return
(
_m_p_rModel
->
Get
(sI, jaI));}
106
108
std::string
SoftPrint
()
const
;
109
111
void
ExtractMADPDiscrete
(
MultiAgentDecisionProcessDiscrete
*madp);
112
114
RewardModel
*
GetRewardModelPtr
()
const
115
{
return
(
_m_p_rModel
); }
116
117
//functions to implement the DecPOMDPInterface:
119
double
GetReward
(
State
* s,
JointAction
* ja)
const
120
{
121
return
GetReward
(
122
((
StateDiscrete
*)s)->GetIndex(),
123
((
JointActionDiscrete
*)ja)->GetIndex());
124
}
126
void
SetReward
(
State
* s,
JointAction
* ja,
double
r)
127
{
128
return
SetReward
(
129
((
StateDiscrete
*)s)->GetIndex(),
130
((
JointActionDiscrete
*)ja)->GetIndex(), r);
131
}
132
133
134
135
//functions to implement the POSGInterface:
136
138
139
void
SetRewardForAgent
(
Index
agentI,
State
* s,
JointAction
* ja,
double
r)
140
{
SetReward
(s, ja, r); }
142
143
double
GetRewardForAgent
(
Index
agentI,
State
* s,
JointAction
* ja)
const
144
{
return
GetReward
(s, ja); }
145
146
//functions to implement the POSGDiscreteInterface:
147
149
void
CreateNewRewardModelForAgent
(
Index
agentI)
150
{
CreateNewRewardModel
();}
151
152
void
SetRewardForAgent
(
Index
agentI,
Index
sI,
Index
jaI,
double
r)
153
{
SetReward
(sI, jaI, r);}
154
156
void
SetRewardForAgent
(
Index
agentI,
Index
sI,
Index
jaI,
157
Index
sucSI,
double
r)
158
{
SetReward
(sI, jaI, sucSI, r);}
159
161
void
SetRewardForAgent
(
Index
agentI,
Index
sI,
Index
jaI,
162
Index
sucSI,
Index
joI,
double
r)
163
{
SetReward
(sI, jaI, sucSI, joI, r);}
164
166
double
GetRewardForAgent
(
Index
agentI,
Index
sI,
Index
jaI)
const
167
{
return
GetReward
(sI, jaI);}
168
169
RGet
*
GetRGet
()
const
;
171
virtual
DecPOMDPDiscrete
*
Clone
()
const
172
{
return
new
DecPOMDPDiscrete
(*
this
); }
173
174
};
175
#endif
/* !_DECPOMDPDISCRETE_H_ */
176
177
178
// Local Variables: ***
179
// mode:c++ ***
180
// End: ***
src
base
DecPOMDPDiscrete.h
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2