public void execute() {
		CarWashState s = ((CarWashState) state);
		double timeBefore = s.getLatestUpdateTime();
		
		int slowWashes = s.getAvailableSlowWashes();
		int fastWashes = s.getAvailableFastWashes();
		
		//There might be cars in line, update the queue time.
		s.setQueueTime(s.getQueueTime() + (priority - timeBefore) * (s.getCarQueueSize()));
		//Update the idle time.
		s.setIdleTime(s.getIdleTime() + (priority - timeBefore) * (slowWashes + fastWashes));
		
		s.setLatestUpdateTime(priority);
		s.setCurrentCWSEvent(this);

		//Add a LeaveEvent for a fast wash if there is an empty fast wash.
		if (fastWashes != 0) {
			//Decrease the number of available washes.
			s.setAvailableFastWashes(fastWashes-1);
			//Pass car through empty line
			s.passCarThroughEmptyLine();
			//Add the car's LeaveEvent.
			LeaveEvent e = new LeaveEvent(priority + s.getFastWashTime(), car, Washes.FAST);
			e.setState(s);
			s.addEvent(e);
		} 
		//Add a LeaveEvent for a slow wash if there are no empty fast washes but an empty slow wash.
		else if (slowWashes != 0) {
			s.setAvailableSlowWashes(slowWashes-1);
			s.passCarThroughEmptyLine();
			LeaveEvent e = new LeaveEvent(priority + s.getSlowWashTime(), car, Washes.SLOW);
			e.setState(s);
			s.addEvent(e);
		} 
		//Add the car to the queue if there are no empty washes.
		else {
			s.addCarToLine(car);
		}
		//Add the next ArriveEvent to the EventQueue.
		ArriveEvent e = new ArriveEvent(s.getNewArrivalTime(), s.getCarFactory().createNewCar());
		e.setState(s);
		s.addEvent(e);
	}