Елизавета Голубева 2 gadi atpakaļ
vecāks
revīzija
9e0835e010
1 mainītis faili ar 57 papildinājumiem un 0 dzēšanām
  1. 57 0
      WSUniversalLib/Calculation.cs

+ 57 - 0
WSUniversalLib/Calculation.cs

@@ -8,5 +8,62 @@ namespace WSUniversalLib
 {
     public class Calculation
     {
+        /// <summary>
+        /// Метод расчета нового приоритета
+        /// </summary>
+        /// <param name="agentType"></param>
+        /// <param name="age"></param>
+        /// <param name="experience"></param>
+        /// <returns></returns>
+        public int GetPriorityForAgent(int agentType, float age, float experience)
+        {
+            double proc;
+            if(agentType == 1 && age < 26 && experience < 4)
+            {
+                proc = 1.8 + 0.1;
+            }
+            else if(agentType == 2 && age < 26 && experience < 4)
+            {
+                proc = 3.2 + 0.17;
+            }
+            else if (agentType == 3 && age < 26 && experience < 4)
+            {
+                proc = 4.1 + 0.26;
+            }
+            else if (agentType == 1 && age > 26 && experience > 4)
+            {
+                proc = 1.8;
+            }
+            else if (agentType == 2 && age > 26 && experience > 4)
+            {
+                proc = 3.2;
+            }
+            else if (agentType == 3 && age > 26 && experience > 4)
+            {
+                proc = 4.1;
+            }
+            else
+            {
+                return -1;
+            }
+            
+
+            if (experience > 11)
+            {
+                proc += 0.5;
+            }
+            else if (experience > 21)
+            {
+                proc += 0.7;
+            }
+            else if (experience > 41)
+            {
+                proc += 0.9;
+            }
+
+            int rezult = Convert.ToInt32(Math.Ceiling(experience * proc));
+            return rezult;
+        }
+
     }
 }