MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
MultiAgentDecisionProcessDiscrete.h
Go to the documentation of this file.
1
28
/* Only include this header file once. */
29
#ifndef _MULTIAGENTDECISIONPROCESSDISCRETE_H_
30
#define _MULTIAGENTDECISIONPROCESSDISCRETE_H_ 1
31
32
/* the include directives */
33
#include <vector>
34
#include <string>
35
36
#include "
MultiAgentDecisionProcess.h
"
37
#include "
MultiAgentDecisionProcessDiscreteInterface.h
"
38
#include "
MADPComponentDiscreteActions.h
"
39
#include "
MADPComponentDiscreteObservations.h
"
40
#include "
MADPComponentDiscreteStates.h
"
41
42
class
TGet
;
43
62
class
MultiAgentDecisionProcessDiscrete
:
63
virtual
public
MultiAgentDecisionProcessDiscreteInterface
,
64
public
MultiAgentDecisionProcess
,
65
public
MADPComponentDiscreteStates
,
66
public
MADPComponentDiscreteActions
,
67
public
MADPComponentDiscreteObservations
68
69
{
70
private
:
72
bool
_m_initialized
;
73
77
bool
_m_sparse
;
78
85
bool
SanityCheck
(
void
);
86
88
TransitionModelDiscrete
*
_m_p_tModel
;
89
91
ObservationModelDiscrete
*
_m_p_oModel
;
92
93
protected
:
94
95
//data manipulation (set) functions:
101
bool
SetInitialized
(
bool
b);
102
public
:
103
// Constructor, destructor and copy assignment.
105
MultiAgentDecisionProcessDiscrete
();
106
111
MultiAgentDecisionProcessDiscrete
(
112
std::string name=
"received unspec. by MultiAgentDecisionProcessDiscrete"
,
113
std::string descr=
"received unspec.by MultiAgentDecisionProcessDiscrete"
,
114
std::string pf=
"received unspec. by MultiAgentDecisionProcessDiscrete"
);
121
MultiAgentDecisionProcessDiscrete
(
122
int
nrAgents,
int
nrS, std::string
123
name=
"received unspec. by MultiAgentDecisionProcessDiscrete"
,
124
std::string descr=
"received unspec.by MultiAgentDecisionProcessDiscrete"
,
125
std::string pf=
"received unspec. by MultiAgentDecisionProcessDiscrete"
);
126
128
~MultiAgentDecisionProcessDiscrete
();
129
133
bool
Initialize
()
134
{
return
SetInitialized
(
true
);}
135
137
void
CreateNewTransitionModel
();
139
void
CreateNewObservationModel
();
140
142
void
SetTransitionProbability
(
Index
sI,
Index
jaI,
Index
sucSI,
143
double
p);
144
146
void
SetObservationProbability
(
Index
jaI,
Index
sucSI,
Index
joI,
147
double
p);
148
149
// 'get' functions:
151
double
GetTransitionProbability
(
Index
sI,
Index
jaI,
Index
sucSI)
152
const
;
153
154
TGet
*
GetTGet
()
const
;
155
OGet
*
GetOGet
()
const
;
156
158
double
GetObservationProbability
(
Index
jaI,
Index
sucSI,
Index
joI)
159
const
;
160
162
Index
SampleSuccessorState
(
Index
sI,
Index
jaI)
const
;
163
165
Index
SampleJointObservation
(
Index
jaI,
Index
sucI)
const
;
166
168
std::string
SoftPrint
()
const
;
170
void
Print
()
const
171
{ std::cout <<
SoftPrint
();}
172
178
void
SetSparse
(
bool
sparse);
179
181
bool
GetSparse
()
const
{
return
(
_m_sparse
); }
182
183
const
TransitionModelDiscrete
*
GetTransitionModelDiscretePtr
()
const
184
{
return
(
_m_p_tModel
); }
185
186
const
ObservationModelDiscrete
*
GetObservationModelDiscretePtr
()
const
187
{
return
(
_m_p_oModel
); }
188
190
void
SetTransitionModelPtr
(
TransitionModelDiscrete
* ptr)
191
{
_m_p_tModel
=ptr; }
192
194
void
SetObservationModelPtr
(
ObservationModelDiscrete
* ptr)
195
{
_m_p_oModel
=ptr; }
196
198
virtual
MultiAgentDecisionProcessDiscrete
*
Clone
()
const
199
{
return
new
MultiAgentDecisionProcessDiscrete
(*
this
); }
200
201
};
202
203
#include "
TransitionModelDiscrete.h
"
204
#include "
ObservationModelDiscrete.h
"
205
206
inline
void
MultiAgentDecisionProcessDiscrete::SetTransitionProbability
(
Index
207
sI,
Index
jaI,
Index
sucSI,
double
p)
208
{
_m_p_tModel
->
Set
(sI, jaI, sucSI, p);}
209
inline
void
MultiAgentDecisionProcessDiscrete::SetObservationProbability
(
Index
210
jaI,
Index
sucSI,
Index
joI,
double
p)
211
{
_m_p_oModel
->
Set
(jaI, sucSI, joI,p);}
212
inline
double
213
MultiAgentDecisionProcessDiscrete::GetTransitionProbability
(
Index
sI,
Index
214
jaI,
Index
sucSI)
const
215
{
return
(
_m_p_tModel
->
Get
(sI, jaI, sucSI));}
216
inline
double
217
MultiAgentDecisionProcessDiscrete::GetObservationProbability
(
Index
jaI,
Index
218
sucSI,
Index
joI)
const
219
{
return
(
_m_p_oModel
->
Get
(jaI, sucSI, joI));}
220
inline
Index
MultiAgentDecisionProcessDiscrete::SampleSuccessorState
(
Index
221
sI,
Index
jaI)
const
222
{
return
(
_m_p_tModel
->
SampleSuccessorState
(sI,jaI));}
223
inline
Index
MultiAgentDecisionProcessDiscrete::SampleJointObservation
(
Index
224
jaI,
Index
sucI)
const
225
{
return
(
_m_p_oModel
->
SampleJointObservation
(jaI,sucI)); }
226
227
#endif
/* !_MULTIAGENTDECISIONPROCESS_H_ */
228
229
230
// Local Variables: ***
231
// mode:c++ ***
232
// End: ***
src
base
MultiAgentDecisionProcessDiscrete.h
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2