MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
ObservationModelMappingSparse.h
Go to the documentation of this file.
1
28
/* Only include this header file once. */
29
#ifndef _OBSERVATIONMODELMAPPINGSPARSE_H_
30
#define _OBSERVATIONMODELMAPPINGSPARSE_H_ 1
31
32
/* the include directives */
33
#include "
Globals.h
"
34
#include "
ObservationModelDiscrete.h
"
35
#include <boost/numeric/ublas/matrix_sparse.hpp>
36
class
OGet
;
37
class
OGet_ObservationModelMapping
;
38
40
41
class
ObservationModelMappingSparse
:
42
public
ObservationModelDiscrete
43
{
44
public
:
45
#if BOOST_1_32_OR_LOWER // they renamed sparse_vector to mapped_vector
46
typedef
boost::numeric::ublas::sparse_matrix<double>
SparseMatrix
;
47
#else
48
typedef
boost::numeric::ublas::compressed_matrix<double>
SparseMatrix
;
49
#endif
50
51
52
private
:
53
54
std::vector<SparseMatrix* >
_m_O
;
55
56
protected
:
57
58
public
:
59
// Constructor, destructor and copy assignment.
61
ObservationModelMappingSparse
(
int
nrS = 1,
int
nrJA = 1,
int
nrJO = 1);
62
64
ObservationModelMappingSparse
(
const
ObservationModelMappingSparse
& OM);
66
~ObservationModelMappingSparse
();
67
69
double
Get
(
Index
ja_i,
Index
suc_s_i,
Index
jo_i)
const
70
{
return
((*
_m_O
[ja_i])(suc_s_i,jo_i)); }
71
72
//data manipulation funtions:
74
79
void
Set
(
Index
ja_i,
Index
suc_s_i,
Index
jo_i,
double
prob
)
80
{
81
// make sure probability is not 0
82
if
(prob >
PROB_PRECISION
)
83
(*
_m_O
[ja_i])(suc_s_i,jo_i)=
prob
;
84
}
85
87
const
SparseMatrix
*
GetMatrixPtr
(
Index
a)
const
88
{
return
(
_m_O
.at(a)); }
89
91
virtual
ObservationModelMappingSparse
*
Clone
()
const
92
{
return
new
ObservationModelMappingSparse
(*
this
); }
93
94
friend
class
OGet_ObservationModelMappingSparse
;
95
};
96
97
#endif
/* !_OBSERVATIONMODELMAPPINGSPARSE_H_*/
98
99
// Local Variables: ***
100
// mode:c++ ***
101
// End: ***
102
src
base
ObservationModelMappingSparse.h
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2