BCESolve
The BCESolve library

A detailed description of the BCESolve library.

Overview

The source module is comprised of a library of classes for specifying, solving, and exploring the solutions of two player games with incomplete information. This library provides the core functionality underling the BCEViewer program which is described in The BCEViewer graphical interface. A list of classes is contained here: BCESolve library. This page provides an overview of the object model, with additional details in the respective class pages.

Specifying a game

The first step in using the BCESolve library is translating the abstract formulation of a game into a format that can be understood by the library. This translation is facilitated by the BCEAbstractGame and BCEGame classes.

BCEAbstractGame has protected data members that store the number of actions, number of states, number of types, number of objectives, and whether the game has a product structure. BCEAbstractGame has multiple constructors. The default constructor is used primarily for creating "blank" games within the graphical interface. The second constructor takes four integer inputs, each specifying one of the above-mentioned parameters, and creates a game where each player has the same number of types and actions. The third constructor instead takes two-element vectors of actions and types. This constructor allows players to have different numbers of actions and types.

The BCEGame class derives from BCEAbstractGame. Its private members include the payoffs for each objective, the prior over each state, the conditional distribution of types, data for dominated actions, and data for feasible deviations.

BCEGame objects can be serialized and deserialized through static BCEGame::save and BCEGame::load methods. See allpayauction.cpp for an example. Serialized BCEGame objects can be loaded by BCEViewer.

Solving a game

Once one has specified the game, the next step is to solve that game by constructing a BCESolver from a BCEAbstractGame type reference. Once the BCESolver is constructed, the computation of the Bayes correlated equilibrium is invoked first by calling BCESolver::populate(), which constructs the linear probability and incentive constraints and objectives, and then by calling using BCESolver::solve, which uses Gurobi to solve the resulting linear program. The solve routine takes as an input a vector of weights on objectives in the associated BCEAbstractGame, which are used to define the objective for the linear program. One can also use BCESolver::mapBoundary to solve for all BCE that maximize weighted sum of a given pair of objectives.

Using the solution

The output of the algorithm is stored in a BCESolution object, which can be accessed using BCESolver::getSolution. BCESolution contains methods for accessing data of interest within the solution and accompanying game objects. The getExpectedObjectives method, for example, returns the expected objectives for the BCE stored in the given data.

BCESolution contains static methods for serialization (BCESolution::save) and deserialization (BCESolution::load). See allpayauction.cpp for an example of how these are used. Serialized BCESolution objects can then be loaded by BCEViewer.