Prisoners-Dilemma-Enjoyers / PrisonersDilemmaTournament

Watch This Place's awesome video about iterated Prisoner's Dilemma for context! https://www.youtube.com/watch?v=BOvAbjfJ0x0
MIT License
23 stars 27 forks source link

Strategy weights #10

Open EFHIII opened 3 years ago

EFHIII commented 3 years ago

(Recommended: complete #9 before starting)

A way to have weight associated with certain strategies e.g. exampleStrats.random 20 for twenty Randoms

Possible implementation:

Nice to haves:

nekiwo commented 3 years ago

Yes, I think this would be really cool as well. I hope someone implements it, but if I have time at the end of the day I might do it myself

EFHIII commented 3 years ago

A not about weight ranges: Each range adds a dimension to the results space; if you consider 0 ranges 0D, than 2 ranges is 2D

So one possible way to visualize 1 one weight range is with an image that assigns a color to each strategy, and going left to right, displays the colors top to bottom in an image. So if one strategy is 1st when there's 0% random but last when there's 99.9% random, you'd see on the left of the image, red is at the top, and going right, red moves towards the bottom of the image.

For 3 ranges, you could have a 2D matrix of these images, which would let you see everything, but it'd be a bit cluttered.

Alternatively, you could only display the color for whoever gets 1st which would make seeing 1 more range dimension easier at the cost of losing the position dimension.

tesslovescode commented 3 years ago

Working on an independent tool to do this

tesslovescode commented 3 years ago

Just so that we're not blocked on #9

tesslovescode commented 3 years ago

Submitted a pull request. Also, the independent tool can be found here: https://github.com/tesslovescode/PrisonersDilemmaTournament/blob/main/simulate_strategy_distribution.py

tesslovescode commented 3 years ago

(Recommended: complete #9 before starting)

A way to have weight associated with certain strategies e.g. exampleStrats.random 20 for twenty Randoms

Possible implementation:

* Config file that gets analyzed by a separate script that looks at `cache.json`

Nice to haves:

* config file is as minimal & human-readable as possible and easy to edit by hand

* config file allows commenting out lines

* A reworking of results.html to work with weighted strategies

* A way to edit the weights inside of results.html

* A way to specify a weight range (as apposed to a specific value)

  * A way to visualize said weight range

The current implementation reads results.txt It's configurable through some constants (minimal, editable) Can edit the weights within said constants No visualization yet, just ranks the strategies for each meta

tesslovescode commented 3 years ago

Here are the test files. This tool works for both the results.txt generated from this repo and the results.txt generated from the Cary's repo test_original_repo.txt test_discord_repo.txt