MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
PartialJPPVIndexValuePair.cpp
Go to the documentation of this file.
1
28
#include "
PartialJPPVIndexValuePair.h
"
29
#include "
PartialJointPolicyPureVector.h
"
30
31
using namespace
std;
32
33
PartialJPPVIndexValuePair::PartialJPPVIndexValuePair
(
PartialJointPolicyPureVector
* jp,
double
val) :
34
PartialJointPolicyValuePair
(val)
35
{
36
_m_jpol
=0;
37
_m_jpolIndex
=jp->
GetIndex
();
38
_m_jpolDepth
=jp->
GetDepth
();
39
_m_pu
=jp->
GetInterfacePTPDiscretePure
();
40
}
41
42
PartialJPPVIndexValuePair::PartialJPPVIndexValuePair
(
const
PartialJointPolicyPureVector
& jp,
43
double
val) :
44
PartialJointPolicyValuePair
(val)
45
{
46
_m_jpol
=0;
47
_m_jpolIndex
=jp.
GetIndex
();
48
_m_jpolDepth
=jp.
GetDepth
();
49
_m_pastR
= jp.
GetPastReward
();
50
_m_pu
=jp.
GetInterfacePTPDiscretePure
();
51
}
52
53
PartialJPPVIndexValuePair::~PartialJPPVIndexValuePair
()
54
{
55
delete
_m_jpol
;
56
}
57
58
PartialJointPolicyPureVector
*
PartialJPPVIndexValuePair::GetPartialJPPV
()
59
{
60
if
(
_m_jpol
==0)
61
AllocateJPPV
();
62
63
return
(
_m_jpol
);
64
}
65
66
void
PartialJPPVIndexValuePair::AllocateJPPV
()
67
{
68
if
(
_m_jpol
==0)
// not yet instantiated, do it now
69
{
70
_m_jpol
=
new
PartialJointPolicyPureVector
(*
_m_pu
,
OHIST_INDEX
,
71
_m_pastR
,
_m_jpolDepth
);
72
// _m_jpol->SetDepth(_m_jpolDepth);
73
_m_jpol
->
SetIndex
(
_m_jpolIndex
);
74
}
75
}
76
77
string
PartialJPPVIndexValuePair::SoftPrint
()
const
78
{
79
stringstream ss;
80
ss <<
"PartialJPPVIndexValuePair: val="
<<
GetValue
() <<
", jpolIndex:"
;
81
ss <<
_m_jpolIndex
;
82
return
(ss.str());
83
}
84
85
string
PartialJPPVIndexValuePair::SoftPrintBrief
()
const
86
{
87
stringstream ss;
88
ss <<
"PartialJPPVIndexValuePair("
<<
GetValue
() <<
","
89
<<
_m_jpolIndex
<<
")"
;
90
return
(ss.str());
91
}
src
planning
PartialJPPVIndexValuePair.cpp
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2