MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
BGIPSolution.h
Go to the documentation of this file.
1
28
/* Only include this header file once. */
29
#ifndef _BGIPSOLUTION_H_
30
#define _BGIPSOLUTION_H_ 1
31
32
/* the include directives */
33
#include <iostream>
34
#include <set>
35
#include "
Globals.h
"
36
#include "
JointPolicyPureVector.h
"
37
#include "
FixedCapacityPriorityQueue.h
"
38
39
//forward declarations:
40
class
JPPVValuePair
;
41
class
PartialJPDPValPair;
42
44
class
BGIPSolution
45
{
46
private
:
47
48
const
Interface_ProblemToPolicyDiscretePure
&
_m_pu
;
49
JointPolicyPureVector
*
_m_policy
;
50
LIndex
_m_jpolIndex
;
51
double
_m_payoff
;
52
54
size_t
_m_nrSolutions
;
55
59
FixedCapacityPriorityQueue<JPPVValuePair *>
_m_q
;
60
61
//The set of Indicies of the policies added to the queue
62
//(to avoid adding duplicates).
63
std::set<Index>
_m_jpolIndices
;
64
65
protected
:
66
67
public
:
68
// Constructor, destructor and copy assignment.
70
BGIPSolution
(
const
Interface_ProblemToPolicyDiscretePure
& pu,
71
size_t
nrSolutions=1);
73
~BGIPSolution
();
74
75
void
SetPayoff
(
double
payoff) {
_m_payoff
=payoff; }
76
double
GetPayoff
()
const
{
return
(
_m_payoff
); }
77
78
void
SetPolicy
(
const
JointPolicyPureVector
&jpol);
79
void
SetPolicy
(
LIndex
jpolIndex);
80
81
const
JointPolicy
*
GetJointPolicy
()
const
{
return
(
_m_policy
); }
82
const
JointPolicyPureVector
&
GetJointPolicyPureVector
()
const
{
83
return
(*
_m_policy
); }
84
LIndex
GetPolicyIndex
() {
return
(
_m_jpolIndex
); }
85
86
void
Save
(std::string filename)
const
;
87
void
Load
(std::string filename);
88
89
void
Print
()
const
{ std::cout <<
SoftPrint
() << std::endl; }
90
std::string
SoftPrint
()
const
;
91
92
size_t
GetNrDesiredSolutions
()
const
{
return
_m_nrSolutions
;};
93
size_t
GetNrFoundSolutions
()
const
{
return
_m_q
.
size
();};
94
100
void
AddSolution
(
JointPolicyPureVector
&jp,
double
value );
101
102
JPPVValuePair
*
GetNextSolutionJPPV
() {
return
_m_q
.
top
(); };
103
void
PopNextSolutionJPPV
() {
_m_q
.
pop
(); };
104
bool
IsEmptyJPPV
() {
return
_m_q
.
empty
(); };
105
106
};
107
108
109
#endif
/* !_BGIPSOLUTION_H_ */
110
111
// Local Variables: ***
112
// mode:c++ ***
113
// End: ***
src
planning
BGIPSolution.h
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2