MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
BGIP_SolverRandom.cpp
Go to the documentation of this file.
1
28
#include "
BGIP_SolverRandom.h
"
29
#include "
TimeTools.h
"
30
#include <float.h>
31
32
using namespace
std;
33
34
//Default constructor
35
BGIP_SolverRandom::BGIP_SolverRandom
(
36
const
BayesianGameIdenticalPayoff
& bg) :
37
BayesianGameIdenticalPayoffSolver
<
JointPolicyPureVector
>(bg)
38
{}
39
40
double
BGIP_SolverRandom::Solve
()
41
{
42
JointPolicyPureVector
jpol(*
GetReferred
());
43
jpol.
RandomInitialization
();
44
45
double
v = 0.0;
46
47
for
(
Index
jt = 0; jt <
GetReferred
()->
GetNrJointTypes
(); jt++)
48
{
49
double
P_jt =
GetReferred
()->
GetProbability
(jt);
50
Index
ja = jpol.
GetJointActionIndex
(jt);
51
v += P_jt *
GetReferred
()->
GetUtility
(jt, ja);
52
}
53
54
_m_solution
.
SetPolicy
(jpol);
55
_m_solution
.
SetPayoff
(v);
56
57
return
(v);
58
}
src
planning
BGIP_SolverRandom.cpp
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2