Package de.uka.ipd.sdq.dsexplore.helper
Class ResultsWriter
- java.lang.Object
-
- de.uka.ipd.sdq.dsexplore.helper.ResultsWriter
-
public class ResultsWriter extends Object
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 Constructor Description ResultsWriter(URI folder, String filename)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the internal file writer (as defined in FileWriter.close()).protected void
finalize()
void
flush()
static String
formatDouble(Double gene)
static String
getDimensionName(org.opt4j.core.Criterion criterion)
URI
getFilename()
returns the file locationstatic void
printOutIndividuals(Collection<DSEIndividual> individuals, String collectionName)
Write individuals to Logger using WARN level.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).void
writeIndividual(DSEIndividual i)
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).static void
writeStringToFile(URI folder, String filename, String content, int iteration, List<Exception> exceptionList, String fileEnding)
Write any string to the given file.void
writeTacticCandidateInfo(ITactic heuristic, Collection<TacticsResultCandidate> candidatesFromCurrentHeuristic)
void
writeTacticManagerChoice(TacticsResultCandidate c)
void
writeToLogFile(String entry)
Writes String entry to log file in results directory.
-
-
-
Method Detail
-
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
-
-
writeIndividual
public void writeIndividual(DSEIndividual i)
-
getFilename
public URI getFilename()
returns the file location- Returns:
- file location as URI
-
writeTacticCandidateInfo
public void writeTacticCandidateInfo(ITactic heuristic, Collection<TacticsResultCandidate> candidatesFromCurrentHeuristic)
-
writeTacticManagerChoice
public void writeTacticManagerChoice(TacticsResultCandidate c)
-
writeToLogFile
public void writeToLogFile(String entry)
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
protected void finalize() throws Throwable
-
getDimensionName
public static String getDimensionName(org.opt4j.core.Criterion criterion)
-
-