Advertisement
Guest User

Untitled

a guest
May 26th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2. $teamA = 1550;
  3. $teamB = 1600;
  4. $radiantWon = 1;
  5. ratingCalc($teamA,$teamB,$radiantWon);
  6.  
  7. function ratingCalc($teamA, $teamB, $radiantWon){
  8. $direWon = 1;
  9. if($radiantWon){
  10.     $direWon = 0;
  11.     }
  12. echo "a =".$teamA;
  13. echo "\n b =".$teamB;
  14. $kValue = 37;
  15. $rA = pow(10, $teamA/400);
  16. $rB = pow(10, $teamB/400);
  17. $expectedA = $rA/($rA + $rB);
  18. $expectedB = $rB/($rA + $rB);
  19. $teamA = $teamA + $kValue*($radiantWon - $expectedA);
  20. $teamB = $teamB + $kValue*($direWon - $expectedB);
  21.  
  22. echo"\n rA = ".$rA."\n rb = ".$rB;
  23. echo "\n expectedA = ".$expectedA."\n expectedB = ".$expectedB;
  24. echo"\n newA =".$teamA."\n newB = ".$teamB;
  25. }
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement