Open l4vr0v opened 3 years ago
To follow up on the use case mentioned in the first comment, here's an actual head to head sheet and this made it clear to me that uftft
was what's breaking my ultimateDetective
and causing it to perform unexpectedly worse than nprtt
(which makes sense since ultimateDetective
tries to detect and exploit a ftft
and with a uftft
it will instead wind up thinking it's alwaysCooperate
, spamming defections, and scoring low).
This feature has significant utility because it made a previously annoying operation really fast.
This has some similarities with #30 but the CSV output in #30 is a different format (albeit a more compact one) that would require a formula to generate a sheet like this. It may make sense to merge both. Or you could merge in #30, close this one, and I can share a spreadsheet template that converts the output of #30 into a head-to-head table like the one generated by this PR.
As I test new strategies, parsing
results.txt
by hand gets rather frustrating. For example, I am looking at two of my strategies-nprtt
andultimateDetective
- to understand whynprtt
is marginally outperformingultimateDetective
, and this is basically impossible withresults.txt
. WithheadToHead.csv
, I can just import the file into Excel or Google Sheets and see which strategiesnprtt
does better on thanultimateDetective
(and vice versa) so I know what to dive deeper into, inresults.txt
.This Pull Request also does a couple other quality of life improvements:
prisonersDilemma.py
with Black. I'll be honest, this just happened automatically because of my vim autocommand that I was too lazy to disable. It looks cleaner now and I'm kind of hoping you will not make me undo this.decimal.Decimal
to represent the average scores within a game (and consequently, overall).Decimal
uses fixed-point arithmetic and so doesn't have the imprecision offloat
. I did this because it makes theheadToHead.csv
look nicer (floating point imprecision creates some very ugly numbers) without having to give up information by rounding.You can verify yourself that
headToHead.csv
is properly parsed by Excel and Google Sheets.