|
@@ -0,0 +1,135 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+
|
|
|
+namespace WSUniversalLib
|
|
|
+{
|
|
|
+ public class Calculation
|
|
|
+ {
|
|
|
+ public int GetPriorityForAgent(int agentType, float age, float experience)
|
|
|
+ {
|
|
|
+ int priorityGeneral;
|
|
|
+ float prior;
|
|
|
+ float agent;
|
|
|
+ if (age <= 25 && experience <= 3)
|
|
|
+ {
|
|
|
+ switch (agentType)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ prior = (float)(experience * 1.9);
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ prior = (float)(experience * 3.37);
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ prior = (float)(experience * 4.36);
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ switch (agentType)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+
|
|
|
+ if (experience > 10 && experience <= 20)
|
|
|
+ {
|
|
|
+ agent = (float)2.3;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience > 20 && experience < 40)
|
|
|
+ {
|
|
|
+ agent = (float)2.5;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience >= 40)
|
|
|
+ {
|
|
|
+ agent = (float)2.7;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (experience > 10 && experience <= 20)
|
|
|
+ {
|
|
|
+ agent = (float)3.7;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience > 20 && experience < 40)
|
|
|
+ {
|
|
|
+ agent = (float)3.9;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience >= 40)
|
|
|
+ {
|
|
|
+ agent = (float)4.1;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (experience > 10 && experience <= 20)
|
|
|
+ {
|
|
|
+ agent = (float)4.6;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience > 20 && experience < 40)
|
|
|
+ {
|
|
|
+ agent = (float)4.8;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ else if (experience >= 40)
|
|
|
+ {
|
|
|
+ agent = (float)5;
|
|
|
+ prior = experience * agent;
|
|
|
+ priorityGeneral = (int)Math.Round(prior);
|
|
|
+ return priorityGeneral;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|