23import java.io.PrintWriter;
24import java.io.StringWriter;
25import java.util.logging.Handler;
26import java.util.logging.Level;
27import java.util.logging.Logger;
29import denoptim.exception.DENOPTIMException;
30import denoptim.files.FileFormat;
31import denoptim.files.FileUtils;
32import denoptim.io.DenoptimIO;
33import denoptim.logging.StaticLogger;
34import denoptim.utils.TaskUtils;
65 this.configFilePathName = configFile;
126 for (Handler h : logger.getHandlers())
140 StringWriter sw =
new StringWriter();
141 PrintWriter pw =
new PrintWriter(sw);
149 +
"Details in "+errFile);
153 +
"reported here since we could not write to file '"
static void addToRecentFiles(String fileName, FileFormat ff)
Appends an entry to the list of recent files.
Utility methods for input/output.
static void writeData(String fileName, String data, boolean append)
Write text-like data file.
Logger class for DENOPTIM.
static final Logger appLogger
Task structure for any of the main programs in the denoptim project, such as genetic algorithm and co...
void printErrorToFile()
Method that can be called to create a text file with the error triggered by any Throwable that can be...
Object call()
This method redirects the callable functionality to an abstract method (namely ProgramTask#runProgram...
String loggerIdentifier
Identifier of this program's logger.
ProgramTask(File configFile, File workDir)
Creates and configures the program task.
void handleThrowable()
Method to handle any Throwable originated from the runProgram() method.
abstract void runProgram()
void stopLogger()
Stops the program-specific logger and releases the lock file on the logfile.
File configFilePathName
File containing configuration parameters for the program task.
Manager for tasks submitted by the GUI.
static void subtractDoneTask()
A task that can throw exceptions.
boolean notifyGlobalTaskManager
Flag controlling whether this task is expected to notify the static task manager.
File workDir
The file system location where we want to be placed when doing the work.
int id
A user-assigned id for this task.
final String SEP
System-dependent file separator.
Throwable thrownExc
Exception thrown.
static synchronized int getUniqueTaskIndex()
Unique counter for tasks.