ActionRet HoldemTournamentAIManual::pfLimp(const TableTexture& t, bool debug)
{
ActionRet ret;
ret.name="pfLimp";
ret.action=FOLD;
ret.amt=0;
profile_line(" -- pfLimp() -- ");
string debugstr="";
PokerHand h=table->getHand();
bool limp=false;
int relStack=table->getStack(getAIPlayer())/double(table->getCostToCall());
if (relStack<20&&h[0].GetSuit()==h[1].GetSuit()) {
debugstr=" [s] "; }
if (relStack<20&&abs(h[0].GetRank()-h[1].GetRank())==1) {
debugstr=" [c] "; }
if (abs(h[0].GetRank()-h[1].GetRank())==1&&h[0].GetSuit()==h[1].GetSuit()) {
debugstr=" [sc] ";
if (h[0].GetIndex()=='A'||h[0].GetIndex()=='K') {
limp=false; }
else {
limp=true;
}
}
if (relStack<20&&h[0].GetRank()==h[1].GetRank()&&h[1].GetRank()<9) {
debugstr=" [p] ";
limp=true;
}
if (getTableHandedness()<2) limp=false;
if (t.desperate||t.uberDesperate||t.medAgg||t.uberAgg||table->getBB()>=80) {
limp=false;
}
if (debug) {
cout << "limp: " << limp << endl;
cout << " handedness: " << getTableHandedness() << endl;
cout << " stack/cost2call: " << table->getStack(getAIPlayer())/double(table->getCostToCall()) << debugstr << endl;
cout << endl;
}
if (limp) {
ret.action=CALL;
ret.amt=table->getCostToCall(getAIPlayer());
}
return ret;
}