123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- 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;
- }
- }
- }
- }
|