Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 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. total_actions = 0
  20.  
  21. for i2 in xrange(ATTEMPTS):
  22. eff_ppa = 0.0
  23. hunt = 0
  24. actions = 0.0
  25. hunt_actions = 0.0
  26. wound_actions = 0.0
  27. while(True):
  28. hunt += HUNT_PER_ACTION
  29. actions += 1
  30. if hunt >= HUNT_GOAL:
  31. hunt_actions += 1
  32. if random.random() <= CHANCE:
  33. break
  34. hunt -= HUNT_LOSS
  35. wound_actions += WOUND_ACTIONCOST
  36. monies = (FINAL_REWARD + MIRROR_REWARD * actions)
  37. total_monies += monies
  38. total_hunt_actions += hunt_actions
  39. total_actions += hunt_actions + actions + wound_actions
  40.  
  41. print total_monies / total_actions
  42. print total_monies / ATTEMPTS
  43. print total_hunt_actions / ATTEMPTS
  44. print total_actions / ATTEMPTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement