Image Image Image




Post new topic Reply to topic  [ 91 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 1:16 am 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
I'm afraid I don't understand the question.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 5:52 am 
Offline
Senior member
User avatar

Posts: 168
Favourite Bot: none
I just got a chance to check this out and it looks like you've done a great job with it. A bunch of questions that I hope you don't mind answering:

-On the wiki it says there is a function cashGameDescription.setRebuyAmount, but this doesn't exist in my version. Did I mess up something with mercurial or am I supposed to implement this myself. Also is there an easy way to do it with the same starting stacks for each hand? I realize I can do all this myself, just checking to see if my version is wrong/what has already been done.

-I tried to run the MCTS bot but it ran out of heap space. Does it require a ton of space or did I do something wrong?

-The output hand history says limit holdem. Did I make it play limit or is that just how the hand histories are? I just ran it at the default settings after I pulled it.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 9:13 am 
Offline
Regular member
User avatar

Posts: 57
Favourite Bot: favourite_bot
bluegaspode wrote:
I'm afraid I don't understand the question.


What I mean is: there are some methods in the AlwaysCallBot which are abstract, i.e. are methods which have to implemented by every bot but don't have a specific logic to them. For example getSettingsPanel(), getPreferences(), init(Preferences) are not tied to the bot logic, but are of administrative character. Wouldn't it be better to have those in the abstractBot then?

Quote:
-I tried to run the MCTS bot but it ran out of heap space. Does it require a ton of space or did I do something wrong?


Same problem here. AFAIK it takes quite a lot of space.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 9:35 am 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
Hi pplatypus

Quote:
On the wiki it says there is a function cashGameDescription.setRebuyAmount

This has been removed. In the first version I tried to simulate a real CashGame, where bots accumulated mones cashed in/out automatically. Then I just realized, that this lead to huge variations (when playing no-limit) because one simple bad move could spoil the overall bot-performance. While this still might be true in real live games :D, it didn't help developing the basic bot-logic or comparing the performance of the bots against each other in a meaningful way.
Thats why I changed the logic to 'Doyles Games', i.e. the stacks currently get reset after each hand.
You can read a bit of variance in simulations in the following thread: http://pokerai.org/pf3/viewtopic.php?f=3&t=3272 (where also the decision to move to Doyles Games is hidden :D.

I'll update the Wiki not to confuse others.

If anyone wants to change this behaviour I think the right way is to write a RebuyStrategy with to implementations ("DoylesRebuy(stack)" and "SimulatedRebuy(rebuyThreshold, rebuyAmount, cashOutTreshhold, cashOutAmount)" which can be configured on the CashGameDescription.

Quote:
I tried to run the MCTS bot but it ran out of heap space. Does it require a ton of space or did I do something wrong?

MCTSBot uses the spears2p2 Hand Evaluator which I think uses about 130MB of heap for its lookup-table (see the handRanks.zip-File which gets loaded into memory). I just set the Heap to 1GB always :D, don't bother

Quote:
The output hand history says limit holdem. Did I make it play limit or is that just how the hand histories are? I just ran it at the default settings after I pulled it.

cashGameDescription.setNolimit(true);

is your friend :D


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 9:39 am 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
pkr_reborn wrote:
i.e. are methods which have to implemented by every bot but don't have a specific logic to them. For example getSettingsPanel(), getPreferences(), init(Preferences) are not tied to the bot logic, but are of administrative character. Wouldn't it be better to have those in the abstractBot then?

Yeah you are right. Since writing these methods is a one-time copy-paste bummer I didn't care yet.
Feel free to provide a patch which would make starting with a new bot easier.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 3:56 pm 
Offline
Level1 member
User avatar

Posts: 47
Favourite Bot: Poki/Polaris
I found another bug and this time I really do not know how to fix it. If you play HU the game does not guarantee that the Big Blind starts to act in every round from the flop on. Setting the gameInfo to reverse Blinds does not help. Furthermore I could not find a method to switch the active Player in the gameInfo. Do you have an Idea how to switch the betting order for Heads Up Play?

Edith, ok I know how to fix it, maybe at the end of the week I can supply you with a version that supports Limit and HU play.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 17, 2010 5:13 pm 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
heads up wasn't my focus yet so there might be all kinds of bugs.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Tue Jun 22, 2010 11:56 am 
Offline
Junior member
User avatar

Posts: 14
Favourite Bot: Deep Thought
bluegaspode wrote:
...there might be all kinds of bugs.


I was messing around with some simple bot simulations, when I found a champion bot...

Setting the getAction function as follows:
Code:
   public Action getAction() {
      return Action.checkAction();
   }

...causes the bot to collect always perform a check action even if they are supposed to pay!
As a result it collects winnings as if it was an always call bot, but without paying more than the blinds/ante.
Needless to say, the win rate is very good!!!

I wonder if it works on Full Tilt ... ;)

It looks like the checkOrFoldAction works better within the testbed


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Tue Jun 22, 2010 6:10 pm 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
A fix would be easy, just have a look at
PublicGameInfo.correctPlayerErrors()

I 'getAmountToCall()>0' and someone checks this should be turned into a call (limited by the currenty players bankroll if its less then the call amount.
Feel free to provide a patch that I'd commit.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Wed Jun 23, 2010 4:15 am 
Offline
PokerAI fellow
User avatar

Posts: 1115
Favourite Bot: Johnny #5
pokerjokus wrote:
Edith, ok I know how to fix it, maybe at the end of the week I can supply you with a version that supports Limit and HU play.


I'd like that.


Top
 Profile  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Wed Jun 23, 2010 4:18 am 
Offline
PokerAI fellow
User avatar

Posts: 1115
Favourite Bot: Johnny #5
I haven't dug into it too deeply but is there an easy way to keep it from resetting the bankroll after each hand?


Top
 Profile  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Wed Jun 23, 2010 12:50 pm 
Offline
Junior member
User avatar

Posts: 14
Favourite Bot: Deep Thought
bluegaspode wrote:
A fix would be easy, just have a look at
PublicGameInfo.correctPlayerErrors()

I 'getAmountToCall()>0' and someone checks this should be turned into a call (limited by the current players bankroll if its less then the call amount.
Feel free to provide a patch that I'd commit.


No problem. Well, actually I am not sure how to use HG to upload, so I'll post the code fix here...

Code:
   /**
    * checks if the given action is appropriate. if not (i.e. amounts too high
    * compared to bankroll) it is adjusted to the most similar valid action.<br>
    *
    * This is needed because otherwise we get invalid states (like negative
    * bankrolls) - we also don't want to stop the simulation because of errors.
    *
    * @param act
    * @param s
    * @return
    */
   private Action correctPlayerErrors(Action act, int s) {
      PublicPlayerInfo player = getPlayer(s);

      switch (act.getType()) {

      case Action.FOLD:
         return Action.foldAction(affordableBet(act.getAmount(), player));

      case Action.CHECK:
      case Action.CALL:
         if (getAmountToCall(s) <= 0.0) {
            return Action.checkAction();
         } else {
            return Action.callAction(affordableBet(getAmountToCall(s), player));
         }

      case Action.BET:
      case Action.RAISE:
         if (getAmountToCall(s) <= 0.0) {
            return Action.betAction(affordableBet(act.getAmount(), player));
         } else {
            // deal with anyone who is all in when trying to call
            if (getAmountToCall(s) > player.getBankRoll()) {
               return Action.callAction(player.getBankRoll());
            }

            // check we can afford to raise everything
            if ((act.getAmount() + act.getToCall()) > player.getBankRoll()) {
               Double raise = affordableBet((act.getAmount() + act
                     .getToCall()), player) - act.getToCall();
               return Action.raiseAction(getAmountToCall(s), raise);
            }
            
            return Action.raiseAction(getAmountToCall(s), act.getAmount());
         }

      case Action.SMALL_BLIND:
         return Action.smallBlindAction(affordableBet(act.getAmount(), player));

      case Action.BIG_BLIND:
         return Action.bigBlindAction(affordableBet(act.getAmount(), player));

      case Action.POST_BLIND:
         return Action.postBlindAction(affordableBet(act.getAmount(), player));

      case Action.ALLIN_PASS:
         return Action.allInPassAction();

      case Action.MUCK:
         return Action.muckAction();

      case Action.POST_ANTE:
         return Action.postAnte(affordableBet(act.getAmount(), player));

      case Action.SIT_OUT:
         return act;

      case Action.POST_DEAD_BLIND:
         return act;

      }
      return act;
   }

   /**
    * Ensures that the player can afford to make the desired bet.
    *
    * @param bet
    * @param player
    * @return affordable bet
    */
   private double affordableBet(Double bet, PublicPlayerInfo player) {
      if (bet <= player.getBankRoll()) {
         return Utils.roundToCents(bet);
      } else {
         return Utils.roundToCents(player.getBankRoll());
      }
   }


The code fix will stop my SneakyChecker bot in his tracks. :D

Feel free to comment on the code/approach as I am still learning Java from books...


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Wed Jun 23, 2010 12:58 pm 
Offline
Junior member
User avatar

Posts: 14
Favourite Bot: Deep Thought
c2008 wrote:
I haven't dug into it too deeply but is there an easy way to keep it from resetting the bankroll after each hand?


Yes - it looks fairly easy.
Look at the checkPlayerRebuy method in CashGameRunner.


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Wed Jun 23, 2010 5:41 pm 
Offline
Junior member
User avatar

Posts: 14
Favourite Bot: Deep Thought
My appologies...

1) I couldn't see how to edit my previous post.
2) My integration server failed a regression test after applying my code changes above.

The code should change to:
Code:
case Action.FOLD:
return Action.foldAction(affordableBet(getAmountToCall(s), player));


This also results in a slight change to the playerTestLog_tiedPotUvenMoney.txt, as the bet size to which player0 folds is 9.71 instead of only 9.69
Code:
#gameStateChanged
#actionEvent 0 action:0 (toCall: 9.71, amount:0.0)
#gameStateChanged


As I say - I appologies, but I was too busy to complete my code check as I was watching England in the World Cup ! :D


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Thu Jun 24, 2010 8:40 am 
Offline
Senior member
User avatar

Posts: 172
Favourite Bot: don't know
Quote:
I was watching England in the World Cup

needed to finish watching Germany :D ... so no poker for both of us on sunday ...

Just commited your changes (found another test which was wrong and needed to be fixed), so this bug will be fixed for everyone.
Thanks for this contribution !


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Fri Jun 25, 2010 4:09 am 
Offline
Senior member
User avatar

Posts: 168
Favourite Bot: none
Quote:
I tried to run the MCTS bot but it ran out of heap space. Does it require a ton of space or did I do something wrong?

MCTSBot uses the spears2p2 Hand Evaluator which I think uses about 130MB of heap for its lookup-table (see the handRanks.zip-File which gets loaded into memory). I just set the Heap to 1GB always :D, don't bother

Thanks for replying. The other issues seem to be ok, but I set my heap space to 1 gig and it still ran out of space. Eclipse won't let me set it any higher so I'm not sure what to do.

Maybe I'm resetting it wrong? My eclipse .ini file is:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xm1g
-Xmx1g

I don't know what most of these do, but I thought the last two set the heap size?


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Fri Jun 25, 2010 5:56 am 
Offline
PokerAI fellow
User avatar

Posts: 1115
Favourite Bot: Johnny #5
Try -Xms1g instead of -Xm1g.


Top
 Profile  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Fri Jun 25, 2010 6:39 am 
Offline
Senior member
User avatar

Posts: 251
Favourite Bot: The Crushinator
On desktop environments using the -Xms argument is usually not useful. The difference between -Xms and -Xmx is that -Xms sets the minimum heapsize, and -Xmx sets the maximum. If you set them to the same thing, the heap size will be fixed when the VM starts and remain always the same, otherwise the heap will expand gradually until it is "big enough," up to the maximum value set by -Xmx.

On servers using -Xms is great because you know very exactly what applications will be running, and how much memory all of them are allocated. But on desktops, you may have your web browser using who knows how much memory, your IDE taking up its own memory space, that Excel spreadsheet you left open and so on. So using -Xms can force the OS to allocate more memory to java than is needed and this will slow down everything.

Of course - if you have a 64 bit OS and 12 GB of RAM then go nuts!


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Tue Jun 29, 2010 1:20 am 
Offline
Senior member
User avatar

Posts: 168
Favourite Bot: none
Thanks for the replies, unfortunately it still doesn't work for me. Has it been working for other people?


Top
 Profile E-mail  
 
 Post subject: Re: Open Meerkat Bot Simulation Testbed
PostPosted: Tue Jun 29, 2010 9:52 am 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
You possibly need to specify -Xmx for the ran application.
I'm not sure -Xmx setting for eclipse will pass thru the tested application.
Try adding -Xmx1g inside the "VM arguments" of your "Run configuration". This should give the application enough memory, as opposed to enough memory given to eclipse.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 91 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next


Who is online

Users browsing this forum: No registered users and 14 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:
Jump to: