Package de.uka.ipd.sdq.dsexplore.helper
Class ResultsWriter
java.lang.Object
de.uka.ipd.sdq.dsexplore.helper.ResultsWriter
XXX: Maybe make this a proper label provider for the results? Metamodel results?
After calling close(), the ResultWriter should not be used anymore, because it will have closed its internal writer and set the reference to null. Any further logs are written to Log4J.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the internal file writer (as defined in FileWriter.close()).protected voidfinalize()voidflush()static StringformatDouble(Double gene) static StringgetDimensionName(org.opt4j.core.Criterion criterion) returns the file locationstatic voidprintOutIndividuals(Collection<DSEIndividual> individuals, String collectionName) Write individuals to Logger using WARN level.static voidwriteDSEIndividualsToFile(Collection<DSEIndividual> individuals, URI folder, String lastSegment, int iteration, boolean asEMF, boolean asCVS, List<Exception> exceptionList) Write all individuals to new file (file current time in filename).voidstatic voidwriteIndividualsToFile(Collection<org.opt4j.core.Individual> individuals, URI folder, String filename, int iteration, List<Exception> exceptionList, boolean asEMF, boolean asCSV) Write all individuals to new file (file current time in filename).static voidwriteStringToFile(URI folder, String filename, String content, int iteration, List<Exception> exceptionList, String fileEnding) Write any string to the given file.voidwriteTacticCandidateInfo(ITactic heuristic, Collection<TacticsResultCandidate> candidatesFromCurrentHeuristic) voidvoidwriteToLogFile(String entry) Writes String entry to log file in results directory.
-
Constructor Details
-
ResultsWriter
-
-
Method Details
-
writeDSEIndividualsToFile
public static void writeDSEIndividualsToFile(Collection<DSEIndividual> individuals, URI folder, String lastSegment, int iteration, boolean asEMF, boolean asCVS, List<Exception> exceptionList) Write all individuals to new file (file current time in filename).- Parameters:
individuals-lastSegment-iteration-exceptionList-
-
writeIndividualsToFile
public static void writeIndividualsToFile(Collection<org.opt4j.core.Individual> individuals, URI folder, String filename, int iteration, List<Exception> exceptionList, boolean asEMF, boolean asCSV) Write all individuals to new file (file current time in filename).- Parameters:
individuals-folder-iteration-exceptionList-asEMF-
-
writeStringToFile
public static void writeStringToFile(URI folder, String filename, String content, int iteration, List<Exception> exceptionList, String fileEnding) Write any string to the given file.- Parameters:
filename-content-iteration- Is used for the filenameexceptionList-
-
printOutIndividuals
public static void printOutIndividuals(Collection<DSEIndividual> individuals, String collectionName) Write individuals to Logger using WARN level.- Parameters:
individuals-collectionName-
-
formatDouble
-
writeIndividual
-
getFilename
returns the file location- Returns:
- file location as URI
-
writeTacticCandidateInfo
public void writeTacticCandidateInfo(ITactic heuristic, Collection<TacticsResultCandidate> candidatesFromCurrentHeuristic) -
writeTacticManagerChoice
-
writeToLogFile
Writes String entry to log file in results directory.- Parameters:
entry-
-
flush
public void flush() -
close
public void close()Closes the internal file writer (as defined in FileWriter.close()). After closing, the ResultWriter should not be used anymore. Further calls of the ResultWriter will be logged to Log4J with error messages, as if no file writer could be initialised. Multiple calls of close() have no effect. -
finalize
-
getDimensionName
-