19package denoptim.programs.combinatorial;
22import java.lang.reflect.Field;
23import java.text.SimpleDateFormat;
24import java.util.ArrayList;
26import java.util.logging.Level;
28import denoptim.combinatorial.CEBLUtils;
29import denoptim.combinatorial.CheckPoint;
30import denoptim.constants.DENOPTIMConstants;
31import denoptim.exception.DENOPTIMException;
32import denoptim.files.FileFormat;
33import denoptim.files.FileUtils;
34import denoptim.fitness.FitnessParameters;
35import denoptim.graph.DGraph;
36import denoptim.io.DenoptimIO;
37import denoptim.logging.StaticLogger;
38import denoptim.programs.RunTimeParameters;
175 this.dbRootDir = pathname;
260 switch (key.toUpperCase())
272 case "RESTARTFROMCHECKPOINT=":
276 case "DEVEL-PREPAREFILESFORTESTS=":
279 case "CHECKPOINTSTEPLENGTH=":
286 msg =
"Unable to understand value " + key +
"'" + value +
"'";
290 case "DBROOTFOLDER=":
294 case "NUMOFPROCESSORS=":
297 numCPU = Integer.parseInt(value);
301 msg =
"Unable to understand value " + key +
"'" + value +
"'";
308 maxWait = Long.parseLong(value, 10) * 1000L;
312 msg =
"Unable to understand value " + key +
"'" + value +
"'";
319 waitStep = Long.parseLong(value, 10) * 1000L;
323 msg =
"Unable to understand value " + key +
"'" + value +
"'";
334 msg =
"Unable to understand value " + key +
"'" + value +
"'";
345 msg =
"Unable to understand value " + key +
"'" + value +
"'";
350 msg =
"Keyword " + key +
" is not a known FragmentSpaceExplorer-"
351 +
"related keyword. Check input files.";
379 msg =
"Directory '" +
workDir +
"' not found. Please specify an "
380 +
"existing directory.";
386 msg =
"Directory '" +
dbRootDir +
"' not found. "
387 +
"Please specify an existing directory where to put "
388 +
"the DB of generated DENOPTIMGraphs.";
400 msg =
"Number of processors (" +
numCPU +
") is not valid. "
401 +
"Setting its value to 1.";
408 msg =
"The maximum level must be larger than zero.";
414 msg =
"Checkpoint file " +
chkptFile +
" not found. ";
420 msg =
"The minimum acceptable value for the number of submitted "
421 +
"tasks between two checkpoint files is 2. Change your "
453 throw new Error(msg,t);
471 +
"Output files associated with the current run are "
481 String fileSep = System.getProperty(
"file.separator");
482 boolean success =
false;
485 SimpleDateFormat sdf =
new SimpleDateFormat(
"yyyyMMddkkmmss");
486 String str =
"FSE" + sdf.format(
new Date());
487 workDir = curDir + fileSep + str;
508 StringBuilder sb =
new StringBuilder(1024);
510 for (Field f : this.getClass().getDeclaredFields())
514 sb.append(f.getName()).append(
" = ").append(
515 f.get(
this)).append(
NL);
520 +
" parameters. Cause: " + t);
526 sb.append(otherCollector.getPrintedList());
528 return sb.toString();
Helper methods for the exploration of the fragment space.
static CheckPoint deserializeCheckpoint(String file)
Converts a text file into the corresponding checkpoint object.
Object collecting information needed to restart a FragSpaceExplorer job.
General set of constants used in DENOPTIM.
static final String EOL
new line character
static boolean checkExists(String fileName)
static boolean createDirectory(String fileName)
Creates a directory.
static void addToRecentFiles(String fileName, FileFormat ff)
Appends an entry to the list of recent files.
Settings defining the calculation of fitness.
Utility methods for input/output.
static ArrayList< DGraph > readDENOPTIMGraphsFromFile(File inFile)
Reads a list of <DGraphs from file.
Logger class for DENOPTIM.
static final Logger appLogger
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
boolean isMaster
Flag signaling this is the master collection of parameters.
String paramTypeName()
Returns a string defining the type the parameters collected here.
void checkOtherParameters()
Checks any of the parameter collections contained in this instance.
String workDir
Working directory.
final String NL
New line character.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
int verbosity
Verbosity level for logger.
Parameters controlling execution of the combinatorial algorithm for exploration of a fragment space b...
CheckPoint chkpt
Checkpoint for restarting an interrupted FSE run.
void processParameters()
Processes all parameters and initialize related objects.
ArrayList< DGraph > rootGraphs
User defined list of root graphs.
String chkptFile
Name of checkpoint file for restarting an interrupted FSE run.
void setDBRoot(String pathname)
boolean runFitnessTask
Flag: optionally perform an evaluation of the fitness/descriptors on each accepted graph.
ArrayList< DGraph > getRootGraphs()
String uidFile
Unique identifier file.
void checkParameters()
Evaluate consistency of input parameters.
String rootGraphsFile
File with user defined list of root graphs.
boolean chkptRestart
Flag defining a restart from checkpoint file.
boolean prepareChkAndSerForTests
Flag requiring generation of the checkpoint files for the testing suite.
boolean useGivenRoots
Flag declaring that generation of graphs will use a given list of graphs as starting points for the e...
void createWorkingDirectory()
String dbRootDir
Folder containing DENOPTIMGraphs sorted by level and reported as Strings.
long maxWait
Maximum wait for completion of a level (millisec)
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
CheckPoint getCheckPoint()
boolean submitFitnessTask()
String getCheckPointName()
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
int numCPU
Number of processors.
boolean prepareFilesForTests()
CEBLParameters()
Constructor.
int maxLevel
Maximum level accepted: number of frag-frag bond from the origin (i.e., the scaffolds)
int chkptStep
Number of combinations between every check out of the current position into a checkpoint file.
long waitStep
Time step between each check for completion of a level (millisec)
boolean restartFromCheckPoint()
Identifier of the type of parameters.
CEBL_PARAMS
Parameters pertaining the combinatorial exploration by layer.
FIT_PARAMS
Parameters pertaining the calculation of fitness (i.e., the fitness provider).