Poker-AI.org

Poker AI and Botting Discussion Forum
It is currently Mon Nov 13, 2023 2:20 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Mar 10, 2015 12:07 pm 
Offline
New Member

Joined: Tue Mar 10, 2015 11:59 am
Posts: 2
Hi,

I have bought the software poker genius and have the correct meerkat-api directly from poker-genius themselves.
I have tried to create a VERY VERY VERY SIMPLE bot, that will ALWAYS call no matter what..
Instead I ended up with a bot that folds... Every single time. AA? Still folding...

Compiling, and everything should be fine - been supervised by the guys from poker genius.

I have no idea whats wrong... any ideas?

Code:
package bots.demobots;

import javax.swing.JPanel;

import com.biotools.meerkat.Action;
import com.biotools.meerkat.Card;
import com.biotools.meerkat.GameInfo;
import com.biotools.meerkat.Player;
import com.biotools.meerkat.util.Preferences;

/**
 * A simple bot that always calls
 */
public class AlwaysCallBot implements Player {
   private int ourSeat; // our seat for the current hand
   private GameInfo gi; // general game information
   private Preferences prefs;

   public AlwaysCallBot() {
   }

   /**
    * An event called to tell us our hole cards and seat number
    * @param c1 your first hole card
    * @param c2 your second hole card
    * @param seat your seat number at the table
    */
   public void holeCards(Card c1, Card c2, int seat) {
      this.ourSeat = seat;
   }

   /**
    * Requests an Action from the player
    * Called when it is the Player's turn to act.
    */
   public Action getAction() {
        public Action getAction() {
            double toCall = gi.getAmountToCall(ourSeat);
            if (toCall == 0.0D) {
                    return Action.checkAction();
            }
            return Action.callAction(toCall);
   }

   /**
    * If you implement the getSettingsPanel() method, your bot will display
    * the panel in the Opponent Settings Dialog.
    * @return a GUI for configuring your bot (optional)
    */
   public JPanel getSettingsPanel() {
      return null;
   }

   /**
    * Get the current settings for this bot.
    */
   public Preferences getPreferences() {
      return prefs;
   }

   /**
    * Load the current settings for this bot.
    */
   public void init(Preferences playerPrefs) {
      this.prefs = playerPrefs;
   }

   /**
    * A new betting round has started.
    */
   public void stageEvent(int stage) {
   }

   /**
    * A showdown has occurred.
    * @param pos the position of the player showing
    * @param c1 the first hole card shown
    * @param c2 the second hole card shown
    */
   public void showdownEvent(int seat, Card c1, Card c2) {
   }

   /**
    * A new game has been started.
    * @param gi the game stat information
    */
   public void gameStartEvent(GameInfo gInfo) {
      this.gi = gInfo;
   }

   /**
    * An event sent when all players are being dealt their hole cards
    */
   public void dealHoleCardsEvent() {
   }

   /**
    * An action has been observed.
    */
   public void actionEvent(int pos, Action act) {
   }

   /**
    * The game info state has been updated
    * Called after an action event has been fully processed
    */
   public void gameStateChanged() {
   }

   /**
    * The hand is now over.
    */
   public void gameOverEvent() {
   }

   /**
    * A player at pos has won amount with the hand handName
    */
   public void winEvent(int pos, double amount, String handName) {
   }

}


And the PD file:
Code:
# All plug-ins must run through the following class:
PLAYER_CLASS=PlugInOpponent

# put your bot's full class name here:
BOT_PLAYER_CLASS=bots.demobots.AlwaysCallBot

# Your Bot's name:
PLAYER_NAME=AlwaysCallBot

# Your bot engine name:
AI_NAME=DemoBot

# Options for your Bot:
DEBUG=true
RANDOM_SEED=31313
ALWAYS_CALL_MODE=true


Top
 Profile  
 
PostPosted: Thu Mar 12, 2015 3:49 am 
Offline
Junior Member

Joined: Thu May 23, 2013 11:35 pm
Posts: 23
should this even compile?
your getAction method is missing a closing brace }
edit: i see that there's some very strange code, 2 getActions?


Top
 Profile  
 
PostPosted: Thu Mar 12, 2015 9:39 am 
Offline
New Member

Joined: Tue Mar 10, 2015 11:59 am
Posts: 2
Oh sorry I dont know what happend :S

The actual code is

Code:
        public Action getAction() {
 
                double toCall = gi.getAmountToCall(ourSeat);
 
                if (toCall == 0.0D) {
 
                        return Action.checkAction();
 
                }
 
                return Action.callAction(toCall);
 
        }



Which still doesn't work :/


Top
 Profile  
 
PostPosted: Wed Mar 18, 2015 9:39 pm 
Offline
New Member

Joined: Thu Apr 24, 2014 8:18 pm
Posts: 3
I think your files were taken from the OpenTestBed so I see a few errors:

1. java file: you don't need the first two strings.

So change this:

Code:
package bots.demobots;

import javax.swing.JPanel;


to

Code:
import java.awt.event.*;

import javax.swing.*;


2. pd file:

Replace:

Code:
BOT_PLAYER_CLASS=bots.demobots.AlwaysCallBot


with

Code:
BOT_PLAYER_CLASS=AlwaysCallBot


and add the following line:

Code:
PLAYER_JAR_FILE=data/bots/AlwaysCallBot.jar


I also recommend to read this post: http://poker-genius.com/forum/Thread-Writing-a-Poker-bot

So I've tested this bot with Poker Genius and it works great.
You'll get the perfect calling-station hehe.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group