Comments (17)
Don't worry, EFHII, I am aware of that! I realize the round lengths are random/undeterministic, and the outcome can be very different if the game goes on for 200 rounds versus 1,000 rounds. I knew that, and my internal thought process was randomly choose the ~100 iteration-game-lengths, and then run one head-to-head match for the longest n of those 100, and then you could just truncate that history to get the results for all the shorter iterations of that. So don't worry, whatever I end up doing will still be functionally identical to the correct implementation!
(I just didn't word that all out because I didn't want my comment to get too wordy)
from prisonersdilemmatournament.
I've been operating under the assumption that multiple randoms are allowed, since cary said something like "you have a non-zero chance of winning if you submit random". The way duplicates are judged could easily change the winner. Should probably have asked this myself like 5 days ago.
from prisonersdilemmatournament.
I'm pretty sure cary ended up deciding to allow duplicates.
Q: What if people submit exactly the same strategy?
A: They'll all still be entered into the roster separately.
from prisonersdilemmatournament.
That's new
from prisonersdilemmatournament.
(EDIT: I only saw the first two posts when I typed this.)I really don't like the idea of removing duplicates, although I do get that it could be the only possible choice. What if you've submitted a strategy that does horribly against itself, but you don't care because duplicates are guaranteed gone? Or what if you've submitted the best strategy ever, but you didn't get anything because it got removed for being a duplicate?(Unlikely, but still possible!) I don't think Cary would shell out thousands of dollars to everyone who've submitted duplicates of the top 3 strategies.(Again, it is unlikely, but possible.)
from prisonersdilemmatournament.
Plot twist: one of the random strategy wins so everyone who submitted random wins $1000 and Cary goes bankrupt.
from prisonersdilemmatournament.
That would be so bad....
from prisonersdilemmatournament.
Yeah, after talking about this with friends and my teacher, I think it makes the most sense to not remove any duplicates. Basically, we'll consider each .py strategy submitted to be its own independent player.
If there's some strategy that is strategically the best, and multiple people submitted it, then one of them would have to end up on top due to the random chance of playing with random opponents. So, no matter what happens, I'll still only award the 1st-place prize money to 1 person. That would still kinda suck though because it would turn this tournament into a pseudo-lottery, but it's better than having to pay arbitrarily many people!
I haven't run the tournament code yet, but based on how diverse the submissions are so far, I doubt "random" (or any other strategy simple enough that multiple people would pick the same thing) will win. But I can't guarantee it yet until I run the code!
from prisonersdilemmatournament.
Indeed. But are you sure you can run a thousand submissions within a week?
from prisonersdilemmatournament.
Haha, I am actually not sure! The runtime is going to be O(n^2), so with 1,600 submissions, it will actually take... 10,000 times longer than the dummy 16-strat test I have run. And that's not even including the idea of running it 100+ times and averaging the results to smooth out randomness...
I might need to buy computing time from other people, lol
from prisonersdilemmatournament.
I wish you luck. And processing power.
from prisonersdilemmatournament.
Haha, I am actually not sure! The runtime is going to be O(n^2), so with 1,600 submissions, it will actually take... 10,000 times longer than the dummy 16-strat test I have run. And that's not even including the idea of running it 100+ times and averaging the results to smooth out randomness...
I might need to buy computing time from other people, lol
You might want to use the multi-threaded version from the enjoyer's repo
from prisonersdilemmatournament.
Haha, I am actually not sure! The runtime is going to be O(n^2), so with 1,600 submissions, it will actually take... 10,000 times longer than the dummy 16-strat test I have run. And that's not even including the idea of running it 100+ times and averaging the results to smooth out randomness...
I might need to buy computing time from other people, lol
Have you looked at #37 and the caching mentioned in #17 for possibly speeding up the software side of it as well? If you can make sure that you mark which strategies are random while going through them, you could potentially speed that up a lot. (As well as multiprocessing which you already mentioned looking into.)
from prisonersdilemmatournament.
Ooh, both of those techniques look really promising! Especially the one about caching non-random strategies. That is interesting that if two strategies are deterministic, you only need to run their tournament once, since it'll be the same every time.
Thanks for the suggestions, everyone!
from prisonersdilemmatournament.
That's not entirely true; even if they're deterministic, the length of the match isn't so there can still be noticeable variation, especially if the match is chaotic. For example, if during a match, it by sheer chance (unlikely, but possible) ends up being 500 steps long, and the two strategies both cooperate for the most from turn 1-200, but get stuck always defecting after that, the result will be very different than had the match only lasted 200 steps.
One thing that I personally do on my branch that I think helps a bit is that if both sides Cooperate the entire time, Then you know that'll (probably) be the case every time. That's the most important case since a lot of strategies are "nice" so a good chunk of the games end that way.
I also multi-thread the runs so that I'm using all of my CPU cores. That alone makes a huge difference.
One optimization I haven't looked into but might be worth considering are: If the two are deterministic, you may not be able to know what the score would average on one run, but you could just sample what the score would be at each of 200-400 runs and take a weighted average based on how likely the game was to end at that many rounds. That makes it go from running the game potentially hundreds of times to once + some math for what's probably a statistically more accurate number.
Also, if you have a lot of duplicates, you could have just one copy and then apply weights as if there were several of them. The main concern there would be if one of them won, you no longer have a way to say which one of the submitters won, but if it reduces the pool significantly, it'd probably be worth it. (I've implemented that in my fork as well as a way to test different densities of certain strategies)
from prisonersdilemmatournament.
Update:
I've implemented only running deterministic stuff once. It's about 4 times faster than before on the Prisoners-Dilemma-Enjoyers fork running each strategy 100 times.
from prisonersdilemmatournament.
The core of my implementation is pre-computing the chance of each number of turns
turnChances = []
def turnChance(x,summing=False):
if x == 0:
return 1/40
if summing:
S = turnChance(x-1,True)
return (1-S)/40+S
return (1-turnChance(x-1,True))/40
for i in range(DETERMINISTIC_TURNS-199):
turnChances.append(turnChance(i))
normalizing them to sum to 1
# this is so that deterministic algorithms still get 3 points for always Coop, instead of 2.999
chancesSum = sum(turnChances)
turnChances = [i/chancesSum for i in turnChances]
and iterating through each, multiplying by the normalized chances
# . . .
totals = [0,0]
scores = [0,0]
for turn in range(199):
scores[0] += pointsArray[history[0,turn]][history[1,turn]]
scores[1] += pointsArray[history[1,turn]][history[0,turn]]
for turn in range(199,DETERMINISTIC_TURNS):
scores[0] += pointsArray[history[0,turn]][history[1,turn]]
scores[1] += pointsArray[history[1,turn]][history[0,turn]]
totals[0] += scores[0]/(turn+1)*turnChances[turn-199]
totals[1] += scores[1]/(turn+1)*turnChances[turn-199]
return totals, history
from prisonersdilemmatournament.
Related Issues (20)
- Analysis and performance
- Submission without a Google account? HOT 1
- After the deadline in a few hours, please feel free to USE THIS THREAD TO SHARE YOUR STRATEGIES, since the fear of them being stolen will be gone HOT 42
- I left a print() HOT 5
- Name associated with Google account being appended to filename when uploading to the google form HOT 2
- I made a POV version of the game HOT 1
- Has anyone successfully done a resubmission? HOT 20
- Submission period is over for everyone now! HOT 2
- The "research", as seen from evidence left in the submission form and web page HOT 3
- Potential Exploit I haven't seen discussed yet.
- For everyone who's not subscribed to carykh on YouTube HOT 14
- Predictions :D HOT 10
- Update from Cary! (I implemented subprocesses) HOT 7
- I got stupid... HOT 4
- Update from Cary (2021-06-15) (Long and not urgent, so you don't have to read it) HOT 21
- A cheater got to first place (and got caught). HOT 11
- Detecting Kingmaker and Minion strats HOT 5
- Releasing results.txt in order to simulate different metas HOT 4
- Update from Cary on 2021-06-29 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisonersdilemmatournament.