public void processQueue(int time, Simulator sim) throws VehicleException,
			SimulationException {

		if (this.queueEmpty() == false) {

			for (int i = 0; i < this.queue.size(); i++) {
				if (spacesAvailable(this.queue.get(i)) && !carParkFull()) {

					Vehicle v = this.queue.get(i);
					this.exitQueue(v, time);
					this.parkVehicle(v, time, sim.setDuration());
					status += setVehicleMsg(v, "Q", "P");
				} else {
					break;
				}

			}
		}
		// We're removing the queue elements now, since we can't do it
		// mid-iteration
		queue.removeAll(carParkEntries);

		carParkEntries = new ArrayList<Vehicle>();

	}