Calculation.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace WSUniversalLib
  7. {
  8. public class Calculation
  9. {
  10. public int GetPriorityForAgent(int agentType, float age, float experience)
  11. {
  12. int priorityGeneral;
  13. float priority;
  14. float agentk;
  15. if (age<=25&&experience<=3)
  16. {
  17. switch(agentType)
  18. {
  19. case 1:
  20. {
  21. priority = (float)(experience * 1.9);
  22. priorityGeneral = (int)Math.Round(priority);
  23. return priorityGeneral;
  24. }
  25. case 2:
  26. {
  27. priority = (float)(experience * 3.37);
  28. priorityGeneral = (int)Math.Round(priority);
  29. return priorityGeneral;
  30. }
  31. case 3:
  32. {
  33. priority = (float)(experience * 4.36);
  34. priorityGeneral = (int)Math.Round(priority);
  35. return priorityGeneral;
  36. }
  37. default:
  38. {
  39. return -1;
  40. }
  41. }
  42. }
  43. else
  44. {
  45. switch (agentType)
  46. {
  47. case 1:
  48. {
  49. if (experience > 10 && experience <= 20)
  50. {
  51. agentk = (float)2.3;
  52. priority = experience * agentk;
  53. priorityGeneral = (int)Math.Round(priority);
  54. return priorityGeneral;
  55. }
  56. else if (experience > 20 && experience < 40)
  57. {
  58. agentk = (float)2.5;
  59. priority = experience * agentk;
  60. priorityGeneral = (int)Math.Round(priority);
  61. return priorityGeneral;
  62. }
  63. else if (experience >= 40)
  64. {
  65. agentk = (float)2.7;
  66. priority = experience * agentk;
  67. priorityGeneral = (int)Math.Round(priority);
  68. return priorityGeneral;
  69. }
  70. break;
  71. }
  72. case 2:
  73. {
  74. if (experience > 10 && experience <= 20)
  75. {
  76. agentk = (float)3.7;
  77. priority = experience * agentk;
  78. priorityGeneral = (int)Math.Round(priority);
  79. return priorityGeneral;
  80. }
  81. else if (experience > 20 && experience < 40)
  82. {
  83. agentk = (float)3.9;
  84. priority = experience * agentk;
  85. priorityGeneral = (int)Math.Round(priority);
  86. return priorityGeneral;
  87. }
  88. else if (experience >= 40)
  89. {
  90. agentk = (float)4.1;
  91. priority = experience * agentk;
  92. priorityGeneral = (int)Math.Round(priority);
  93. return priorityGeneral;
  94. }
  95. break;
  96. }
  97. case 3:
  98. {
  99. if (experience > 10 && experience <= 20)
  100. {
  101. agentk = (float)4.6;
  102. priority = experience * agentk;
  103. priorityGeneral = (int)Math.Round(priority);
  104. return priorityGeneral;
  105. }
  106. else if (experience > 20 && experience < 40)
  107. {
  108. agentk = (float)4.8;
  109. priority = experience * agentk;
  110. priorityGeneral = (int)Math.Round(priority);
  111. return priorityGeneral;
  112. }
  113. else if (experience >= 40)
  114. {
  115. agentk = (float)5;
  116. priority = experience * agentk;
  117. priorityGeneral = (int)Math.Round(priority);
  118. return priorityGeneral;
  119. }
  120. break;
  121. }
  122. default:
  123. {
  124. return -1;
  125. }
  126. }
  127. return -1;
  128. }
  129. }
  130. }
  131. }