reworked_factory_wage.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. """Calculate wage"""
  2. from rival_regions_calc import Item, WorkProduction
  3. RESOURCEPRICE = 2500
  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. profit = 1
  14. print("resource price : $ {:9}".format(RESOURCEPRICE))
  15. print("tax rate : {:9} %".format(WP.tax_rate))
  16. print("factory level : {:9}".format(WP.factory_level))
  17. print("department bonus : {:9} %".format(WP.department_bonus))
  18. print()
  19. print("profit : {:9} %".format(profit))
  20. print()
  21. print("LVL EDU % PROFIT WAGE")
  22. for level in range(60, 101, 5):
  23. calc_wage(profit, level, (level - 30) * 14 - 350)
  24. calc_wage(profit, 93, 606)
  25. calc_wage(profit, 88, 491)
  26. calc_wage(profit, 88, 344)
  27. calc_wage(profit, 60, 30)
  28. # print_wages(base_wage, user_bonus, education_bonus)
  29. def calc_wage(profit, user_level, education_level):
  30. """Calculate procentage"""
  31. WP.user_level = user_level
  32. WP.work_exp = 80000 + 200 * education_level
  33. WP.calculate()
  34. calculated_wage = WP.wage() * RESOURCEPRICE
  35. fixed_wage = round(calculated_wage / 100 * (100 - profit))
  36. procent = 100 / calculated_wage * fixed_wage - 100
  37. hour_difference = round(calculated_wage - fixed_wage) * 180
  38. # print("fixed wage : {}".format(fixed_wage))
  39. # print("calculated wage : {}".format(calculated_wage))
  40. # print("procent : {}".format(procent))
  41. print("{:3} {:3}: {:6.2f} {:6,}kk {:8,}k".format(
  42. user_level,
  43. education_level,
  44. procent,
  45. round(hour_difference / 1000000),
  46. round(fixed_wage / 1000),
  47. ).replace(',', '.'))
  48. def print_wages(base_wage, user_bonus, education_bonus):
  49. """Print wages"""
  50. print("Cash wage in kk")
  51. print("Level education")
  52. education_range = range(50, 401, 25)
  53. top_row = " "
  54. for education in education_range:
  55. top_row += ",{:>4}".format(education)
  56. print(top_row)
  57. for level in range(60, 101, 2):
  58. wage_row = "{:>5} ".format(level)
  59. for education in education_range:
  60. wage = base_wage + user_bonus * (level + 1) + education_bonus * (education+ 1)
  61. wage_row += ",{}".format(int(round(wage, -6)/1000000))
  62. print(wage_row)
  63. if __name__ == "__main__":
  64. main()