Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import random
  2.  
  3. HUNT_PER_ACTION = 3
  4. MIRROR_REWARD = 108
  5. FINAL_REWARD = 1638 * 2
  6. HUNT_LOSS = 10
  7. WOUND_ACTIONCOST = 3.0 / 4.5
  8.  
  9. ATTEMPTS = 100000
  10.  
  11. LEVEL = 11
  12. HUNT_GOAL = (LEVEL * (LEVEL+1))/2
  13. CHANCE = .3
  14.  
  15.  
  16. total_ppa = 0.0
  17. total_monies = 0.0
  18. total_hunt_actions = 0
  19.  
  20. for i2 in xrange(ATTEMPTS):
  21. eff_ppa = 0.0
  22. hunt = 0
  23. actions = 0.0
  24. hunt_actions = 0.0
  25. while(True):
  26. hunt += HUNT_PER_ACTION
  27. actions += 1
  28. if hunt >= HUNT_GOAL:
  29. hunt_actions += 1
  30. if random.random() <= CHANCE:
  31. break
  32. hunt -= HUNT_LOSS
  33. hunt_actions += WOUND_ACTIONCOST
  34. monies = (FINAL_REWARD + MIRROR_REWARD * actions)
  35. total_ppa += monies / (actions + hunt_actions)
  36. total_monies += monies
  37. total_hunt_actions += hunt_actions
  38.  
  39. print total_ppa / ATTEMPTS
  40. print total_monies / ATTEMPTS
  41. print total_hunt_actions / ATTEMPTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement