Last active
December 20, 2018 15:25
-
-
Save Joseph94m/7c0cf032a35e53aa0376a38d119d4eed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SIZE = [12,24,48,96,128,192,256,384,512,768,1024,1256,1536,1768,2000] | |
ITERATIONS = 10000 | |
winnings_best=[] | |
winnings_worst=[] | |
draw=[] | |
for k in range(len(SIZE)): | |
best_guy_wins=0 | |
worst_guy_wins=0 | |
for i in range(ITERATIONS): | |
game_results=sample(SIZE[k]) | |
tmp_best_wins=0 | |
tmp_worst_wins=0 | |
total_result=game_results.sum() | |
if(total_result>0): | |
best_guy_wins+=1 | |
if(total_result<0): | |
worst_guy_wins+=1 | |
draws=(ITERATIONS - best_guy_wins - worst_guy_wins )*100/ITERATIONS | |
best_guy_wins=best_guy_wins*100/ITERATIONS | |
worst_guy_wins=worst_guy_wins*100/ITERATIONS | |
draw.append(draws) | |
winnings_best.append(best_guy_wins) | |
winnings_worst.append(worst_guy_wins) | |
print("For a match size of {}, the best agent (A) wins {}%. The worst agent (B) wins {}%. Draws {} %".format(SIZE[k],best_guy_wins,worst_guy_wins,draws)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment