28#include "bceabstractgame.hpp"
29#include <boost/archive/text_iarchive.hpp>
30#include <boost/archive/text_oarchive.hpp>
79 double prior(
int state,
const vector<int> &types)
const
93 double prior(
int player,
int type)
const
96 vector<int> types (2,0);
98 for (
int state = 0; state <
numStates; state++)
100 for (types[1-player]=0;
103 probSum +=
prior(state,types);
124 bool setPrior(
int state,
double value)
146 int obj,
double value)
149 [actions[0] + actions[1]*
numActions[0]] = value;
175 int type,
int player)
const
182 int type,
int player,
bool value)
198 bool addType(
int player,
int position);
202 bool addAction(
int player,
int position);
207 template <
class Archive>
208 void serialize(Archive & ar,
const unsigned int version)
228 ofstream ofs(filename);
232 boost::archive::text_oarchive oa(ofs);
243 ifstream ifs(filename);
247 boost::archive::text_iarchive ia(ifs);
255 friend class boost::serialization::access;
The base class for games of incomplete information.
Definition: bceabstractgame.hpp:52
int numObjectives
The number of objective functions. Must be >= 2.
Definition: bceabstractgame.hpp:69
vector< int > numTypes
The number of private types for each player.
Definition: bceabstractgame.hpp:67
int numStates
The number of payoff relevant states.
Definition: bceabstractgame.hpp:65
vector< int > numActions
The number of action profiles for each player.
Definition: bceabstractgame.hpp:63
int numPlayers
The number of players, always 2.
Definition: bceabstractgame.hpp:61
bool hasProductStructureData
Indicates if the state has a product structure.
Definition: bceabstractgame.hpp:74
vector< int > numPrivateStates
Number of states for each player.
Definition: bceabstractgame.hpp:80
vector< string > objectiveLabels
Labels for the objectives.
Definition: bceabstractgame.hpp:82
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
bool removeState(int state)
Removes state from the game.
Definition: bcegame.cpp:176
static void save(const BCEGame &game, const char *filename)
Serialize a BCEGame object using Boost.
Definition: bcegame.hpp:226
bool removeType(int player, int type)
Remove type for player.
Definition: bcegame.cpp:224
bool addAction(int player, int position)
Add action for player at position.
Definition: bcegame.cpp:255
void serialize(Archive &ar, const unsigned int version)
Serialization routine.
Definition: bcegame.hpp:208
double conditional(int state, const vector< int > &types) const
Conditional distribution of types given states.
Definition: bcegame.hpp:111
bool removeAction(int player, int action)
Remove action for player.
Definition: bcegame.cpp:317
bool addType(int player, int position)
Add type for player at position.
Definition: bcegame.cpp:192
vector< vector< double > > conditionalData
Data for conditional distributions of types.
Definition: bcegame.hpp:55
bool removeObjective(int obj)
Removes the objective obj.
Definition: bcegame.cpp:147
double prior(int state, const vector< int > &types) const
Prior over state and types.
Definition: bcegame.hpp:79
vector< vector< vector< bool > > > dominatedData
Data for the dominated array.
Definition: bcegame.hpp:58
void setDominated(int action, int type, int player, bool value)
Set dominated.
Definition: bcegame.hpp:164
vector< double > priorData
Data for the prior.
Definition: bcegame.hpp:52
bool addState(int position)
Adds a new state after position.
Definition: bcegame.cpp:159
BCEGame()
Default constructor.
Definition: bcegame.cpp:25
static void load(BCEGame &game, const char *filename)
Deserialize a BCEGame object using Boost.
Definition: bcegame.hpp:241
bool feasibleDeviation(int action, int dev, int type, int player) const
Check if deviation is feasible.
Definition: bcegame.hpp:174
bool dominated(int action, int type, int player) const
Indicates if a combination of actions and types is dominated.
Definition: bcegame.hpp:158
bool setConditional(int state, const vector< int > &types, double value)
Sets the prior.
Definition: bcegame.hpp:117
double prior(int player, int type) const
Prior over types.
Definition: bcegame.hpp:93
bool setObjective(int state, const vector< int > &actions, int obj, double value)
Sets the objective.
Definition: bcegame.hpp:145
~BCEGame()
Destructor.
Definition: bcegame.hpp:72
bool setFeasibleDeviation(int action, int dev, int type, int player, bool value)
Set feasible.
Definition: bcegame.hpp:181
double prior(int state) const
Prior over state.
Definition: bcegame.hpp:87
bool addObjective(int position, string label)
Adds a new objective after position.
Definition: bcegame.cpp:132
vector< vector< vector< double > > > objectiveData
Data for the objectives.
Definition: bcegame.hpp:49
double objective(int state, const vector< int > &actions, int obj) const
Objective function.
Definition: bcegame.hpp:137
vector< vector< vector< bool > > > feasibleDeviationData
Data for the feasibleDeviation array.
Definition: bcegame.hpp:61