Task (Elaboration / Additional Code): Implement getCompatibleMediator: instantiate the correct mediator (Transmitter, etc.) for the given pair of models.
Solution: add additional code 
<%
	private AtomicModelImpl getCompatibleMediator(AtomicModelImpl a1, AtomicModelImpl a2) {
		AtomicModelImpl toReturn = null;
		if(a1 == null || a2 == null)
			return null;
		if(getTypeCons(a1).equals("Sensor")&&getTypeCons(a2).equals("Sensor")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("Transmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("TransmitterRec"+contRecTransmitter);
						contRecTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("Sensor")&&getTypeCons(a2).equals("Gateway")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("Transmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("TransmitterRec"+contRecTransmitter);
						contRecTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("Gateway")&&getTypeCons(a2).equals("Sensor")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("Transmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("TransmitterRec"+contRecTransmitter);
						contRecTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("Drone")&&getTypeCons(a2).equals("DroneBasis")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("DroneTransmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("DroneTransmitterRec"+contRecDroneTransmitter);
						contRecDroneTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("DroneBasis")&&getTypeCons(a2).equals("Drone")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("DroneTransmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("DroneTransmitterRec"+contRecDroneTransmitter);
						contRecDroneTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("Crowd")&&getTypeCons(a2).equals("CrowdGateway")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("CrowdTransmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("CrowdTransmitterRec"+contRecCrowdTransmitter);
						contRecCrowdTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		else if(getTypeCons(a1).equals("CrowdGateway")&&getTypeCons(a2).equals("Crowd")) {
			for(AtomicModelImpl e : originalConstituents) {
				if(getTypeCons(e).equals("CrowdTransmitter")) {
					try{
						toReturn = e.getClass().newInstance();
						toReturn.setName("CrowdTransmitterRec"+contRecCrowdTransmitter);
						contRecCrowdTransmitter++;
						getParent().addChildModel(toReturn);
						constituents.add(toReturn);
						return toReturn;
					}catch(Exception TheOnlyException) {}
				}
			}
		}
		return toReturn;
	}
%>!