deep_expo.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. """Calculate resources koef"""
  2. def calc_resource_factor(resource_limit, koef_value):
  3. """Calculate koef based on limit"""
  4. return pow(resource_limit * koef_value / 10, 0.8)
  5. def calc_resource(resource_limit, deep_expo, koef_value):
  6. """Calculate deep expo for resource"""
  7. initial_resource_factor = calc_resource_factor(resource_limit, koef_value)
  8. new_resource_factor = calc_resource_factor(resource_limit + deep_expo, koef_value)
  9. percentage = 100 / initial_resource_factor * new_resource_factor - 100
  10. print('{:8.2f} {:8.2f} {:8.2f}'.format(
  11. initial_resource_factor, new_resource_factor, percentage
  12. ))
  13. if __name__ == "__main__":
  14. print("old new percentage")
  15. # gold
  16. calc_resource(418, 219, 0.4)
  17. # oil
  18. calc_resource(223, 148, 0.65)
  19. # ore
  20. calc_resource(247, 109, 0.65)
  21. # uranium
  22. calc_resource(2, 23, 0.75)
  23. # diamonds
  24. calc_resource(2, 25, 0.75)
  25. print("lux")
  26. calc_resource(267, 89, 0.65)
  27. print("oil zuid")
  28. calc_resource(296, 75, 0.65)
  29. print("gold maldiven")
  30. calc_resource(198, 439, 0.4)
  31. print("25 uranium")
  32. calc_resource(25, 26, 0.75)