MultiAgentDecisionProcess
BGIP_SolverCE Class Reference

BGIP_SolverCE is a class that performs Cross Entropy optimization for identical payoff Bayesian Games. More...

#include <BGIP_SolverCE.h>

Inheritance diagram for BGIP_SolverCE:
[legend]

Public Member Functions

 BGIP_SolverCE (const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &bg, size_t nrCERestarts=10, size_t nrIterations=30, size_t nrSamples=40, size_t nrSamplesForUpdate=15, bool use_hard_threshold=true, double CEalpha=0.3)
 Constructor. More...
 
bool IsExactSolver () const
 Methods should indicated whether they compute exact (optimal) solutions or not. More...
 
void SetCBGlowerBound (double lb)
 
void SetCBGupperBound (double upperbound)
 
double Solve ()
 The methods that performs the planning. More...
 
- Public Member Functions inherited from BayesianGameIdenticalPayoffSolver_T< JointPolicyPureVector >
 BayesianGameIdenticalPayoffSolver_T (const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &bg, size_t nrDesiredSolutions=1)
 (default) Constructor More...
 
virtual boost::shared_ptr
< JointPolicyDiscretePure
GetNewJpol () const
 this gives a implementation of GetNewJpol (specified in BayesianGameIdenticalPayoffSolver) More...
 
- Public Member Functions inherited from BayesianGameIdenticalPayoffSolver
void AddSolution (const JointPolicyPureVector &jp, double value)
 
void AddSolution (const JointPolicyPureVectorForClusteredBG &jp, double value)
 
void AddSolution (LIndex jpolIndex, double value)
 
 BayesianGameIdenticalPayoffSolver (const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &bg, size_t nrDesiredSolutions=1)
 (default) Constructor More...
 
double Evaluate (const JointPolicyPureVector &jpolBG) const
 
double Evaluate (const JointPolicyPureVectorForClusteredBG &jpolBG) const
 
boost::shared_ptr< const
BayesianGameIdenticalPayoffInterface
GetBGIPI () const
 
double GetExpectedReward () const
 
const boost::shared_ptr
< JointPolicy
GetJointPolicy () const
 
const JointPolicyPureVectorGetJointPolicyPureVector () const
 
boost::shared_ptr< JPPVValuePairGetNextSolutionJPPV () const
 
boost::shared_ptr
< PartialJPDPValuePair
GetNextSolutionPJPDP () const
 
size_t GetNrDesiredSolutions () const
 
size_t GetNrFoundSolutions () const
 Gets the found number of solutions. More...
 
double GetPayoff () const
 
std::ofstream * GetResultsOFStream () const
 
std::ofstream * GetTimingsOFStream () const
 
bool GetWriteAnyTimeResults () const
 
bool IsEmptyJPPV () const
 
bool IsEmptyPJPDP () const
 
void PopNextSolutionJPPV ()
 
void PopNextSolutionPJPDP ()
 
void SaveSolution (const std::string &filename) const
 
void SetAnyTimeResults (bool turn_on, std::ofstream *results, std::ofstream *timings)
 Turns Anytime results on and of. More...
 
virtual void SetDeadline (double deadlineInSeconds)
 To limit the amount of time the solver uses. More...
 
void SetNrDesiredSolutions (size_t n)
 Gets the desired number of solutions to be returned. More...
 
std::string SoftPrintSolution () const
 
virtual ~BayesianGameIdenticalPayoffSolver ()
 Destructor. More...
 

Protected Member Functions

void UpdateCEProbDistribution (std::vector< std::vector< std::vector< double > > > &Xi, const std::list< JPPVValuePair * > &best_samples)
 
- Protected Member Functions inherited from BayesianGameIdenticalPayoffSolver
virtual void CheckDeadline (const std::string &errorMessage) const
 Checks whether the deadline has expired. Throws EDeadline. More...
 
virtual void InitDeadline ()
 Should be called at the beginning of Solve(). More...
 

Static Protected Member Functions

static void OrderedInsertJPPVValuePair (JPPVValuePair *pv, std::list< JPPVValuePair * > &l)
 
static void PrintBestSamples (const std::list< JPPVValuePair * > &l)
 
static void SampleIndividualPolicy (PolicyPureVector &pol, const std::vector< std::vector< double > > &typeActionProbs)
 

Private Attributes

double _m_alpha
 
size_t _m_nrIterations
 
size_t _m_nrJointPoliciesForUpdate
 
size_t _m_nrRestarts
 
size_t _m_nrSampledJointPolicies
 
bool _m_use_gamma
 

Detailed Description

BGIP_SolverCE is a class that performs Cross Entropy optimization for identical payoff Bayesian Games.

Constructor & Destructor Documentation

BGIP_SolverCE::BGIP_SolverCE ( const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > &  bg,
size_t  nrCERestarts = 10,
size_t  nrIterations = 30,
size_t  nrSamples = 40,
size_t  nrSamplesForUpdate = 15,
bool  use_hard_threshold = true,
double  CEalpha = 0.3 
)
inline

Constructor.

Directly Associates a problem with the planner Information regarding the problem is used to construct a joint policy of the proper shape.

Member Function Documentation

bool BGIP_SolverCE::IsExactSolver ( ) const
inlinevirtual

Methods should indicated whether they compute exact (optimal) solutions or not.

Implements BayesianGameIdenticalPayoffSolver.

static void BGIP_SolverCE::OrderedInsertJPPVValuePair ( JPPVValuePair pv,
std::list< JPPVValuePair * > &  l 
)
inlinestaticprotected

References JointPolicyValuePair::GetValue().

Referenced by Solve().

static void BGIP_SolverCE::PrintBestSamples ( const std::list< JPPVValuePair * > &  l)
inlinestaticprotected

References JointPolicyValuePair::GetValue().

Referenced by Solve().

static void BGIP_SolverCE::SampleIndividualPolicy ( PolicyPureVector pol,
const std::vector< std::vector< double > > &  typeActionProbs 
)
inlinestaticprotected

References PolicyPureVector::SetAction().

Referenced by Solve().

void BGIP_SolverCE::SetCBGlowerBound ( double  lb)
inlinevirtual
void BGIP_SolverCE::SetCBGupperBound ( double  upperbound)
inlinevirtual
void BGIP_SolverCE::UpdateCEProbDistribution ( std::vector< std::vector< std::vector< double > > > &  Xi,
const std::list< JPPVValuePair * > &  best_samples 
)
inlineprotected

Member Data Documentation

double BGIP_SolverCE::_m_alpha
private
size_t BGIP_SolverCE::_m_nrIterations
private

Referenced by Solve().

size_t BGIP_SolverCE::_m_nrJointPoliciesForUpdate
private

Referenced by Solve().

size_t BGIP_SolverCE::_m_nrRestarts
private

Referenced by Solve().

size_t BGIP_SolverCE::_m_nrSampledJointPolicies
private

Referenced by Solve().

bool BGIP_SolverCE::_m_use_gamma
private

Referenced by Solve().