public void execute() {
		CarWashState s = (CarWashState) state;
		double timeBefore = s.getLatestUpdateTime();//Store time before updating to current time
		
		int fastWashes = s.getAvailableFastWashes();
		int slowWashes = s.getAvailableSlowWashes();
		
		//Update idle time.
		s.setIdleTime(s.getIdleTime() + (priority - timeBefore) * (slowWashes + fastWashes));
		
		//Update queue time, there might be cars in queue
		s.setQueueTime(s.getQueueTime() + (priority - timeBefore) * (s.getCarQueueSize()));
		
		s.setLatestUpdateTime(priority);
		s.setCurrentCWSEvent(this);
		
		//Puts the first car in line in the wash a car just left.
		if (s.getCarQueueSize() > 0) {
			if (wash == Washes.FAST) {
				//Add the car's LeaveEvent.
				LeaveEvent e = new LeaveEvent(priority + s.getFastWashTime(), s.getFirstCarInLine(), Washes.FAST);
				e.setState(s);
				s.addEvent(e);
			} else {
				LeaveEvent e = new LeaveEvent(priority + s.getSlowWashTime(), s.getFirstCarInLine(), Washes.SLOW);
				e.setState(s);
				s.addEvent(e);
			}
		} 
		//If there are no cars in line, increase the number of available washes.
		else {
			if (wash == Washes.FAST) {
				s.setAvailableFastWashes(fastWashes+1);
			} else {
				s.setAvailableSlowWashes(slowWashes+1);
			}
		}
	}