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