ProPokerTools

PQL Command Line Documentation

The Odds Oracle includes the capability to execute PQL queries from the command line. To run a PQL query, open a terminal, navigate to the directory containing the Odds Oracle p2.jar file (in the ui_jar directory), and execute the following command:

java -cp p2.jar propokertools.cli.RunPQL

All of the examples on this page were run on Linux.

Running Queries

ppt> java -cp p2.jar propokertools.cli.RunPQL "select avg(riverEquity(hero)) as equity from game='holdem', hero='AA', villain='JT'"
EQUITY = 0.817
600000 trials
ppt> java -cp p2.jar propokertools.cli.RunPQL "select count(tiesLo(hero)) as ties from game='omaha8', board='8s7c6d', hero='A234', villain='10%'"
TIES = 40.8657% (245194)
600000 trials
ppt> java -cp p2.jar propokertools.cli.RunPQL "select histogram(winningHandType()) as winner from game='studhi', syntax='generic', p1='*', p2='*', p3='*', p4='*'"
WINNER = [nothing:0.1160% (696)],[pair:14.4807% (86884)],[twopair:37.2052% (223231)],[trips:12.6607% (75964)],[strt.:14.3677% (86206)],[flush:10.5332% (63199)],[full h.:9.8437% (59062)],[quads:0.6610% (3966)],[str. fl.:0.1320% (792)]
600000 trials
ppt>

Running Multiple Queries

ppt> java -cp p2.jar propokertools.cli.RunPQL "select count(winsHi(hero)) as AK_Wins from game='holdem', villain='10%', hero='AK'; select count(winsHi(hero)) as J2_Wins from game='holdem', villain='10%', hero='J2'"
AK_WINS = 52.4457% (314674)
600000 trials
--------------------------------------------------------------------------------
J2_WINS = 26.2410% (157446)
600000 trials
ppt>

Running Queries from Stdin

ppt> cat > query.pql
select count(handshaving(madeLo, river) >= 1) as lowMadeIt,
       count(handshaving(minhandtype, river, trips) >=1) as decentHighMadeIt
from game='omaha8', syntax='generic', p1='*', p2='*', p3='*', p4='*'
CTRL-D
ppt> java -cp p2.jar propokertools.cli.RunPQL -c < query.pql
LOWMADEIT = 58.5578% (351347)
DECENTHIGHMADEIT = 78.4433% (470660)
600000 trials
ppt>

Options

Executing RunPQL without arguments will give you a list of command-line options:

ppt> java -cp p2.jar propokertools.cli.RunPQL
Usage - RunPQL [-options] PQLQuery(ies)
Separate multiple queries with a semicolon
Options include:
  -mt max-trials (default 600000)
  -ms max-seconds (default 10)
  -tc thread-count (default number-of-cores-on-your-system)
  -c (causes query to be read from stdin)
Examples:
  RunPQL 'select avg(riverEquity(p1)) from game='holdem', p1='AK', p2='JT'
  RunPQL -mt 100000 -ms 100 -tc 1 'select ....'
  RunPQL -c
  RunPQL 'select avg(6) from game='holdem'; select avg(1) from game='omahahi'
ppt>