README.md 2.91 KB
Newer Older
1
# An implementation of Hanabi in Java
2
This is designed to allow the development of bots which play the board game [hanabi][hanabi].
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
3 4

## Authors
5
* Joseph Walton-Rivers
6 7 8
* Piers Williams

## Directories
9 10 11 12
* src/ - Source Code
* research/ - Materials for research purposes
* target/ - Maven compiled artifacts

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
## Assumptions
* stdout is for data (we write the code as filters)
* stderr is for debug logging (this might change if we use it for competitions)
* enviroment variables are awesome (webpigeon spent too much time around docker) and therefor we'll use them for configuration

## Adding new agents
New agents must be added to either buildAgent method in order to run. Most of these are calls to factory methods elseware in the codebase. This is because most of the rule based AIs are the same agent with different rules set. Therefore, your agent is expected to be present as a case statement in build agent.

Again, for a competition runner, this might change (to use reflection) - at the moment it's coded this way for ease of development.

Sample agents live under ```com.fossgalaxy.games.fireworks.ai```. 

## Running the code

### Running locally
1. checkout this repo
2. use ```run_experiment.sh``` or ```run_mixed.sh``` to collect data - these scripts will also generate a log for you
3. you can also run App2CsvMulti or MixedAgentGame from the jarfile instead (they will write their csv data to standard out).
4. analyise data

### Running me on YARCC
The game engine has been designed to make it possible to run on YARCC. In src/main/scripts you will find the jobfile and scripts needed to make this work. The basic process can be summed up as:

1. checkout this repo
2. use src/main/scripts/compileCluter.sh to generate matchups
3. use qsub to submit a job (edit runParamterJob in src/main/scripts before running!)
4. use filter.sh to generate results.csv from the job outputs
5. copy results.csv to somewhere else and analyise it (my analysis scripts will be made public soon)

Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
42 43 44 45 46
### Running me on YARCC (new)
1. checkout this repo
2. run ./src/main/scripts/buildAndExecuteMixed.sh to do all the above
3. cat all of your ```*.o*``` files together to form your csv file
4. copy results.csv to somewhere to analyise it.
47

48 49 50 51 52 53 54 55 56 57 58
## framework parameters

### Enviroment Variables
The runner recognises the following enviroment variables:

* ```FIREWORKS_AGENTS``` - a comma seperated list of agents to evaluate (see SetupUtils for default)
* ```FIREWORKS_AGENTS_PAIRED``` - a comma seperated list of agents to evaluate against (see SetupUtils for default)
* ```FIREWORKS_NUM_SEEDS``` - the number of seeds to generate when generating argument files (default is 10)
* ```FIREWORKS_REPEAT_COUNT``` - the number of times to repeat a given seed (useful for non deterministic agents) (default is 2)
* ```FIREWORKS_META_SEED``` - the seed used for the RNG which generates seeds for games (default is to use java default)

Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
59
[hanabi]: https://boardgamegeek.com/boardgame/98778/hanabi