#ifndef HYBRIDENTRYRESERVE_HPP
#define HYBRIDENTRYRESERVE_HPP
#include "bce.hpp"
#include <math.h>
private:
double weightOnOwnBid;
double reservePrice;
double entryFee;
double highBid;
public:
HybridEntryReserve(int nv,
int na,
double _weightOnOwnBid,
double _reservePrice,
double _entryFee,
double _highBid):
weightOnOwnBid(_weightOnOwnBid),
reservePrice(_reservePrice),
entryFee(_entryFee),
highBid(_highBid)
{ }
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);
double ownBid = highBid*static_cast<double>(actions[obj])/(numActions[obj]-1);
double otherBid = highBid*static_cast<double>(actions[1-obj])/(numActions[obj]-1);
if (ownBid == 0)
return 0.0;
if (ownBid < reservePrice || ownBid < otherBid)
return -entryFee;
if (ownBid > otherBid)
return val-ownBid*weightOnOwnBid-otherBid*(1.0-weightOnOwnBid)-entryFee;
else if (ownBid == otherBid)
return 0.5*(val-ownBid*weightOnOwnBid-otherBid*(1.0-weightOnOwnBid))-entryFee;
}
else if (obj==2)
{
double b0 = highBid*static_cast<double>(actions[0])/(numActions[0]-1);
double b1 = highBid*static_cast<double>(actions[1])/(numActions[1]-1);
double entryFeeRevenue = ceil(b0)*entryFee + ceil(b1)*entryFee;
double winningBid = b0;
if (b1 > b0)
winningBid = b1;
if (winningBid < reservePrice)
return entryFeeRevenue;
if (b0 >= b1)
return weightOnOwnBid*b0+(1.0-weightOnOwnBid)*b1+entryFeeRevenue;
else
return weightOnOwnBid*b1+(1.0-weightOnOwnBid)*b0+entryFeeRevenue;
}
return 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