src/file_handling/CellDataGenerator.java
public List<String> generateProbabilityData(){
		List<String> result = new ArrayList<String>();
		HashMap<String, Double> probMap = new HashMap<String, Double>();
		double probTotal = 0;
		
		for(String data: cellData){  //Map each Cell to its probability
			String[] splitData = data.split(" ");
			probMap.put(splitData[1], Double.parseDouble(splitData[0]));
			probTotal += Double.parseDouble(splitData[0]);
		}
		
		if(probTotal > 1){  //Ensures that the given probabilities are valid (Do not add up to more than 1)
			throw new XMLException(myResources.getString("InvalidProbabilities"));
		}else{
			String[] cellNames = createNamesArray(probMap);
			placeCellsWithProbability(result, cellNames);			
		}
		
		return result;
	}
/**
	 * Generates a list of Cells and their location given
	 * a Cell type and the probability of that cell occurring.
	 * Assumes probability of cell comes first, then cell type.
	 * 
	 * @return List of cell locations and states
	 */
Generates a list of Cells and their location given
a Cell type and the probability of that cell occurring.
Assumes probability of cell comes first, then cell type.

@return List of cell locations and states
Generates a list of Cells and their location given a Cell type and the probability of that cell occurring . Assumes probability of cell comes first then cell type . @return List of cell locations and states
public List<String> generateProbabilityData(){
		List<String> result = new ArrayList<String>();
		HashMap<String, Double> probMap = new HashMap<String, Double>();
		double probTotal = 0;
		for(String data: cellData){  
			String[] splitData = data.split(" ");
			probMap.put(splitData[1], Double.parseDouble(splitData[0]));
			probTotal += Double.parseDouble(splitData[0]);
		}
		if(probTotal > 1){  
			throw new XMLException(myResources.getString("InvalidProbabilities"));
		}else{
			String[] cellNames = createNamesArray(probMap);
			placeCellsWithProbability(result, cellNames);			
		}
		return result;
	}
public List < String > generateProbabilityData ( ) { List < String > result = new ArrayList < String > ( ) ; HashMap < String , Double > probMap = new HashMap < String , Double > ( ) ; double probTotal = 0 ; for ( String data : cellData ) { String [ ] splitData = data . split ( " " ) ; probMap . put ( splitData [ 1 ] , Double . parseDouble ( splitData [ 0 ] ) ) ; probTotal += Double . parseDouble ( splitData [ 0 ] ) ; } if ( probTotal > 1 ) { throw new XMLException ( myResources . getString ( "InvalidProbabilities" ) ) ; } else { String [ ] cellNames = createNamesArray ( probMap ) ; placeCellsWithProbability ( result , cellNames ) ; } return result ; }
Generates a list of Cells and their location given
 a Cell type and the probability of that cell occurring.
Generates a list of Cells and their location given a Cell type and the probability of that cell occurring .
//Map each Cell to its probability //Ensures that the given probabilities are valid (Do not add up to more than 1)