public static double getHeuristicCost(ArrayList<ArrayList<Object>> taskList, int costPerKm, int capacity, City currentCity) {
		double heuristicCost = 0;
		
		ArrayList<ArrayList<Object>> states = new ArrayList<ArrayList<Object>>();
		
		for(int i=0; i < taskList.size(); i++){
			states.add(new ArrayList<Object>());
			states.get(i).add(taskList.get(i).get(0));
			states.get(i).add(taskList.get(i).get(1));			
		}
		
		int minAt = 0;
		double distance = 0;
		actionStates minStatus = null;
		Task bestTask = null;
		
		while(!AuctionTemplate.checkGoalState(states)) {
			double min = 100000;
			for(int i = 0; i < states.size(); i++) {
				if((actionStates) states.get(i).get(1) == actionStates.DELIVERED) {
					continue;
				}
				
				Task currentTask = (Task) states.get(i).get(0);
				actionStates currentTaskStatus = (actionStates) states.get(i).get(1);
				int currentTaskWeight = currentTask.weight;
				
				if(currentTaskStatus == actionStates.INITSTATE && currentTaskWeight < capacity) {
					distance = (double) currentCity.distanceTo(currentTask.pickupCity);
					if(distance < min) {
						min = distance;
						minAt = i;
						minStatus = actionStates.INITSTATE;
					}
				} else if(currentTaskStatus == actionStates.PICKEDUP) {
					distance = (double) currentCity.distanceTo(currentTask.deliveryCity);
					if(distance < min) {
						min = distance;
						minAt = i;
						minStatus = actionStates.PICKEDUP;
					}
				}
			}
			
			// Adjust the parameters depending on the state transition
			switch(minStatus) {
			case INITSTATE:
				states.get(minAt).set(1, actionStates.PICKEDUP);
				bestTask = (Task) states.get(minAt).get(0);
				currentCity = bestTask.pickupCity;
				capacity -= bestTask.weight;
				break;
			case PICKEDUP:
				states.get(minAt).set(1, actionStates.DELIVERED);
				bestTask = (Task) states.get(minAt).get(0);
				currentCity = bestTask.deliveryCity;
				capacity += bestTask.weight;
				break;
			default:
				break;
			}
			
			heuristicCost += distance * costPerKm;
		}
		
		return heuristicCost;
	}