public void addCarriage(RollingStock newCarriage) throws TrainException {

		if (train.isEmpty()) {

			if (newCarriage instanceof Locomotive) {
				train.add(newCarriage);
			} else {
				throw new TrainException(
						"Invalid train configuration: Locomotive must be the first carriage.");
			}

		} else if (passengersOnTrain > NO_PASSENGERS) {
			throw new TrainException(
					"There are passengers on the train. No carriage shunting operations may be performed.");

		} else if (newCarriage instanceof Locomotive) {
			throw new TrainException(
					"Invalid train configuration: There can only be one locomotive per train.");

		} else if (newCarriage instanceof PassengerCar) {
			// If there's no freight cars already attached
			if (!freightCarsExist) {
				train.add(newCarriage);
				trainSeatsAbility += ((PassengerCar) newCarriage)
						.numberOfSeats();
			} else {
				throw new TrainException(
						"Invalid train configuration: Freight cars already exist.");
			}

		} else if (newCarriage instanceof FreightCar) {
			freightCarsExist = true;
			train.add(newCarriage);
		} else {
			throw new TrainException(
					"Invalid train configuration: Unacceptable carriage name.");
		}

	}