new_factory_wage.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. """Calculate wage"""
  2. from rival_regions_calc import Item, WorkProduction
  3. RESOURCEPRICE = 2300
  4. RESOURCE = Item("uranium")
  5. WP = WorkProduction(RESOURCE)
  6. WP.factory_level = 165
  7. WP.resource_max = 25
  8. WP.department_bonus = 6.9
  9. WP.wage_percentage = 100
  10. WP.tax_rate = 0
  11. def main():
  12. """Main function"""
  13. # WP.user_level = 30
  14. # WP.work_exp = 80000 + 200 * 30
  15. # WP.calculate()
  16. # base_wage = WP.wage() * RESOURCEPRICE
  17. base_wage = 160000000
  18. base_wage = int(round(base_wage, -len("%i" % base_wage)+2))
  19. user_bonus = 1900000
  20. education_bonus = 800000
  21. # education_bonus = int(user_bonus * 0.4)
  22. print("resource price : $ {:9}".format(RESOURCEPRICE))
  23. print("tax rate : {:9} %".format(WP.tax_rate))
  24. print("factory level : {:9}".format(WP.factory_level))
  25. print("department bonus : {:9} %".format(WP.department_bonus))
  26. print()
  27. print("base wage : $ {:9}".format(base_wage))
  28. print("user bonus : $ {:9}".format(user_bonus))
  29. print("education bonus : $ {:9}".format(education_bonus))
  30. print("LVL EDU % HOUR PROFIT WAGE")
  31. for level in range(60, 101, 5):
  32. calc_procentage(base_wage, user_bonus, education_bonus, level, (level - 30) * 8 - 150)
  33. calc_procentage(base_wage, user_bonus, education_bonus, 93, 606)
  34. print_wages(base_wage, user_bonus, education_bonus)
  35. def calc_procentage(base_wage, user_bonus, education_bonus, user_level, education_level):
  36. """Calculate procentage"""
  37. WP.user_level = user_level
  38. WP.work_exp = 80000 + 200 * education_level
  39. WP.calculate()
  40. calculated_wage = WP.wage() * RESOURCEPRICE
  41. fixed_wage = base_wage + user_level * user_bonus + education_level * education_bonus
  42. procent = 100 / calculated_wage * fixed_wage - 100
  43. hour_difference = round(calculated_wage - fixed_wage) * 180
  44. # print("fixed wage : {}".format(fixed_wage))
  45. # print("calculated wage : {}".format(calculated_wage))
  46. # print("procent : {}".format(procent))
  47. print("{:3} {:3}: {:6.2f} {:16,} {:12,}".format(
  48. user_level, education_level, procent, hour_difference, fixed_wage
  49. ).replace(',', '.'))
  50. def print_wages(base_wage, user_bonus, education_bonus):
  51. """Print wages"""
  52. print("Cash wage in kk")
  53. print("Level education")
  54. education_range = range(50, 401, 25)
  55. top_row = " "
  56. for education in education_range:
  57. top_row += ",{:>4}".format(education)
  58. print(top_row)
  59. for level in range(60, 101, 2):
  60. wage_row = "{:>5} ".format(level)
  61. for education in education_range:
  62. wage = base_wage + user_bonus * (level + 1) + education_bonus * (education+ 1)
  63. wage_row += ",{}".format(int(round(wage, -6)/1000000))
  64. print(wage_row)
  65. if __name__ == "__main__":
  66. main()