Advertisement
Guest User

Ranked

a guest
Jul 13th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.53 KB | None | 0 0
  1. clear all
  2. close all
  3.  
  4. matchlim=5;                                                                 %5 means 2.5 difference limit lower and upper                                                                
  5. playercount=100;
  6. totalmatches=1e4;
  7. matchupspread=10;                                                           %10 difference means 0 or 1 chance
  8. matchweight=.5;                                                             %.5 means reward between 0 and 1
  9.  
  10. [playerarr,playerstrength,playerhist]=createplayers(playercount);
  11.  
  12. matchcount=1;
  13. playerids=1;
  14. while matchcount <= totalmatches  
  15.                                                                            
  16.     [i,j,players]=faceoffs(playercount,playerarr,matchcount,playerids);
  17.    
  18.     if (abs(players(1)-players(2))) <= matchlim/2
  19.        
  20.         [truewinchance, rewardwinchance]=winchancecomputation(matchupspread,playerstrength,i,j,players);                      
  21.            
  22.         rewards=createrewards(rewardwinchance,matchweight);              
  23.                
  24.         playerarr=rewarddist(playerarr,rewards,players,i,j,truewinchance,matchcount);
  25.            
  26.         playerhist=playerhisttracker(playerhist,players,i,j);
  27.            
  28.         matchcount=matchcount+1;
  29.     end
  30.     playerids=playerids+1;
  31. end
  32.  
  33. order=[];
  34. window=[];
  35.  
  36. [stdarr,stdarr2,fitarr,fitarr2,playerhistavg,playerhistavg2]=...
  37. RLRankedanalysiscomp(playercount,playerarr,playerhist,matchcount,order,window);
  38.  
  39. plotfigs(playercount,matchcount,playerarr,stdarr2,fitarr2,playerhistavg2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement