Connect to the server and send your name. You will get back OK.
Send your first set of allocations to the server as one line of space/comma separated decimal numbers. Unless your allocations are exactly expressible in a finite number of decimal places, you will have to send approximations (with our game of 200 gambles, 5 or 6 decimal places should be enough). After getting your allocations, the Simulator normalizes them so that they sum to 1. If all goes smoothly, you will get back OK.
After assigning outcomes and calculating your income, you will be sent feedback in the form of one line containing the amount you made last round and space-separated outcomes drawn from {HI,MD,LO} (eg. "02.345 MD HI LO HI MD MD..."). The outcomes are in the order of gambleid and give no explicit indication of what order the gambles were played in or how the probabilities were adjusted based on the hidden attributes & links.
After receiving the outcomes, send your next set of allocations.
If the Simulator can't handle something you send it, it should send back an error message saying ERR: <some reason>.
There is a sample client included with a random strategy (RandomPlayer.java) that may help.
$ java RandomPlayer <host> <port> <name> <nGambles> <nRuns>
there are 2 programs you need to run.
1. DataGen takes 2 parameters and pseudorandomly generates a data file which contains the values used by the server. The data contained in this file can (and is strongly advised to) be used by the players.
usage: java DataGen <number of gambles> <output file name>
2. Simulator runs the entire game simulation.
usage: java Simulator <data file> <port> <viz> [nRuns]
where viz is either true or false depending on if you want the GUI to pop up and [nRuns] is an optional parameter specifying the number of games that should be played by a non-GUI simulation. nRuns is ignored if viz is true.
you can run a sample game with 2 random clients (or more by starting more than 2) and the GUI by executing the following commands:
java -cp . DataGen 200 data.txt &
java -cp . Simulator data.txt 10000 true &
java -cp . RandomPlayer localhost 10000 rnd1 200 5 &
java -cp . RandomPlayer localhost 10000 rnd2 200 5 &
and then by pressing play each time you want to simulate a single round.