package datamodel;

import datamodel.effluent.EffluentModelValue;
import datamodel.flamespeed.FlameSpeedModelValue;
import datamodel.ignitiondelay.IgnitionDelayModelValue;
import readers.ReactorInput;

public class ModelValueFactory {
	
	String model;
	
	public ModelValueFactory(String model2){
		this.model = model2;
	}
	
	/**
	 * A model value is created based on the type of reactor setup that is specified. 
	 * 
	 * For example, in a PFR reactor product effluent data can be collected, but flame speeds, or 
	 * ignition delays cannot be measured in this type of reactor.
	 * 
	 * 
	 * @return
	 */
	public ModelValue createModelValue(){
		if(model.equals(ReactorInput.PFR)){
			return new EffluentModelValue();
		}
		else if(model.equals(ReactorInput.CSTR)){
			return new EffluentModelValue();
		}
		else if(model.equals(ReactorInput.IGNITION_DELAY)){
			return new IgnitionDelayModelValue();
		}
		else if(model.equals(ReactorInput.FLAME_SPEED)){
			return new FlameSpeedModelValue();
		}
		
		return null;
	}
}

@@ -15,16 +15,99 @@
 del;%0D%0A%0D%0A
+import org.apache.log4j.Logger;%0D%0A%0D%0Aimport applications.ParameterEstimationDriver;%0D%0A
 import d
@@ -320,16 +320,88 @@
 ory %7B%0D%0A%09
+public static Logger logger = Logger.getLogger(ModelValueFactory.class);
 %0D%0A%09Strin
@@ -1185,16 +1185,82 @@
 %0A%09%09%7D%0D%0A%09%09
+else logger.error(%22Did not recognize reactor input type: %22+model);
 %0D%0A%09%09retu

add logger error if reactor type is not recognized