Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cargo build --release
- set jobs 8
- set games 0
- set wins 0
- function process
- set enemy_score (cat $argv[1] | jq '.results[0]')
- set our_score (cat $argv[1] | jq '.results[1]')
- if test $enemy_score -eq $our_score
- echo 'Draw, Win rate' (math "$wins / $games * 100")%
- else if test $enemy_score -gt $our_score
- set games (math $games + 1)
- echo 'Defeat, Win rate' (math "$wins / $games * 100")%
- else
- set games (math $games + 1)
- set wins (math $wins + 1)
- echo 'Victory, Win rate' (math "$wins / $games * 100")%
- end
- end
- rm -r /tmp/aicup 2>/dev/null
- mkdir /tmp/aicup
- for job in (seq $jobs)
- sed 's/31001/'(math 31001+$job)'/g' config.json > /tmp/aicup/config$job.json
- end
- for game in (seq 100)
- for job in (seq $jobs)
- ./aicup2019 --batch-mode --config /tmp/aicup/config$job.json --save-results /tmp/aicup/results$job.json 2>/dev/null &
- end
- sleep 0.05
- for job in (seq $jobs)
- target/release/aicup2019 127.0.0.1 (math 31001 + $job) &
- end
- wait
- for job in (seq $jobs)
- process /tmp/aicup/results$job.json
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement