#ifndef ALLPAYAUCTION_HPP
#define ALLPAYAUCTION_HPP
#include "bce.hpp"
#include "bceabstractgame.hpp"
#include "bcegame.hpp"
public:
AllPayAuction(int nv,int na):
{}
double prior (
int state,
const vector<int> & types)
const {
}
const vector<int> & actions,
int obj) const {
if (obj<2)
{
double val = static_cast<double>(state)/(numStates-1.0);
double ownBid = static_cast<double>(actions[obj])/(numActions[obj]-1.0);
double otherBid = static_cast<double>(actions[1-obj])/(numActions[obj]-1.0);
if (actions[obj]>actions[1-obj])
return val-ownBid;
else if (actions[obj]==actions[1-obj])
return 0.5*(val-ownBid);
else if (actions[obj] < actions[1-obj])
return -ownBid;
}
else if (obj==2)
{
double b0 = static_cast<double>(actions[0])/(numActions[0]-1.0);
double b1 = static_cast<double>(actions[1])/(numActions[1]-1.0);
return b0 + b1;
}
return 0.0;
}
};
#endif
The base class for games of incomplete information.
Definition: bceabstractgame.hpp:52
int numStates
The number of payoff relevant states.
Definition: bceabstractgame.hpp:65
virtual double objective(int state, const vector< int > &actions, int obj) const =0
Objective function.
virtual double prior(int state, const vector< int > &types) const =0
Prior over state and types.
BCEAbstractGame()
Default constructor.
Definition: bceabstractgame.cpp:25