MultiAgentDecisionProcess
|
BayesianGameIdenticalPayoffSolver is an interface for solvers for Bayesian games with identical payoff. More...
#include <BayesianGameIdenticalPayoffSolver.h>
Public Member Functions | |
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 JointPolicyPureVector & | GetJointPolicyPureVector () const |
virtual boost::shared_ptr < JointPolicyDiscretePure > | GetNewJpol () const |
returns a new policy to be used with this BayesianGameIdenticalPayoffSolver More... | |
boost::shared_ptr< JPPVValuePair > | GetNextSolutionJPPV () 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 |
virtual bool | IsExactSolver () const =0 |
Methods should indicated whether they compute exact (optimal) solutions or not. More... | |
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 | SetCBGlowerBound (double lowerbound)=0 |
virtual void | SetCBGupperBound (double ub)=0 |
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 double | Solve ()=0 |
The methods that performs the planning. More... | |
virtual | ~BayesianGameIdenticalPayoffSolver () |
Destructor. More... | |
Protected Member Functions | |
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... | |
Private Attributes | |
double | _m_deadlineInSeconds |
To limit the amount of time the solver uses. More... | |
boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > | _m_referredBG |
std::ofstream * | _m_results_f |
the file to which writes the results are written More... | |
BGIPSolution | _m_solution |
Stores the solution found by the solver. More... | |
tms | _m_timeAtStartOfSolving |
std::ofstream * | _m_timings_f |
the file to which writes the timings of the results are written More... | |
bool | _m_writeAnyTimeResults |
boolean that indicates whether anytime results should be written More... | |
BayesianGameIdenticalPayoffSolver is an interface for solvers for Bayesian games with identical payoff.
This is the non-templated version, hence the two versions of Evaluate().
BayesianGameIdenticalPayoffSolver::BayesianGameIdenticalPayoffSolver | ( | const boost::shared_ptr< const BayesianGameIdenticalPayoffInterface > & | bg, |
size_t | nrDesiredSolutions = 1 |
||
) |
(default) Constructor
takes a reference to the BG to be solved. nrDesiredSolutions is the number of solutions that the solver should return. I.e., if set higher than 1, it returns the k best found joint policies.
|
inlinevirtual |
Destructor.
|
inline |
References BGIPSolution::AddSolution().
Referenced by BGIP_SolverBranchAndBound< JP >::ConvertNodeToPolicyAndAddToSolution(), BGCG_SolverFG::ProcessFoundConfigurations_AI(), BGCG_SolverFG::ProcessFoundConfigurations_ATI(), BGCG_SolverRandom::Solve(), BGIP_SolverRandom::Solve(), BGCG_SolverMaxPlus::Solve(), BGIP_SolverMaxPlus< JP >::Solve(), BGCG_SolverNonserialDynamicProgramming::Solve(), BGIP_SolverBFSNonIncremental< JP >::Solve(), BGIP_SolverBruteForceSearch< JP >::Solve(), BGIP_SolverAlternatingMaximization< JP >::Solve(), and BGIP_SolverCE::Solve().
|
inline |
References BGIPSolution::AddSolution().
|
inline |
References BGIPSolution::AddSolution().
|
protectedvirtual |
Checks whether the deadline has expired. Throws EDeadline.
References _m_deadlineInSeconds, and _m_timeAtStartOfSolving.
Referenced by BGIP_SolverBranchAndBound< JP >::ComputeCompleteInformationValues(), BGIP_SolverBranchAndBound< JP >::ReSolve(), BGIP_SolverAlternatingMaximization< JP >::Solve(), and BGIP_SolverCE::Solve().
double BayesianGameIdenticalPayoffSolver::Evaluate | ( | const JointPolicyPureVector & | jpolBG | ) | const |
References GetBGIPI(), JointPolicyPureVector::GetJointActionIndex(), BayesianGameBase::GetNrJointTypes(), BayesianGameBase::GetProbability(), and BayesianGameIdenticalPayoffInterface::GetUtility().
Referenced by BGIP_SolverAlternatingMaximization< JP >::ComputeBestResponse(), and BGIP_SolverAlternatingMaximization< JP >::Solve().
double BayesianGameIdenticalPayoffSolver::Evaluate | ( | const JointPolicyPureVectorForClusteredBG & | jpolBG | ) | const |
|
inline |
Referenced by BGIP_IncrementalSolverInterface::AllSolutionsHaveBeenReturned(), BGIP_SolverAlternatingMaximization< JP >::ComputeBestResponse(), Evaluate(), BGIP_IncrementalSolverInterface_T< JP >::GetNewJpol(), BayesianGameIdenticalPayoffSolver_T< JointPolicyPureVector >::GetNewJpol(), BGIP_SolverBranchAndBound< JP >::ReSolve(), BGIP_SolverRandom::Solve(), BGIP_SolverMaxPlus< JP >::Solve(), BGIP_SolverBruteForceSearch< JP >::Solve(), BGIP_SolverBFSNonIncremental< JP >::Solve(), BGIP_SolverAlternatingMaximization< JP >::Solve(), BGIP_SolverCE::Solve(), and BGIP_SolverCE::UpdateCEProbDistribution().
|
inline |
References BGIPSolution::GetPayoff().
|
inline |
References BGIPSolution::GetJointPolicy().
|
inline |
References BGIPSolution::GetJointPolicyPureVector().
Referenced by AlphaVectorBG::BeliefBackupBGIP_Solver(), and GMAA_MAA_ELSI::CAVNP_quick_n_dirty2().
|
virtual |
returns a new policy to be used with this BayesianGameIdenticalPayoffSolver
Reimplemented in BayesianGameIdenticalPayoffSolver_T< JP >, BayesianGameIdenticalPayoffSolver_T< JointPolicyPureVector >, and BGIP_IncrementalSolverInterface_T< JP >.
References _m_referredBG.
Referenced by BGCG_SolverFG::ProcessFoundConfigurations_AI(), BGCG_SolverFG::ProcessFoundConfigurations_ATI(), BGCG_SolverRandom::Solve(), and BGCG_SolverMaxPlus::Solve().
|
inline |
References BGIPSolution::GetNextSolutionJPPV().
Referenced by BGIP_SolverBFSNonIncremental< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverBruteForceSearch< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverAlternatingMaximization< JP >::GetNextJointPolicyAndValueSpecific(), and BGIP_SolverBranchAndBound< JP >::GetNextJointPolicyAndValueSpecific().
|
inline |
References BGIPSolution::GetNextSolutionPJPDP().
Referenced by BGIP_SolverBFSNonIncremental< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverBruteForceSearch< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverAlternatingMaximization< JP >::GetNextJointPolicyAndValueSpecific(), and BGIP_SolverBranchAndBound< JP >::GetNextJointPolicyAndValueSpecific().
|
inline |
References BGIPSolution::GetNrDesiredSolutions().
Referenced by BGIP_IncrementalSolverInterface::AllSolutionsHaveBeenReturned(), BGIP_SolverBranchAndBound< JP >::ProcessFullySpecifiedNode(), BGIP_SolverBranchAndBound< JP >::ReSolve(), BGCG_SolverRandom::Solve(), BGIP_SolverRandom::Solve(), BGIP_SolverBruteForceSearch< JP >::Solve(), BGIP_SolverBFSNonIncremental< JP >::Solve(), and BGCG_SolverFG::Solve().
|
inline |
Gets the found number of solutions.
References BGIPSolution::GetNrFoundSolutions().
Referenced by BGIP_SolverBranchAndBound< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverBranchAndBound< JP >::ReSolve(), and BGIP_SolverAlternatingMaximization< JP >::Solve().
|
inline |
References BGIPSolution::GetPayoff().
Referenced by BGIP_SolverBranchAndBound< JP >::ReSolve().
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtual |
Should be called at the beginning of Solve().
Referenced by BGIP_SolverAlternatingMaximization< JP >::Solve(), BGIP_SolverCE::Solve(), and BGIP_SolverBranchAndBound< JP >::Solve().
|
inline |
References BGIPSolution::IsEmptyJPPV().
Referenced by BGIP_SolverBFSNonIncremental< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverBruteForceSearch< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverAlternatingMaximization< JP >::GetNextJointPolicyAndValueSpecific(), and BGIP_SolverBranchAndBound< JP >::GetNextJointPolicyAndValueSpecific().
|
inline |
References BGIPSolution::IsEmptyPJPDP().
Referenced by BGIP_SolverBFSNonIncremental< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverBruteForceSearch< JP >::GetNextJointPolicyAndValueSpecific(), BGIP_SolverAlternatingMaximization< JP >::GetNextJointPolicyAndValueSpecific(), and BGIP_SolverBranchAndBound< JP >::GetNextJointPolicyAndValueSpecific().
|
pure virtual |
Methods should indicated whether they compute exact (optimal) solutions or not.
Implemented in BGIP_SolverBranchAndBound< JP >, BGIP_SolverCE, BGIP_SolverAlternatingMaximization< JP >, BGIP_SolverBFSNonIncremental< JP >, BGIP_SolverBruteForceSearch< JP >, BGIP_SolverMaxPlus< JP >, BGCG_SolverFG, BGCG_SolverNonserialDynamicProgramming, BGCG_SolverMaxPlus, BGIP_SolverRandom, and BGCG_SolverRandom.
|
inline |
|
inline |
|
inline |
References BGIPSolution::Save().
void BayesianGameIdenticalPayoffSolver::SetAnyTimeResults | ( | bool | turn_on, |
std::ofstream * | results, | ||
std::ofstream * | timings | ||
) |
Turns Anytime results on and of.
When turning on, valid ofstream pointers must be provided for the results and timings file.
References _m_results_f, _m_timings_f, and _m_writeAnyTimeResults.
|
pure virtual |
Implemented in BGIP_SolverBranchAndBound< JP >, BGIP_SolverCE, BGIP_SolverBFSNonIncremental< JP >, BGIP_SolverBruteForceSearch< JP >, BGIP_SolverAlternatingMaximization< JP >, BGIP_SolverMaxPlus< JP >, BGCG_SolverFG, BGCG_SolverNonserialDynamicProgramming, BGCG_SolverMaxPlus, BGIP_SolverRandom, and BGCG_SolverRandom.
|
pure virtual |
Implemented in BGIP_SolverBranchAndBound< JP >, BGIP_SolverCE, BGIP_SolverBFSNonIncremental< JP >, BGIP_SolverBruteForceSearch< JP >, BGIP_SolverAlternatingMaximization< JP >, BGIP_SolverMaxPlus< JP >, BGCG_SolverFG, BGCG_SolverNonserialDynamicProgramming, BGCG_SolverMaxPlus, BGIP_SolverRandom, and BGCG_SolverRandom.
|
inlinevirtual |
To limit the amount of time the solver uses.
Referenced by BGIP_SolverCreator_BnB< JP >::operator()(), BGIP_SolverCreator_AM< JP >::operator()(), and BGIP_SolverCreator_CE::operator()().
|
inline |
Gets the desired number of solutions to be returned.
References BGIPSolution::SetNrDesiredSolutions().
Referenced by GMAA_MAAstar::ConstructAndValuateNextPolicies(), and GMAA_MAAstarCluster::ConstructAndValuateNextPolicies().
|
inline |
References BGIPSolution::SoftPrint().
|
pure virtual |
The methods that performs the planning.
Returns the expected reward.
Implemented in BGIP_SolverBranchAndBound< JP >, BGIP_SolverCE, BGIP_SolverAlternatingMaximization< JP >, BGCG_SolverFG, BGIP_SolverBFSNonIncremental< JP >, BGIP_SolverBruteForceSearch< JP >, BGCG_SolverNonserialDynamicProgramming, BGIP_SolverMaxPlus< JP >, BGCG_SolverMaxPlus, BGCG_Solver, BGIP_SolverRandom, and BGCG_SolverRandom.
Referenced by AlphaVectorBG::BeliefBackupBGIP_Solver().
|
private |
To limit the amount of time the solver uses.
Referenced by CheckDeadline().
|
private |
Referenced by GetNewJpol().
|
private |
the file to which writes the results are written
Referenced by SetAnyTimeResults().
|
private |
Stores the solution found by the solver.
Referenced by BGIP_SolverAlternatingMaximization< JP >::Solve().
|
private |
Referenced by CheckDeadline().
|
private |
the file to which writes the timings of the results are written
Referenced by SetAnyTimeResults().
|
private |
boolean that indicates whether anytime results should be written
Referenced by SetAnyTimeResults().