MultiAgentDecisionProcess  Release 0.2.1
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
36  const BayesianGameIdenticalPayoff& bg) :
38 {}
39 
41 {
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);
56 
57  return(v);
58 }