package nl.uu.trafficmas.agent;

import nl.uu.trafficmas.roadnetwork.Node;
import nl.uu.trafficmas.roadnetwork.RoadNetwork;
import nl.uu.trafficmas.roadnetwork.Route;

public enum AgentProfileType {
	Normal,
	HotShot,
	OldLady,
	SUMODefault;
	
	public Agent toAgent(String agentID, Node goalNode, Route route, RoadNetwork roadNetwork, int goalArrivalTime, double maxSpeed) {
		Agent agent = null;
		double maxComfySpeed = this.getMaxComfortableDrivingSpeed(maxSpeed);
		switch(this) {
		case Normal:
			agent = new NormalAgent(agentID, goalNode, route, roadNetwork, goalArrivalTime, maxSpeed,maxComfySpeed);
			break;
		case OldLady:
			agent = new OldLadyAgent(agentID, goalNode, route, roadNetwork, goalArrivalTime, maxSpeed,maxComfySpeed);
			break;
		case HotShot:
			agent = new HotShotAgent(agentID, goalNode, route, roadNetwork, goalArrivalTime, maxSpeed,maxComfySpeed);
			break;
		case SUMODefault:
			agent = new SUMODefaultAgent(agentID, null, route, roadNetwork, 0, Double.MAX_VALUE, Double.MAX_VALUE);
		}
		return agent;
	}
	
	public double getMaxComfortableDrivingSpeed(double maxSpeed) {
		double maxComfySpeed = 0;
		switch(this) {
		case Normal:
			maxComfySpeed = maxSpeed * 0.8;
			break;
		case OldLady:
			maxComfySpeed = maxSpeed * 0.6;
			break;
		case HotShot:
			maxComfySpeed = maxSpeed;
			break;
		case SUMODefault:
			maxComfySpeed = maxSpeed * 20;
			break;
		}
		return maxComfySpeed;
	}
	public int goalArrivalTime(int startTime, int minimalTravelTime) {
		int goalArrivalTime = 0;
		switch(this) {
		case Normal:
			// normally we are kinda in a hurry
			goalArrivalTime =  startTime + minimalTravelTime;
			break;
		case OldLady:
			// No hurry, my dear
			goalArrivalTime =  startTime + minimalTravelTime;
			break;
		case HotShot:
			//OUTTATHEWAY
			goalArrivalTime =  startTime + minimalTravelTime;
		case SUMODefault:
			//DONTCARE
			goalArrivalTime =  0;
		}
		return goalArrivalTime;
	}
	
	public static AgentProfileType getAgentProfileType(String agentProfileTypeString) {
		AgentProfileType agent = null;
		switch(agentProfileTypeString) {
		case "Normal":
			agent = Normal;
			break;
		case "OldLady":
			agent = OldLady;
			break;
		case "HotShot":
			agent = HotShot;
			break;
		case "SUMODefault":
			agent = SUMODefault;
			break;
		}
		return agent;
	}

}

@@ -212,23 +212,45 @@
 tShot,%0A%09
-OldLady
+Impatient,%0A%09OldLady,%0A%09Patient
 ,%0A%09SUMOD
@@ -649,16 +649,33 @@
 ldLady:%0A
+%09%09case Patient:%09%0A
 %09%09%09agent
@@ -801,16 +801,34 @@
 otShot:%0A
+%09%09case Impatient:%0A
 %09%09%09agent
@@ -1275,16 +1275,32 @@
 ldLady:%0A
+%09%09case Patient:%0A
 %09%09%09maxCo
@@ -1352,16 +1352,34 @@
 otShot:%0A
+%09%09case Impatient:%0A
 %09%09%09maxCo
@@ -1749,16 +1749,33 @@
 ldLady:%0A
+%09%09case Patient:%09%0A
 %09%09%09// No
@@ -1869,16 +1869,35 @@
 otShot:%0A
+%09%09case Impatient:%09%0A
 %09%09%09//OUT
@@ -2269,16 +2269,34 @@
 dLady%22:%0A
+%09%09case %22Patient%22:%0A
 %09%09%09agent
@@ -2309,32 +2309,32 @@
 Lady;%0A%09%09%09break;%0A
-
 %09%09case %22HotShot%22
@@ -2331,24 +2331,45 @@
  %22HotShot%22:%0A
+%09%09case %22Impatient%22:%09%0A
 %09%09%09agent = H

Add impatient and patient profile types