23#ifndef BCESOLUTION_HPP
24#define BCESOLUTION_HPP
26#include "bcecommon.hpp"
28#include "bceexception.hpp"
29#include "bcequilibrium.hpp"
30#include "bcecounter.hpp"
32#include <boost/serialization/list.hpp>
33#include <boost/serialization/vector.hpp>
34#include <boost/serialization/map.hpp>
35#include <boost/archive/text_iarchive.hpp>
36#include <boost/archive/text_oarchive.hpp>
37#include <boost/archive/binary_iarchive.hpp>
38#include <boost/archive/binary_oarchive.hpp>
39#include <boost/serialization/utility.hpp>
87 template <
class Archive>
88 void serialize(Archive& ar,
const unsigned int version)
161 const map<int,double> &distribution)
const;
168 vector< vector<double> > & objectiveValues)
const;
180 const vector< vector<int> > &actionConditions,
181 const vector< vector<int> > &typeConditions,
183 const vector<bool> &actionMarginal,
184 const vector<bool> &typeMarginal,
185 vector<double> &distribution)
const;
197 const bool getIsBoundaryMapped()
const {
204 ofstream ofs(filename);
208 boost::archive::text_oarchive oa(ofs);
220 ifstream ifs(filename);
224 boost::archive::text_iarchive ia(ifs);
233 friend class boost::serialization::access;
Exception class for BCESolve.
Definition: bceexception.hpp:33
@ FailedOpen
Definition: bceexception.hpp:46
The base class for games of incomplete information.
Definition: bcegame.hpp:40
Class for storing data produced by BCESolver.
Definition: bcesolution.hpp:64
void getExpectedObjectives(vector< double > &objectiveValues) const
Gets the expected objectives under the current BCE.
Definition: bcesolution.cpp:97
const vector< vector< double > > & getMapBoundaryWeights() const
Returns the mapBoundary weights.
Definition: bcesolution.hpp:188
static void load(BCESolution &data, const char *filename)
Deserialize a BCESolution object using Boost.
Definition: bcesolution.hpp:218
void clearEquilibria()
Clears all equilibria.
Definition: bcesolution.cpp:32
void consolidateEquilibria()
Consolidates equilibria.
Definition: bcesolution.cpp:44
vector< vector< double > > mapBoundaryWeights
Matrix of weights on mapBoundary objectives.
Definition: bcesolution.hpp:79
const vector< double > getMainObjectiveWeights() const
Returns the main objective weights.
Definition: bcesolution.hpp:193
BCESolution()
Default constructor.
Definition: bcesolution.hpp:100
vector< double > mainObjectiveWeights
Vector of weights on the main objective.
Definition: bcesolution.hpp:81
BCESolution & operator=(const BCESolution &rhs)
Assignment operator.
Definition: bcesolution.cpp:82
void addEquilibrium(const map< int, double > &distr)
Appends distr to the end of the list newEquilibria.
Definition: bcesolution.cpp:38
bool boundaryMapped
True if boundary was mapped in the solver.
Definition: bcesolution.hpp:83
~BCESolution()
Destructor.
Definition: bcesolution.hpp:112
double getDeviationObjectives(int player, int action, int type, vector< vector< double > > &objectiveValues) const
Calculates deviation objectives.
Definition: bcesolution.cpp:169
void setBoundaryMapped(const bool isMapped)
Sets boundaryMapped status.
Definition: bcesolution.hpp:120
void serialize(Archive &ar, const unsigned int version)
Serialization routine.
Definition: bcesolution.hpp:88
void setCurrentEquilibrium(int equilibriumIndex)
Set current equilibrium.
Definition: bcesolution.cpp:69
void setMapBoundaryWeights(const vector< vector< double > > &weights)
Sets mapBoundaryWeights.
Definition: bcesolution.hpp:123
const BCEGame & getGame() const
Returns the game.
Definition: bcesolution.hpp:134
BCEGame game
The game that the equilibria correspond to.
Definition: bcesolution.hpp:67
list< BCEquilibrium > newEquilibria
List of new equilibria that have not yet been consolidated.
Definition: bcesolution.hpp:69
vector< BCEquilibrium > equilibria
Consolidated vector of equilibria.
Definition: bcesolution.hpp:71
int currentEquilibrium
Index of the current equilibrium in BCESolution::equilibria.
Definition: bcesolution.hpp:73
const BCEquilibrium & getEquilibrium(int equilibriumIndex) const
Returns the equilibrium at equilibriumIndex.
Definition: bcesolution.cpp:58
static void save(const BCESolution &data, const char *filename)
Serialize a BCESolution object using Boost.
Definition: bcesolution.hpp:202
void setMainObjectiveWeights(const vector< double > &weights)
Sets main objective weights.
Definition: bcesolution.hpp:126
double getConditionalMarginal(const vector< int > &stateConditions, const vector< vector< int > > &actionConditions, const vector< vector< int > > &typeConditions, bool stateMarginal, const vector< bool > &actionMarginal, const vector< bool > &typeMarginal, vector< double > &distribution) const
Computes the marginal conditional distribution of a BCE.
Definition: bcesolution.cpp:261
Class for storing a BCE.
Definition: bcequilibrium.hpp:44