public void tryProcessNewVehicles(int time, Simulator sim)
			throws VehicleException, SimulationException {
		int intendedDuration = sim.setDuration();

		if ((smallCarsParked.size() + carsParked.size() + motorCyclesParked
				.size()) >= totalSpaces) {
			throw new SimulationException("The car park is full.");
		}
		if (intendedDuration < Constants.MINIMUM_STAY || time < 0) {
			throw new VehicleException("Invalid timing constraints.");
		}

		System.out.println(totalVehicleCount);
		if (sim.newCarTrial()) {
			if (sim.newCarTrial())
				if (sim.smallCarTrial()) {
					idString = "SC" + numVehicleIDs;
					Vehicle newSmallCar = new Car(idString, time, true);

					numVehicleIDs++;
					totalVehicleCount++;

					if (spacesAvailable(newSmallCar)) {
						parkVehicle(newSmallCar, time, intendedDuration);
						numSmallCars++;
						carParkStatus += "|S:N>P|";
					} else if (!spacesAvailable(newSmallCar) && !queueFull()) {
						enterQueue(newSmallCar);
						carParkStatus += "|S:N>Q|";
					} else {
						archiveNewVehicle(newSmallCar);
						carParkStatus += "|S:N>A|";
					}
				} else {
					idString = "C" + numVehicleIDs;

					Vehicle newCar = new Car(idString, time, false);
					numVehicleIDs++;
					totalVehicleCount++;

					if (spacesAvailable(newCar)) {
						parkVehicle(newCar, time, intendedDuration);
						carParkStatus += "|S:N>P|";

					} else if (!spacesAvailable(newCar) && !queueFull()) {
						enterQueue(newCar);
						carParkStatus += "|S:N>Q|";
					} else {
						archiveNewVehicle(newCar);
						carParkStatus += "|S:N>A|";
					}
				}
		} else if (sim.motorCycleTrial()) {
			idString = "MC" + numVehicleIDs;
			Vehicle newMotorCycle = new MotorCycle(idString, time);

			numVehicleIDs++;
			totalVehicleCount++;

			if (spacesAvailable(newMotorCycle)) {
				numVehicleIDs++;

				parkVehicle(newMotorCycle, time, intendedDuration);
				numMotorCycles++;
			} else if (!queueFull()) {
				enterQueue(newMotorCycle);
				carParkStatus += "|M:N>Q|";
			} else {
				archiveNewVehicle(newMotorCycle);
				carParkStatus += "|M:N>A|";
			}
		}
	}