public void parkVehicle(Vehicle v, int time, int intendedDuration) throws SimulationException, VehicleException {
		if(!spacesAvailable(v))
			throw new SimulationException("No suitable space avaliabvle for parking");
		if(v.isParked() || v.wasParked())
			throw new VehicleException("vehicle not in the correct state");
		if(time > Constants.CLOSING_TIME || time < 0)
			throw new VehicleException("Timing constraints are violated");
		if(intendedDuration < Constants.MINIMUM_STAY)
			throw new VehicleException("Intended stay less than minimum");
		
			v.enterParkedState(time, intendedDuration);
			spaces.add(v);
			// check vehicle type
			if(v instanceof MotorCycle){
				MotorCycles.add((MotorCycle)v);
			}else{
				if(((Car) v).isSmall()){
					SmallCars.add((Car)v);
				}else{
					Cars.add((Car)v);					
				}
			}
			// update variables
			numMotorCycles = getNumMotorCycles();
			numSmallCars = getNumSmallCars();
			numCars = getNumCars();
//		}
		
	}