leaf-analysis/src/simulation/Main.java
/**
	 * This method converts the Output object with the analyzed data into a json object file to be sent to frontend.
	 * @param solver
	 * The solver object that contains all necessary data.
	 * @param filePath
	 * Name of the file to be read by CGI to be sent to frontend
	 */
This method converts the Output object with the analyzed data into a json object file to be sent to frontend.
@param solver
The solver object that contains all necessary data.
@param filePath
Name of the file to be read by CGI to be sent to frontend
This method converts the Output object with the analyzed data into a json object file to be sent to frontend . @param solver The solver object that contains all necessary data . @param filePath Name of the file to be read by CGI to be sent to frontend
private static void createOutputFile(IOSolution outputModel, String filePath) {
		Gson gson = new GsonBuilder().setPrettyPrinting().create();
		try {
			File file;
			file = new File(filePath);
			if (!file.exists()) {
				file.createNewFile();
			}
			PrintWriter printFile = new PrintWriter(file);
			printFile.printf(gson.toJson(outputModel));
			printFile.close();
		} catch (Exception e) {
			throw new RuntimeException("Error in createOutputFile: " + e.getMessage());
		}
	}
private static void createOutputFile ( IOSolution outputModel , String filePath ) { Gson gson = new GsonBuilder ( ) . setPrettyPrinting ( ) . create ( ) ; try { File file ; file = new File ( filePath ) ; if ( ! file . exists ( ) ) { file . createNewFile ( ) ; } PrintWriter printFile = new PrintWriter ( file ) ; printFile . printf ( gson . toJson ( outputModel ) ) ; printFile . close ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Error in createOutputFile: " + e . getMessage ( ) ) ; } }
This method converts the Output object with the analyzed data into a json object file to be sent to frontend.
This method converts the Output object with the analyzed data into a json object file to be sent to frontend .