/** Saves an individual to disk under a given filename, in computer-readable format. */ public void storeIndividual(final EvolutionState state, String filename, Individual ind) { try { File file = openFile(state, filename); // PrintWriter writer = new PrintWriter(file); // ind.printIndividual(state, writer); // writer.close(); int log = state.output.addLog( file, Output.V_NO_GENERAL - 1, false, !state.parameters.getBoolean(new Parameter(P_COMPRESS), null, false), state.parameters.getBoolean(new Parameter(P_COMPRESS), null, false)); ind.printIndividual(state, log, Output.V_NO_GENERAL); state.output.message("Best Individual stored in " + filename); } catch (Exception e) { state.output.error("Exception " + e); } }