// Path: src/individualBasedModel/DemeType.java
// public enum DemeType {
// 	MIGRATION_OF_INFECTEDS, INFECTION_OVER_NETWORK
// }
// 
// Path: src/individualBasedModel/JustBeforeRecoverySampler.java
// public class JustBeforeRecoverySampler implements Sampler {
// 	
// 	protected double justBefore = 1e-16;
// 
// 	public JustBeforeRecoverySampler() {
// 		
// 	}
// 	
// 	public void setJustBefore(double d) {
// 		this.justBefore = d;
// 	}
// 
// 	/** 
// 	 * never does population sampling
// 	 */
// 	@Override
// 	public List<Event> generateSamplingEvents(Population thePopulation,
// 			double actionTime) {
// 		// TODO Auto-generated method stub
// 		return null;
// 	}
// 
// 	@Override
// 	public List<Event> generateSamplingEvents(Event eventPerformed) {
// 		
// 		List<Event> samplingEvents = null;
// 		
// 		if ((eventPerformed.success) && (eventPerformed.type == EventType.RECOVERY)) {
// 				//System.out.println("Attempt to set sampling from "+eventPerformed.toOutput());
// 			
// 				samplingEvents 	= new ArrayList<Event>();
// 				Event e 		= new Event();
// 				
// 				e.setSamplingEvent(eventPerformed.toHost, eventPerformed.creationTime, eventPerformed.actionTime - justBefore);
// 				samplingEvents.add(e);
// 			
// 				//System.out.println("Sampling: "+e.toOutput());
// 		}
// 		
// 		return samplingEvents;
// 	}
// 	
// 	@Override
// 	public List<String[]> getSamplerParameterList() {
// 		List<String[]> params = new ArrayList<String[]>();
// 
// 		String className = this.getClass().getName(); 
// 		params.add(new String[]{"SamplerType", className});
// 		params.add(new String[]{"justBefore",""+justBefore});
// 		
// 		return params;
// 	}
// 	
// 	/*
// 	@Override
// 	
// 	public void setSamplerParameters(List<String[]> params) {
// 		
// 		int i 				= 0;
// 		boolean found 		= false;
// 		String className 	= this.getClass().getName(); 
// 		
// 		while ( (i < params.size()) && (!found) ) {
// 			String[] pairs = params.get(i);
// 			
// 			if (pairs[0].equals("SamplerType")) {
// 				found = (pairs[1].equals(className));
// 			}
// 			
// 			i++;
// 		}
// 		
// 		if (found) {
// 			while (i < params.size()) {
// 				String[] pairs = params.get(i);
// 				
// 				if (pairs[0].equals("justBefore")) {
// 					justBefore = Double.parseDouble(pairs[1]);
// 				}
// 				i++;
// 			}
// 		}
// 	}
// 	*/
// 	
// 	@Override
// 	public void setSamplerParameters(List<Parameter> params) {
// 		int i			    = 0;
// 		boolean found 		= false;
// 		String className 	= this.getClass().getName(); 
// 		
// 		while ( (i < params.size()) && (!found) ) {
// 			Parameter p = params.get(i);
// 			if ( (p.getParentTag().equals("Sampler")) && (p.getId().equals("SamplerType")) ) {
// 				found = (p.getValue().equals(className));
// 			}
// 			i++;
// 		}
// 		
// 		if (found) {
// 			while (i < params.size()) {
// 				Parameter p = params.get(i);
// 				
// 				if (p.getId().equals("justBefore")) {
// 					justBefore = Double.parseDouble(p.getValue());
// 				}
// 				
// 				i++;
// 			}
// 		}
// 	}
// 	
// }
// 
// Path: src/individualBasedModel/ModelType.java
// public enum ModelType {
// 	SI, SIR, SEIR
// }
// 
// Path: src/individualBasedModel/PopulationType.java
// public enum PopulationType {
// 	FULL, RANDOM, LINE, STAR, NETWORK
// }
// 
// Path: src/individualBasedModel/Sampler.java
// public interface Sampler {
// 
// 	/**
// 	 * generate sampling events from the population
// 	 * @param thePopulation
// 	 * @param actionTime
// 	 * @return
// 	 */
// 	List<Event> generateSamplingEvents(Population thePopulation, double actionTime);
// 	
// 	/**
// 	 * generated sampling events based on this event (e.g. infection, recovery)
// 	 * @param e
// 	 * @return
// 	 */
// 	List<Event> generateSamplingEvents(Event e);
// 	
// 	/**
// 	 * return parameter,value pairs for use with Logger etc
// 	 * @return
// 	 */
// 	List<String[]> getSamplerParameterList();
// 	
// 	/**
// 	 * set parameters from parameter,value pairs
// 	 * @param params
// 	 */
// 	//void setSamplerParameters( List<String[]> params);
// 	void setSamplerParameters( List<Parameter> params);
// }


import individualBasedModel.DemeType;
import individualBasedModel.JustBeforeRecoverySampler;
import individualBasedModel.ModelType;
import individualBasedModel.PopulationType;
import individualBasedModel.Sampler;
import java.util.ArrayList;
import java.util.List;
package io;



/**
 * class to write specific network shape configuration xmls, e.g. FULL, RANDOM, LINE, STAR etc
 * @author slycett
 * @version 29 Dec 2014
 * @version 23 Mar 2015
 */
public class WriteNetworkShapeConfigurationXML implements ConfigurationXMLInterface {

	String path				= "test//";
	String rootname			= "example_network";
	
	String simpath			= "test//";
	String simname			= "example_network";
	long   seed  			= -1;
	int	   nreps 			=  1;
	double tauleap 			= 0;
	

	Sampler 		theSampler		= new JustBeforeRecoverySampler();
	
	PopulationType 	popType 		= PopulationType.RANDOM;
	double			probConnect		= 0.1;
	String			demeType		= DemeType.INFECTION_OVER_NETWORK.toString();
	String			dirType			= "FALSE";
	int				numberOfDemes	= 100;
	int				hostsInDeme		= 1;
	double			pinfectother	= 1;
	
// Path: src/individualBasedModel/DemeType.java
// public enum DemeType {
// 	MIGRATION_OF_INFECTEDS, INFECTION_OVER_NETWORK
// }
// 
// Path: src/individualBasedModel/JustBeforeRecoverySampler.java
// public class JustBeforeRecoverySampler implements Sampler {
// 	
// 	protected double justBefore = 1e-16;
// 
// 	public JustBeforeRecoverySampler() {
// 		
// 	}
// 	
// 	public void setJustBefore(double d) {
// 		this.justBefore = d;
// 	}
// 
// 	/** 
// 	 * never does population sampling
// 	 */
// 	@Override
// 	public List<Event> generateSamplingEvents(Population thePopulation,
// 			double actionTime) {
// 		// TODO Auto-generated method stub
// 		return null;
// 	}
// 
// 	@Override
// 	public List<Event> generateSamplingEvents(Event eventPerformed) {
// 		
// 		List<Event> samplingEvents = null;
// 		
// 		if ((eventPerformed.success) && (eventPerformed.type == EventType.RECOVERY)) {
// 				//System.out.println("Attempt to set sampling from "+eventPerformed.toOutput());
// 			
// 				samplingEvents 	= new ArrayList<Event>();
// 				Event e 		= new Event();
// 				
// 				e.setSamplingEvent(eventPerformed.toHost, eventPerformed.creationTime, eventPerformed.actionTime - justBefore);
// 				samplingEvents.add(e);
// 			
// 				//System.out.println("Sampling: "+e.toOutput());
// 		}
// 		
// 		return samplingEvents;
// 	}
// 	
// 	@Override
// 	public List<String[]> getSamplerParameterList() {
// 		List<String[]> params = new ArrayList<String[]>();
// 
// 		String className = this.getClass().getName(); 
// 		params.add(new String[]{"SamplerType", className});
// 		params.add(new String[]{"justBefore",""+justBefore});
// 		
// 		return params;
// 	}
// 	
// 	/*
// 	@Override
// 	
// 	public void setSamplerParameters(List<String[]> params) {
// 		
// 		int i 				= 0;
// 		boolean found 		= false;
// 		String className 	= this.getClass().getName(); 
// 		
// 		while ( (i < params.size()) && (!found) ) {
// 			String[] pairs = params.get(i);
// 			
// 			if (pairs[0].equals("SamplerType")) {
// 				found = (pairs[1].equals(className));
// 			}
// 			
// 			i++;
// 		}
// 		
// 		if (found) {
// 			while (i < params.size()) {
// 				String[] pairs = params.get(i);
// 				
// 				if (pairs[0].equals("justBefore")) {
// 					justBefore = Double.parseDouble(pairs[1]);
// 				}
// 				i++;
// 			}
// 		}
// 	}
// 	*/
// 	
// 	@Override
// 	public void setSamplerParameters(List<Parameter> params) {
// 		int i			    = 0;
// 		boolean found 		= false;
// 		String className 	= this.getClass().getName(); 
// 		
// 		while ( (i < params.size()) && (!found) ) {
// 			Parameter p = params.get(i);
// 			if ( (p.getParentTag().equals("Sampler")) && (p.getId().equals("SamplerType")) ) {
// 				found = (p.getValue().equals(className));
// 			}
// 			i++;
// 		}
// 		
// 		if (found) {
// 			while (i < params.size()) {
// 				Parameter p = params.get(i);
// 				
// 				if (p.getId().equals("justBefore")) {
// 					justBefore = Double.parseDouble(p.getValue());
// 				}
// 				
// 				i++;
// 			}
// 		}
// 	}
// 	
// }
// 
// Path: src/individualBasedModel/ModelType.java
// public enum ModelType {
// 	SI, SIR, SEIR
// }
// 
// Path: src/individualBasedModel/PopulationType.java
// public enum PopulationType {
// 	FULL, RANDOM, LINE, STAR, NETWORK
// }
// 
// Path: src/individualBasedModel/Sampler.java
// public interface Sampler {
// 
// 	/**
// 	 * generate sampling events from the population
// 	 * @param thePopulation
// 	 * @param actionTime
// 	 * @return
// 	 */
// 	List<Event> generateSamplingEvents(Population thePopulation, double actionTime);
// 	
// 	/**
// 	 * generated sampling events based on this event (e.g. infection, recovery)
// 	 * @param e
// 	 * @return
// 	 */
// 	List<Event> generateSamplingEvents(Event e);
// 	
// 	/**
// 	 * return parameter,value pairs for use with Logger etc
// 	 * @return
// 	 */
// 	List<String[]> getSamplerParameterList();
// 	
// 	/**
// 	 * set parameters from parameter,value pairs
// 	 * @param params
// 	 */
// 	//void setSamplerParameters( List<String[]> params);
// 	void setSamplerParameters( List<Parameter> params);
// }


// Path: src/io/WriteNetworkShapeConfigurationXML.java
import individualBasedModel.DemeType;
import individualBasedModel.JustBeforeRecoverySampler;
import individualBasedModel.ModelType;
import individualBasedModel.PopulationType;
import individualBasedModel.Sampler;
import java.util.ArrayList;
import java.util.List;

package io;



/**
 * class to write specific network shape configuration xmls, e.g. FULL, RANDOM, LINE, STAR etc
 * @author slycett
 * @version 29 Dec 2014
 * @version 23 Mar 2015
 */
public class WriteNetworkShapeConfigurationXML implements ConfigurationXMLInterface {

	String path				= "test//";
	String rootname			= "example_network";
	
	String simpath			= "test//";
	String simname			= "example_network";
	long   seed  			= -1;
	int	   nreps 			=  1;
	double tauleap 			= 0;
	

	Sampler 		theSampler		= new JustBeforeRecoverySampler();
	
	PopulationType 	popType 		= PopulationType.RANDOM;
	double			probConnect		= 0.1;
	String			demeType		= DemeType.INFECTION_OVER_NETWORK.toString();
	String			dirType			= "FALSE";
	int				numberOfDemes	= 100;
	int				hostsInDeme		= 1;
	double			pinfectother	= 1;
	
	ModelType		modelType		= ModelType.SIR;