Poker-AI.org

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

All times are UTC




Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Oct 28, 2014 3:48 pm 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Please tell me if it all work for you with the version I just posted.

Important points :

- You will have to write TT-AA, not anymore AA-TT
- I don't care about K2+, you have to say K2s+ and K2o+
- I don't care about the special rule concerning suited connectors, so QJs+ will be QJ and 98o+ will be equal to 98

If you agree with all of that, there shouln't be bug anymore, I get the good number of combinations each time now.


Top
 Profile  
 
PostPosted: Tue Oct 28, 2014 5:59 pm 
Offline
Junior Member

Joined: Wed May 15, 2013 10:15 pm
Posts: 42
I tested using the test code:
Code:
double expected[23];
   int numberOfTrials = 1000000;

   {
      // 7-way matchup involving 2 specific hands, 2 ranged hands, and 3 random hands, on the flop
      double expected[] = { 37.1, 5.5, 19.2, 5.9, 10.75, 10.75, 10.75  };
      performMatchup("AhKh|Td9s|QQ+,AQs+,AQo+|JJ-88|XxXx|XxXx|XxXx", "Ks7d4d", "", 1000000, false, expected);
   }

   {
      // AA vs. KK of any suits: Monte Carlo + Exhaustive
      double expected[] = { 81.9, 18.1 };
      performMatchup("AA|KK", NULL, NULL, numberOfTrials, true, expected);
   }


   {
      // AA vs. KK of any suits with flop [Th Jc Qs]: Monte Carlo + Exhaustive
      double expected[] = { 75.9, 24.1 };
      performMatchup("AA|KK", "ThJcQs", NULL, numberOfTrials, true, expected);
   }


   {
      // 10-way preflop all-in with AA through 55: Monte Carlo
      double expected[] = { 24.3, 18.8, 14.1, 10.6, 8.1, 6.0, 4.7, 4.2, 4.5, 4.8};
      performMatchup("AA|KK|QQ|JJ|TT|99|88|77|66|55", NULL, NULL, numberOfTrials, false, expected);
   }


   {
      // 10-way preflop all-in with AA through 55 with flop of [2c3s4d]: Monte Carlo
      double expected[] = { 13.5, 10.6, 9.6, 8.6, 7.6, 6.7, 5.7, 5.7, 12.6, 19.5};
      performMatchup("AA|KK|QQ|JJ|TT|99|88|77|66|55", "2c3s4d", NULL, numberOfTrials, false, expected);
   }

   {
      // Aces vs. Kings with shared suits
      double expected[] = { 82.6, 17.4 };
      performMatchup("AsAc|KsKc", NULL, NULL, numberOfTrials, true, expected);
   }

   {
      // Specific hands and hand ranges in the same trial
      double expected[] = { 30.8, 15.5, 38.1, 15.6 };
      performMatchup("AhKh|2d2c|77|A2s+", NULL, NULL, numberOfTrials, false, expected);
   }

   {
      // Aces versus 5 random/uknown hands
      double expected[] = { 82.6, 17.4 };
      performMatchup("AcAs,KcKs|QcQs", NULL, NULL, numberOfTrials, true, expected);
   }


   {
      // Aces versus 5 random/uknown hands
      double expected[] = { 49.2, 10.15, 10.15, 10.15, 10.15, 10.15 };
      performMatchup("AA|XxXx|XxXx|XxXx|XxXx|XxXx", NULL, NULL, numberOfTrials, false, expected);
   }


   {
      // Typical 3-way matchup - pocket pair vs. loose-ish vs. tight-ish
      double expected[] = { 37.1, 19.5, 43.4 };
      performMatchup("TsTc|A2+,22+|QQ+,AQ+", NULL, NULL, numberOfTrials, false, expected);
   }

I corrected the first test but in the second it still fails. Did you check the project "Poker.Equity.Test" ? You should run it in debug mode.


Top
 Profile  
 
PostPosted: Tue Oct 28, 2014 7:06 pm 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Hello, and thank you, I forgot the case of a single pair like KK in opponent range :)
I made the correction and it seems to be all working now, could you please pass again your tests
as I removed the Poker.Equity.Test Project ? Ty

Autofocus


Top
 Profile  
 
PostPosted: Tue Oct 28, 2014 7:10 pm 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
I read again the tests and in fact, it doesn't test ranges like K2o+ and the old code was only working with Ax+ not K2s+ or Q6s+
or ranges like ATo - AQo so the tests will pass without seeing this huge bug.


Top
 Profile  
 
PostPosted: Wed Oct 29, 2014 8:26 am 
Offline
Junior Member

Joined: Wed May 15, 2013 10:15 pm
Posts: 42
Nice find :)
Will update mine too.


Top
 Profile  
 
PostPosted: Wed Oct 29, 2014 8:35 am 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Ty ;)
A good thing would be to add unit tests with :
A9o-AQo,62s+,62o+
because that's why those tests were missing that the bug wasn't found.
Anyway, happy to have a working ranges calculator now !

Autofocus


Top
 Profile  
 
PostPosted: Wed Oct 29, 2014 3:09 pm 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Do someone know how to create a C++ COM DLL to access it directly from C# without Pinvoke ?
It's important in my case to result into only one assembly to hide this DLL.

My wrapper.cpp file actually contains :

Quote:
#include "wrapper.h"

extern "C" __declspec(dllexport) void __stdcall Calculate(const char* hands, const char* board, const char* dead, __int64* trialCount, double* results, double* player_results, double* opponent_results, double* Tie)
{
memset(results, 0, 23);
memset(player_results, 0, 9);
memset(opponent_results, 0, 9);
*Tie = 0;
HoldemCalculator calc;
calc.Calculate(hands, board, dead, trialCount, results, player_results, opponent_results, Tie);
calc.deletemdists();
}


Thanks if somebody can help.


Top
 Profile  
 
PostPosted: Sat Feb 14, 2015 11:03 pm 
Offline
Junior Member

Joined: Sat Jun 29, 2013 1:43 am
Posts: 11
When I try need to call a c++ dll in C# I have always used DLLImport attribute in C#.

in c# for example

[DllImport("yourlibrary.dll")]
public static extern void DoSomething(string s);

public static void main() {
DoSomething("dothis");
}


Top
 Profile  
 
PostPosted: Sun Feb 15, 2015 7:54 am 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Ty but this is the call I want to avoid, DllImport = Pinvoke


Top
 Profile  
 
PostPosted: Thu May 28, 2015 3:53 pm 
Offline
Veteran Member

Joined: Thu Feb 28, 2013 2:39 am
Posts: 437
Maybe not the best but certainly useful:
http://www.codeproject.com/Articles/190 ... -in-C-Part


Top
 Profile  
 
PostPosted: Thu May 28, 2015 4:00 pm 
Offline
Junior Member

Joined: Fri Sep 26, 2014 11:51 pm
Posts: 15
Hi, I help you with all the PartyPoker part, do you have a working AI for now ?


Top
 Profile  
 
PostPosted: Sun Jun 14, 2015 6:14 pm 
Offline
Junior Member

Joined: Wed Jun 25, 2014 9:28 am
Posts: 31
.


Top
 Profile  
 
PostPosted: Wed Apr 12, 2017 12:10 pm 
Offline
New Member

Joined: Tue Apr 11, 2017 3:37 pm
Posts: 1
Hey guys,

is something new available in the past years?

Sorry for pushing, hope it's fine. I just didn't want to create a new topic regarding the same question. :)

Greets


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3

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