23import java.util.logging.Level;
25import org.openscience.cdk.CDKConstants;
27import denoptim.constants.DENOPTIMConstants;
28import denoptim.exception.DENOPTIMException;
29import denoptim.fitness.FitnessParameters;
30import denoptim.fragspace.FragmentSpace;
31import denoptim.fragspace.FragmentSpaceParameters;
32import denoptim.graph.Candidate;
33import denoptim.graph.DGraph;
34import denoptim.logging.CounterID;
35import denoptim.logging.Monitor;
36import denoptim.molecularmodeling.ThreeDimTreeBuilder;
37import denoptim.programs.RunTimeParameters.ParametersType;
38import denoptim.programs.denovo.GAParameters;
39import denoptim.task.FitnessTask;
86 this.molName = offspring.
getName();
87 this.workDir =
new File(
workDir);
89 this.population = popln;
145 }
catch (Throwable t) {
173 errMsg =
"Exception while running fitness provider";
175 ex.printStackTrace();
186 boolean addthisToPop =
false;
187 boolean isWithinBestPrcentile =
false;
213 "Candidate {0} is worse than the worst "
214 +
"population member and does not "
215 +
"enter the population.",
molName);
220 "Adding {0} to population",
molName);
241 && isWithinBestPrcentile && addthisToPop)
General set of constants used in DENOPTIM.
static final String GRAPHTAG
SDF tag containing graph encoding.
static final String INCHIKEYTAG
SDF tag containing the unique identifier of a candidate.
static final String PROVENANCE
SDF tag containing provenance data for a graph.
static final String CANDIDATE2DEXTENSION
Extension of output file with 2D picture of candidate.
static final String GCODETAG
SDF tag containing graph ID.
static final String UNIQUEIDTAG
SDF tag containing the unique identifier of a candidate.
static final String GRAPHJSONTAG
SDF tag containing graph encoding in JSON format.
static final String SMILESTAG
SDF tag containing the SMILES of a candidate.
static final String FITFILENAMEEXTOUT
Ending and extension of output file of external fitness provider.
static final String FITFILENAMEEXTIN
Ending and extension of input file of external fitness provider.
Settings defining the calculation of fitness.
Class defining a space of building blocks.
void addFusedRingsToFragmentLibrary(DGraph graph)
Extracts a system of one or more fused rings and adds them to the fragment space if not already prese...
Parameters defining the fragment space.
FragmentSpace getFragmentSpace()
Task that calls the fitness provider for an offspring that can become a member of the current populat...
final boolean replaceWorstPopMember
FragmentSpace fragSpace
The fragment space.
volatile Population population
Candidate sibling
The sibling of this offspring.
GAParameters gaSettings
Parameters controlling GA experiments.
OffspringEvaluationTask(GAParameters gaSettings, Candidate offspring, Candidate sibling, String workDir, Population popln, Monitor mnt, String fileUID, boolean replaceWorstPopMember)
A collection of candidates.
double getMinFitness()
Gets the minimum value of the fitness in this population.
boolean isWithinPercentile(double value, double percentile)
Checks if a given fitness value if within the given percentile of best candidates.
Candidate getMinFitnessMember()
Gets the Candidate with minimum value of the fitness in this population.
Candidate remove(int index)
A candidate is the combination of a denoptim graph with molecular representation and may include also...
boolean hasFitness
Flag signaling the presence of a fitness value associated.
void setSmiles(String smiles)
void setName(String name)
IAtomContainer getChemicalRepresentation()
Returns the atom container representing this candidate.
Container for the list of vertices and the edges that connect them.
String toJson()
Produces a string that represents this graph and that adheres to the JSON format.
DGraph clone()
Returns almost "deep-copy" of this graph.
void replaceUnusedRCVsWithCapps(FragmentSpace fragSpace)
Removes unused ring-closing vertices.
A collection of counters user to count actions taken by the evolutionary algorithm.
void increase(CounterID cid)
Tool to build build three-dimensional (3D) tree-like molecular structures from DGraph.
IAtomContainer convertGraphTo3DAtomContainer(DGraph graph)
Created a three-dimensional molecular representation from a given DGraph.
boolean containsParameters(ParametersType type)
RunTimeParameters getParameters(ParametersType type)
Logger getLogger()
Get the name of the program specific logger.
Randomizer getRandomizer()
Returns the current program-specific randomizer.
Parameters for genetic algorithm.
double getSaveRingSystemsFitnessThreshold()
boolean getSaveRingSystemsAsTemplatesNonScaff()
boolean keepBestSibling
Flag controlling if we choose the best sibling out of crossover.
boolean getSaveRingSystemsAsTemplatesScaff()
Task that assesses the fitness of a given graph.
DGraph dGraph
The graph representation of the entity to evaluate.
String fitProvInputFile
The file where we store the input to the fitness provider.
void runFitnessProvider()
This method runs the actual evaluation of the fitness, whether that is run internally (i....
String fitProvUIDFile
The file where we store the list of unique identifiers or previously evaluated candidates.
FitnessParameters fitnessSettings
Settings for the calculation of the fitness.
Candidate result
The data structure holding the results of this task.
String fitProvOutFile
The file where we store the final output from the fitness provider.
IAtomContainer fitProvMol
The chemical representation of the entity to evaluate.
String fitProvPNGFile
The file where we store the graphical representation of the candidate (i.e., a picture).
File workDir
The file system location where we want to be placed when doing the work.
boolean completed
Flag about completion.
String errMsg
Error message produced by any subtask.
boolean hasException
Flag about exception.
final String SEP
System-dependent file separator.
Throwable thrownExc
Exception thrown.
Identifier of the type of parameters.
FS_PARAMS
Parameters pertaining the definition of the fragment space.
FIT_PARAMS
Parameters pertaining the calculation of fitness (i.e., the fitness provider).