$darkmode
DENOPTIM
denoptim.ga.EAUtils Class Reference

Helper methods for the genetic algorithm. More...

Collaboration diagram for denoptim.ga.EAUtils:
[legend]

Classes

enum  CandidateSource
 A chosen method for generation of new Candidates. More...
 

Static Public Member Functions

static int chooseNumberOfSitesToMutate (double[] multiSiteMutationProb, double hit)
 Takes a decision on how many sites to mutate on a candidate. More...
 
static CandidateSource pickNewCandidateGenerationMode (double xoverWeight, double mutWeight, double newWeight, Randomizer randomizer)
 Takes a decision on which CandidateSource method to use for generating a new Candidate. More...
 
static Candidate buildCandidateByFragmentingMolecule (IAtomContainer mol, Monitor mnt, GAParameters settings, int index) throws DENOPTIMException
 Generates a candidate by fragmenting a molecule and generating the graph that reconnects all fragments to reform the original molecule. More...
 
static DGraph makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy) throws DENOPTIMException
 Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More...
 
static DGraph makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, double linearAngleLimit) throws DENOPTIMException
 Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More...
 
static DGraph makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, FragmentSpace fragSpace) throws DENOPTIMException
 Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More...
 
static DGraph makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, double linearAngleLimit, FragmentSpace fragSpace) throws DENOPTIMException
 Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More...
 
static void outputPopulationDetails (Population population, String filename, GAParameters settings, boolean printpathNames) throws DENOPTIMException
 Write out summary for the current GA population. More...
 
static String getPathNameToGenerationFolder (int genID, GAParameters settings)
 
static String getPathNameToGenerationDetailsFile (int genID, GAParameters settings)
 
static String getPathNameToFinalPopulationFolder (GAParameters settings)
 
static String getPathNameToFinalPopulationDetailsFile (GAParameters settings)
 
static double getGrowthProbabilityAtLevel (int level, int scheme, double lambda, double sigmaOne, double sigmaTwo)
 Calculates the probability of adding a fragment to the given level. More...
 
static double getMolSizeProbability (DGraph graph, GAParameters settings)
 Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters. More...
 
static double getMolSizeProbability (DGraph graph, int scheme, double lambda, double sigmaOne, double sigmaTwo)
 Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters. More...
 
static double getProbability (double value, int scheme, double lambda, double sigmaOne, double sigmaTwo)
 Calculated a probability given parameters defining the shape of the probability function and a single input value. More...
 
static double getGrowthByLevelProbability (int level, GAParameters settings)
 Calculates the probability of adding a fragment to the given level. More...
 
static double getCrowdingProbability (AttachmentPoint ap, GAParameters settings)
 Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used. More...
 
static double getCrowdingProbability (int crowdedness, GAParameters settings)
 Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used. More...
 
static int getCrowdedness (AttachmentPoint ap)
 Calculate the current crowdedness of the given attachment point. More...
 
static int getCrowdedness (AttachmentPoint ap, boolean ignoreFreeRCVs)
 Calculate the current crowdedness of the given attachment point. More...
 
static double getCrowdingProbability (AttachmentPoint ap, int scheme, double lambda, double sigmaOne, double sigmaTwo)
 Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points that have already been used. More...
 
static double getCrowdingProbabilityForCrowdedness (int crowdedness, int scheme, double lambda, double sigmaOne, double sigmaTwo)
 Calculated the crowding probability for a given level of crowdedness. More...
 
static List< List< RelatedAPPair > > searchRingFusionSites (DGraph graph, GAParameters gaParams) throws DENOPTIMException
 
static List< List< RelatedAPPair > > searchRingFusionSites (DGraph graph, FragmentSpace fragSpace, RingClosureParameters rcParams, boolean projectOnSymmetricAPs, Logger logger, Randomizer rng) throws DENOPTIMException
 
static Boolean apPairsAreOverlapping (Iterable< RelatedAPPair > pairs)
 Evaluates if any pair of AttachmentPoint pairs involve the same AttachmentPoint, i.e., if there is overlap between any pair of pairs. More...
 
static Boolean shareAPs (RelatedAPPair pairA, Iterable< RelatedAPPair > lstB)
 Evaluates if a RelatedAPPair involves the same AttachmentPoint present in a collection. More...
 
static List< VertexgetUsableAromaticBridges (String elInIncomingFrag, int[] allowedLengths, FragmentSpace fragSpace)
 Finds all vertexes that can be used as aromatic bridge, i.e., can be used to create an aromatic ring by fusion with another aromatic ring. More...
 
static List< VertexgetUsableAliphaticBridges (APClass apcA, APClass apcB, int[] allowedLengths, FragmentSpace fragSpace)
 Finds all vertexes that can be used as aliphatic bridge. More...
 

Static Protected Member Functions

static void createFolderForGeneration (int genId, GAParameters settings)
 Creates a folder meant to hold all the data generated during a generation. More...
 
static Population importInitialPopulation (SizeControlledSet uniqueIDsSet, GAParameters settings) throws DENOPTIMException, IOException
 Reads unique identifiers and initial population file according to the GAParameters. More...
 
static CandidateSource chooseGenerationMethod (GAParameters settings)
 Choose one of the methods to make new Candidates. More...
 
static List< CandidatebuildCandidatesByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, GAParameters settings) throws DENOPTIMException
 Generates a pair of new offspring by performing a crossover operation. More...
 
static Candidate buildCandidateByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, GAParameters settings) throws DENOPTIMException
 Generates a new offspring by performing a crossover operation. More...
 
static Candidate buildCandidateByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, int[] choiceOfParents, int choiceOfXOverSites, int choiceOfOffstring, GAParameters settings) throws DENOPTIMException
 Generates a new offspring by performing a crossover operation. More...
 
static List< CandidatebuildCandidatesByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, int[] choiceOfParents, int choiceOfXOverSites, int choiceOfOffstring, GAParameters settings, int maxCandidatesToReturn) throws DENOPTIMException
 Generates up to a pair of new offspring by performing a crossover operation. More...
 
static Candidate buildCandidateByMutation (List< Candidate > eligibleParents, Monitor mnt, GAParameters settings) throws DENOPTIMException
 
static Candidate readCandidateFromFile (File srcFile, Monitor mnt, GAParameters settings) throws DENOPTIMException
 
static Candidate buildCandidateFromScratch (Monitor mnt, GAParameters settings) throws DENOPTIMException
 
static Candidate[] selectBasedOnFitness (List< Candidate > eligibleParents, int number, GAParameters settings)
 Selects a number of members from the given population. More...
 
static Vertex selectNonScaffoldNonCapVertex (DGraph g, Randomizer randomizer)
 Chose randomly a vertex that is neither scaffold or capping group. More...
 
static XoverSite performFBCC (List< Candidate > eligibleParents, Population population, int[] choiceOfParents, int choiceOfXOverSites, GAParameters settings)
 Perform fitness-based, class-compatible selection of parents that can do crossover operations. More...
 
static void outputFinalResults (Population popln, GAParameters settings) throws DENOPTIMException
 Saves the final results to disk. More...
 
static void getPopulationFromFile (String filename, Population population, SizeControlledSet uniqueIDsSet, String genDir, GAParameters settings) throws DENOPTIMException, IOException
 Reconstruct the molecular population from the file. More...
 
static void writeUID (String outfile, HashSet< String > lstInchi, boolean append) throws DENOPTIMException
 
static void setVertexCounterValue (Population population) throws DENOPTIMException
 Set the Vertex counter value according to the largest value found in the given population. More...
 
static DGraph buildGraph (GAParameters settings) throws DENOPTIMException
 Graph construction starts with selecting a random core/scaffold. More...
 
static boolean setupRings (Object[] res, DGraph molGraph, GAParameters settings) throws DENOPTIMException
 Evaluates the possibility of closing rings in a given graph and if any ring can be closed, it chooses one of the combinations of ring closures that involves the highest number of new rings. More...
 
static boolean containsMolecule (Population mols, String molcode)
 Check if the population contains the specified InChi code. More...
 
static double[] getFitnesses (Population mols)
 Get the fitness values for the list of molecules. More...
 
static double getPopulationSD (Population molPopulation)
 Check if fitness values have significant standard deviation. More...
 
static boolean foundForbiddenEnd (DGraph molGraph, FragmentSpaceParameters fsParams)
 Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused. More...
 
static void readUID (String infile, HashSet< String > lstInchi) throws DENOPTIMException
 

Static Protected Attributes

static HashMap< Integer, ArrayList< Integer > > fragmentPool
 
static HashMap< Integer, ArrayList< String > > lstFragmentClass
 

Static Private Member Functions

static DecimalFormat initialiseFormatter ()
 
static void appendVertexesToGraphFollowingEdges (DGraph graph, AtomicInteger vId, List< Vertex > vertexes) throws DENOPTIMException
 
static String getSummaryStatistics (Population popln, GAParameters settings)
 
static List< List< RelatedAPPair > > combineRelatedAPPair (List< RelatedAPPair > pool, int k, int limit)
 
static void combineRelatedAPPairUtil (List< RelatedAPPair > pool, int left, int k, List< RelatedAPPair > tmp, List< List< RelatedAPPair > > allCombs, int limit)
 
static void storePairsSymmetricRelations (RelatedAPPair pair, SymmetricAPs symAPs, Map< SymmetricSetWithMode, List< RelatedAPPair > > storage)
 
static boolean canBeUsedForRingFusion (AttachmentPoint ap, Set< Long > originalVertexIDs, FragmentSpace fs)
 Decides if an AttachmentPoint can be considered for making a ring fusion operation, i.e., attach a bridge on one AP and use another AP to close a ring. More...
 

Static Private Attributes

static Locale enUsLocale = new Locale("en", "US")
 Locale used to write reports. More...
 
static DecimalFormat df = initialiseFormatter()
 Format for decimal fitness numbers that overwrites Locale to en_US. More...
 
static final String NL =System.getProperty("line.separator")
 
static final String FSEP = System.getProperty("file.separator")
 

Detailed Description

Helper methods for the genetic algorithm.

Author
Vishwesh Venkatraman
Marco Foscato

Definition at line 106 of file EAUtils.java.

Member Function Documentation

◆ apPairsAreOverlapping()

static Boolean denoptim.ga.EAUtils.apPairsAreOverlapping ( Iterable< RelatedAPPair pairs)
static

Evaluates if any pair of AttachmentPoint pairs involve the same AttachmentPoint, i.e., if there is overlap between any pair of pairs.

Parameters
pairsthe collection of pairs to evaluate for overlap.
Returns
true if there is any AttachmentPoint that is present in more than one pair visited by the iterations.

Definition at line 2905 of file EAUtils.java.

Referenced by denoptim.ga.EAUtils.combineRelatedAPPairUtil().

Here is the caller graph for this function:

◆ appendVertexesToGraphFollowingEdges()

static void denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges ( DGraph  graph,
AtomicInteger  vId,
List< Vertex vertexes 
) throws DENOPTIMException
staticprivate

◆ buildCandidateByFragmentingMolecule()

static Candidate denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule ( IAtomContainer  mol,
Monitor  mnt,
GAParameters  settings,
int  index 
) throws DENOPTIMException
static

Generates a candidate by fragmenting a molecule and generating the graph that reconnects all fragments to reform the original molecule.

Essentially, it converts an IAtomContainer into a DGraph and makes a Candidate out of it.

Parameters
molthe molecule to convert.
cutRulesthe cutting rules to use in the fragmentation.
mntthe tool monitoring events for logging purposes.
settingsGA settings.
indexidentifies the given IAtomContainer in a collection of systems to work on. This is used only for logging.
Exceptions
DENOPTIMException

Definition at line 943 of file EAUtils.java.

References denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.CONVERTBYFRAGATTEMPTS, denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.programs.fragmenter.FragmenterParameters.embedRingsInTemplate, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_FRAGMENTATION, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_TMPLEMBEDDING, denoptim.programs.RunTimeParameters.ParametersType.FRG_PARAMS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.programs.fragmenter.FragmenterParameters.getCuttingRules(), denoptim.programs.fragmenter.FragmenterParameters.getEmbeddedRingsContract(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.fragmenter.FragmenterParameters.getLinearAngleLimit(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.programs.fragmenter.FragmenterParameters.getScaffoldingPolicy(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.fragmenter.FragmenterTools.prepareMolToFragmentation(), denoptim.graph.GraphPattern.RING, denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), and denoptim.graph.Candidate.setUID().

Referenced by denoptim.ga.EvolutionaryAlgorithm.initializePopulation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCandidateByMutation()

static Candidate denoptim.ga.EAUtils.buildCandidateByMutation ( List< Candidate eligibleParents,
Monitor  mnt,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Definition at line 645 of file EAUtils.java.

References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.graph.DGraph.clone(), denoptim.logging.CounterID.FAILEDMUTATTEMTS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_EVAL, denoptim.logging.CounterID.FAILEDMUTATTEMTS_FORBENDS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_PERFORM, denoptim.logging.CounterID.FAILEDMUTATTEMTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.graph.Candidate.getGeneration(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.DGraph.getLocalMsg(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.Candidate.getSDFFile(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.MUTATTEMPTS, denoptim.logging.CounterID.MUTPARENTSEARCH, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.ga.GraphOperations.performMutation(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.ga.EAUtils.selectBasedOnFitness(), denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), denoptim.ga.EAUtils.setupRings(), and denoptim.io.DenoptimIO.writeGraphToSDF().

Referenced by denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCandidateByXOver() [1/2]

static Candidate denoptim.ga.EAUtils.buildCandidateByXOver ( List< Candidate eligibleParents,
Population  population,
Monitor  mnt,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Generates a new offspring by performing a crossover operation.

Parameters
eligibleParentscandidates that can be used as parents of the offspring.
populationthe collection of candidates where eligible candidates are hosted.
mntmonitoring tool used to record events during the run of the evolutionary algorithm.
Returns
a candidate chosen in a stochastic manner.

Definition at line 313 of file EAUtils.java.

References denoptim.ga.EAUtils.buildCandidateByXOver().

Referenced by denoptim.ga.EAUtils.buildCandidateByXOver(), denoptim.ga.EAUtilsTest.testAvoidRedundantXOver(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards(), and denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCandidateByXOver() [2/2]

static Candidate denoptim.ga.EAUtils.buildCandidateByXOver ( List< Candidate eligibleParents,
Population  population,
Monitor  mnt,
int[]  choiceOfParents,
int  choiceOfXOverSites,
int  choiceOfOffstring,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Generates a new offspring by performing a crossover operation.

Parameters
eligibleParentscandidates that can be used as parents of the offspring.
populationthe collection of candidates where eligible candidates are hosted.
mntmonitoring tool used to record events during the run of the evolutionary algorithm.
choiceOfParentsa pair of indexes dictating which ones among the eligible parents we should use as parents. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
choiceOfXOverSitesindex indicating which crossover site to use. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
choiceOfOffstringindex dictating which among the available two offspring (at most two, for now) is returned as result. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
Returns
the candidate or null if none was produced.
Exceptions
DENOPTIMException

Definition at line 347 of file EAUtils.java.

References denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the call graph for this function:

◆ buildCandidateFromScratch()

static Candidate denoptim.ga.EAUtils.buildCandidateFromScratch ( Monitor  mnt,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Definition at line 842 of file EAUtils.java.

References denoptim.logging.CounterID.BUILDANEWATTEMPTS, denoptim.ga.EAUtils.buildGraph(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.FAILEDBUILDATTEMPTS, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_FORBIDENDS, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_GRAPHBUILD, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), and denoptim.ga.EAUtils.setupRings().

Referenced by denoptim.ga.EvolutionaryAlgorithm.initializePopulation(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCandidatesByXOver() [1/2]

static List< Candidate > denoptim.ga.EAUtils.buildCandidatesByXOver ( List< Candidate eligibleParents,
Population  population,
Monitor  mnt,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Generates a pair of new offspring by performing a crossover operation.

Parameters
eligibleParentscandidates that can be used as parents of the offspring.
populationthe collection of candidates where eligible candidates are hosted.
mntmonitoring tool used to record events during the run of the evolutionary algorithm.
settingsthe settings of the genetic algorithm.
Returns
a candidate chosen in a stochastic manner.

Definition at line 293 of file EAUtils.java.

References denoptim.ga.EAUtils.buildCandidatesByXOver().

Referenced by denoptim.ga.EAUtils.buildCandidateByXOver(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCandidatesByXOver() [2/2]

static List< Candidate > denoptim.ga.EAUtils.buildCandidatesByXOver ( List< Candidate eligibleParents,
Population  population,
Monitor  mnt,
int[]  choiceOfParents,
int  choiceOfXOverSites,
int  choiceOfOffstring,
GAParameters  settings,
int  maxCandidatesToReturn 
) throws DENOPTIMException
staticprotected

Generates up to a pair of new offspring by performing a crossover operation.

Parameters
eligibleParentscandidates that can be used as parents of the offspring.
populationthe collection of candidates where eligible candidates are hosted.
mntmonitoring tool used to record events during the run of the evolutionary algorithm.
choiceOfParentsa pair of indexes dictating which ones among the eligible parents we should use as parents. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
choiceOfXOverSitesindex indicating which crossover site to use. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
choiceOfOffstringindex dictating which among the available two offspring (at most two, for now) is returned as result. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice".
maxCandidatesToReturnthe number of offspring to return in the list. Up to 2.
Returns
the list of candidates, or an empty list.
Exceptions
DENOPTIMException

Definition at line 392 of file EAUtils.java.

References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.FAILEDXOVERATTEMPTS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_FINDPARENTS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_FORBENDS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_PERFORM, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.ga.XoverSite.getA(), denoptim.ga.XoverSite.getB(), denoptim.graph.DGraph.getCandidateOwner(), denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.graph.DGraph.getChildrenTree(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.graph.Candidate.getGeneration(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.Candidate.getName(), denoptim.graph.DGraph.getOutermostGraphOwner(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.ga.EAUtils.NL, denoptim.ga.GraphOperations.performCrossover(), denoptim.ga.EAUtils.performFBCC(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.ga.EAUtils.selectBasedOnFitness(), denoptim.ga.EAUtils.selectNonScaffoldNonCapVertex(), denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), denoptim.ga.EAUtils.setupRings(), denoptim.ga.XoverSite.toString(), denoptim.fragspace.FragmentSpace.useAPclassBasedApproach(), denoptim.io.DenoptimIO.writeGraphsToSDF(), denoptim.logging.CounterID.XOVERATTEMPTS, and denoptim.logging.CounterID.XOVERPARENTSEARCH.

Here is the call graph for this function:

◆ buildGraph()

static DGraph denoptim.ga.EAUtils.buildGraph ( GAParameters  settings) throws DENOPTIMException
staticprotected

Graph construction starts with selecting a random core/scaffold.

Returns
the molecular graph representation
Exceptions
DENOPTIMException

Definition at line 1803 of file EAUtils.java.

References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.containsOrEmbedsVertex(), denoptim.ga.GraphOperations.extendGraph(), denoptim.logging.CounterID.FAILEDMUTATTEMTS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_PERFORM, denoptim.graph.Template.ContractLevel.FIXED, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.rings.RingClosuresArchive.getCCFromTurningPointId(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getMutableSites(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.rings.RingClosureParameters.getRingClosuresArchive(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.graph.DGraph.getVertexCount(), denoptim.graph.Vertex.hasFreeAP(), denoptim.logging.Monitor.increase(), denoptim.fragspace.FragmentSpace.makeRandomScaffold(), denoptim.ga.GraphOperations.performMutation(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.graph.DGraph.setCandidateClosableChains(), denoptim.graph.DGraph.setGraphId(), and denoptim.graph.DGraph.setLocalMsg().

Referenced by denoptim.ga.EAUtils.buildCandidateFromScratch(), and denoptim.ga.EAUtilsTest.testBuildGraphFromTemplateScaffold().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canBeUsedForRingFusion()

static boolean denoptim.ga.EAUtils.canBeUsedForRingFusion ( AttachmentPoint  ap,
Set< Long >  originalVertexIDs,
FragmentSpace  fs 
)
staticprivate

Decides if an AttachmentPoint can be considered for making a ring fusion operation, i.e., attach a bridge on one AP and use another AP to close a ring.

The condition to return true is that both these are satisfied:

  • the AP is available (at any level of template embedding). This ignores any vertex that is added to saturate valences.
  • the APClass of the AP allows ring closure, i.e., it is present in the ring-closing compatibility matrix.
Parameters
apthe attachment point we want to analyze. Note this is NOT the actual AP in the graph, but a copy of it that is stored in the IAtom properties!
originalVertexIDslist of ID defining which vertex is from the original graph. This is used to explode any vertex that has been added on the graph to saturate valences.
fsthe fragment space containing the ring-closures compatibility matrix.
Returns

Definition at line 2967 of file EAUtils.java.

References denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.fragspace.FragmentSpace.getRCCompatibilityMatrix(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.AttachmentPoint.isAvailableThroughout().

Referenced by denoptim.ga.EAUtils.searchRingFusionSites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ chooseGenerationMethod()

static CandidateSource denoptim.ga.EAUtils.chooseGenerationMethod ( GAParameters  settings)
staticprotected

Choose one of the methods to make new Candidates.

The choice is biased by the weights of the methods as defined in the GAParameters.

Parameters
thegenetic algorithm settings
Returns
one among the possible CandidateSource excluding {@value CandidateSource::MANUAL}.

Definition at line 207 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getConstructionWeight(), denoptim.programs.denovo.GAParameters.getCrossoverWeight(), denoptim.programs.denovo.GAParameters.getMutationWeight(), denoptim.programs.RunTimeParameters.getRandomizer(), and denoptim.ga.EAUtils.pickNewCandidateGenerationMode().

Referenced by denoptim.ga.EvolutionaryAlgorithm.makeOffspringA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ chooseNumberOfSitesToMutate()

static int denoptim.ga.EAUtils.chooseNumberOfSitesToMutate ( double[]  multiSiteMutationProb,
double  hit 
)
static

Takes a decision on how many sites to mutate on a candidate.

Parameters
multiSiteMutationProbthe probability (0-1) of multi-site mutation.
hita random real number between 0 and 1.
Returns
an integer indicating how many mutation to perform.

Definition at line 224 of file EAUtils.java.

Referenced by denoptim.ga.GraphOperations.performMutation(), and denoptim.ga.EAUtilsTest.testChooseNumberOfSitesToMutate().

Here is the caller graph for this function:

◆ combineRelatedAPPair()

static List< List< RelatedAPPair > > denoptim.ga.EAUtils.combineRelatedAPPair ( List< RelatedAPPair pool,
int  k,
int  limit 
)
staticprivate

Definition at line 2833 of file EAUtils.java.

References denoptim.ga.EAUtils.combineRelatedAPPairUtil().

Referenced by denoptim.ga.EAUtils.searchRingFusionSites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ combineRelatedAPPairUtil()

static void denoptim.ga.EAUtils.combineRelatedAPPairUtil ( List< RelatedAPPair pool,
int  left,
int  k,
List< RelatedAPPair tmp,
List< List< RelatedAPPair > >  allCombs,
int  limit 
)
staticprivate

Definition at line 2844 of file EAUtils.java.

References denoptim.ga.EAUtils.apPairsAreOverlapping(), denoptim.ga.EAUtils.combineRelatedAPPairUtil(), and denoptim.ga.EAUtils.shareAPs().

Referenced by denoptim.ga.EAUtils.combineRelatedAPPair(), and denoptim.ga.EAUtils.combineRelatedAPPairUtil().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsMolecule()

static boolean denoptim.ga.EAUtils.containsMolecule ( Population  mols,
String  molcode 
)
staticprotected

Check if the population contains the specified InChi code.

Parameters
mols
molcode
Returns
true if found

Definition at line 2070 of file EAUtils.java.

◆ createFolderForGeneration()

static void denoptim.ga.EAUtils.createFolderForGeneration ( int  genId,
GAParameters  settings 
)
staticprotected

Creates a folder meant to hold all the data generated during a generation.

The folder is created under the work space.

Parameters
genIdthe generation's identity number
Exceptions
DENOPTIMException

Definition at line 148 of file EAUtils.java.

References denoptim.ga.EAUtils.getPathNameToGenerationFolder().

Referenced by denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), and denoptim.ga.EvolutionaryAlgorithm.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ foundForbiddenEnd()

static boolean denoptim.ga.EAUtils.foundForbiddenEnd ( DGraph  molGraph,
FragmentSpaceParameters  fsParams 
)
staticprotected

Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused.

Parameters
molGraphthe Graph representation of the molecule
Returns
true if a forbidden end is found

Definition at line 2399 of file EAUtils.java.

References denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getLogger(), and denoptim.graph.DGraph.getVertexList().

Here is the call graph for this function:

◆ getCrowdedness() [1/2]

static int denoptim.ga.EAUtils.getCrowdedness ( AttachmentPoint  ap)
static

Calculate the current crowdedness of the given attachment point.

Parameters
apthe attachment point to consider
Returns
the integer representing how many AP rooted on the same atom that holds the given attachment point are used by non-capping group building blocks.

Definition at line 2299 of file EAUtils.java.

References denoptim.ga.EAUtils.getCrowdedness().

Referenced by denoptim.ga.GraphOperations.extendGraph(), denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbability(), and denoptim.ga.EAUtils.setupRings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCrowdedness() [2/2]

static int denoptim.ga.EAUtils.getCrowdedness ( AttachmentPoint  ap,
boolean  ignoreFreeRCVs 
)
static

Calculate the current crowdedness of the given attachment point.

Parameters
apthe attachment point to consider
ignoreFreeRCVsuse true to avoid counting unused ring-closing vertexes and actual connections.
Returns
the integer representing how many AP rooted on the same atom that holds the given attachment point are used by non-capping group building blocks. Returns zero for APs belonging to EmptyVertexs.

Definition at line 2315 of file EAUtils.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.AttachmentPoint.getAtomPositionNumber(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.DGraph.getUsedRCVertices().

Here is the call graph for this function:

◆ getCrowdingProbability() [1/3]

static double denoptim.ga.EAUtils.getCrowdingProbability ( AttachmentPoint  ap,
GAParameters  settings 
)
static

Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used.

Parameters
apthe attachment point candidate to be used.
Returns
probability of adding a new building block on the given attachment point.

Definition at line 2254 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getCrowdingFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getCrowdingFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getCrowdingMultiplier(), denoptim.ga.EAUtils.getCrowdingProbability(), and denoptim.programs.denovo.GAParameters.getCrowdingProbabilityScheme().

Referenced by denoptim.ga.GraphOperations.extendGraph(), denoptim.ga.EAUtils.getCrowdingProbability(), denoptim.ga.EAUtils.setupRings(), and denoptim.ga.EAUtilsTest.testCrowdingProbability().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCrowdingProbability() [2/3]

static double denoptim.ga.EAUtils.getCrowdingProbability ( AttachmentPoint  ap,
int  scheme,
double  lambda,
double  sigmaOne,
double  sigmaTwo 
)
static

Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points that have already been used.

Parameters
apthe attachment point candidate to be used.
schemethe chosen shape of the probability function.
lambdaparameter used by scheme 0 and 1
sigmaOneparameter used by scheme 2 (steepness)
sigmaTwoparameter used by scheme 2 (middle point)
Returns
probability of adding a new building block on the given attachment point.

Definition at line 2357 of file EAUtils.java.

References denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), and denoptim.graph.AttachmentPoint.getOwner().

Here is the call graph for this function:

◆ getCrowdingProbability() [3/3]

static double denoptim.ga.EAUtils.getCrowdingProbability ( int  crowdedness,
GAParameters  settings 
)
static

Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used.

This method does not use the actual information on attachment point usage, but relies on a externally calculated values of the crowdedness. Use EAUtils#getCrowdingProbability(AttachmentPoint) to get the crowding probability for an actual attachment point. Use EAUtils#getCrowdedness(AttachmentPoint) to calculate the crowdedness for an attachment point.

Parameters
crowdednessthe level of crowdedness
Returns
probability of adding a new building block on an attachment point with the given crowdedness.

Definition at line 2279 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getCrowdingFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getCrowdingFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getCrowdingMultiplier(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), and denoptim.programs.denovo.GAParameters.getCrowdingProbabilityScheme().

Here is the call graph for this function:

◆ getCrowdingProbabilityForCrowdedness()

static double denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness ( int  crowdedness,
int  scheme,
double  lambda,
double  sigmaOne,
double  sigmaTwo 
)
static

Calculated the crowding probability for a given level of crowdedness.

Parameters
crowdednessthe level of crowdedness
schemethe chosen shape of the probability function.
lambdaparameter used by scheme 0 and 1
sigmaOneparameter used by scheme 2 (steepness)
sigmaTwoparameter used by scheme 2 (middle point)
Returns
the crowding probability.

Definition at line 2382 of file EAUtils.java.

References denoptim.ga.EAUtils.getProbability().

Referenced by denoptim.gui.GAParametersForm.createCrowdProbDataset(), and denoptim.ga.EAUtils.getCrowdingProbability().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFitnesses()

static double[] denoptim.ga.EAUtils.getFitnesses ( Population  mols)
staticprotected

Get the fitness values for the list of molecules.

Parameters
mols
Returns
array of fitness values

Definition at line 2093 of file EAUtils.java.

Referenced by denoptim.ga.EAUtils.getPopulationSD(), and denoptim.ga.EAUtils.getSummaryStatistics().

Here is the caller graph for this function:

◆ getGrowthByLevelProbability()

static double denoptim.ga.EAUtils.getGrowthByLevelProbability ( int  level,
GAParameters  settings 
)
static

Calculates the probability of adding a fragment to the given level.

Used the settings defined by the GAParameters class.

Parameters
levellevel of the graph at which fragment is to be added
Returns
probability of adding a new fragment at this level.

Definition at line 2231 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getGrowthFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getGrowthFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getGrowthMultiplier(), denoptim.ga.EAUtils.getGrowthProbabilityAtLevel(), denoptim.programs.denovo.GAParameters.getGrowthProbabilityScheme(), and denoptim.programs.denovo.GAParameters.useLevelBasedProb.

Referenced by denoptim.ga.GraphOperations.extendGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGrowthProbabilityAtLevel()

static double denoptim.ga.EAUtils.getGrowthProbabilityAtLevel ( int  level,
int  scheme,
double  lambda,
double  sigmaOne,
double  sigmaTwo 
)
static

Calculates the probability of adding a fragment to the given level.

This will require a coin toss with the calculated probability. If a newly drawn random number is less than this value, a new fragment may be added.

Parameters
levellevel of the graph at which fragment is to be added
schemethe chosen scheme.
lambdaparameter used by scheme 0 and 1.
sigmaOneparameter used by scheme 2 (steepness).
sigmaTwoparameter used by scheme 2 (middle point).
Returns
probability of adding a new fragment at this level.

Definition at line 2134 of file EAUtils.java.

References denoptim.ga.EAUtils.getProbability().

Referenced by denoptim.gui.GAParametersForm.createLvlProbDataset(), and denoptim.ga.EAUtils.getGrowthByLevelProbability().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMolSizeProbability() [1/2]

static double denoptim.ga.EAUtils.getMolSizeProbability ( DGraph  graph,
GAParameters  settings 
)
static

Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters.

Parameters
graphthe current graph for which to calculate the probability of extension.
schemethe chosen shape of the probability function.
lambdaparameter used by scheme 0 and 1
sigmaOneparameter used by scheme 2 (steepness)
sigmaTwoparameter used by scheme 2 (middle point)
Returns
the crowding probability.

Definition at line 2154 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getMolGrowthFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getMolGrowthFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getMolGrowthMultiplier(), denoptim.programs.denovo.GAParameters.getMolGrowthProbabilityScheme(), denoptim.ga.EAUtils.getMolSizeProbability(), and denoptim.programs.denovo.GAParameters.useMolSizeBasedProb.

Referenced by denoptim.ga.GraphOperations.extendGraph(), and denoptim.ga.EAUtils.getMolSizeProbability().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMolSizeProbability() [2/2]

static double denoptim.ga.EAUtils.getMolSizeProbability ( DGraph  graph,
int  scheme,
double  lambda,
double  sigmaOne,
double  sigmaTwo 
)
static

Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters.

Parameters
graphthe current graph for which to calculate the probability of extension.
schemethe chosen shape of the probability function.
lambdaparameter used by scheme 0 and 1
sigmaOneparameter used by scheme 2 (steepness)
sigmaTwoparameter used by scheme 2 (middle point)
Returns
the crowding probability.

Definition at line 2180 of file EAUtils.java.

References denoptim.graph.DGraph.getHeavyAtomsCount(), and denoptim.ga.EAUtils.getProbability().

Here is the call graph for this function:

◆ getPathNameToFinalPopulationDetailsFile()

static String denoptim.ga.EAUtils.getPathNameToFinalPopulationDetailsFile ( GAParameters  settings)
static

Definition at line 1613 of file EAUtils.java.

References denoptim.ga.EAUtils.FSEP, and denoptim.programs.denovo.GAParameters.getDataDirectory().

Referenced by denoptim.ga.EAUtils.outputFinalResults().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPathNameToFinalPopulationFolder()

static String denoptim.ga.EAUtils.getPathNameToFinalPopulationFolder ( GAParameters  settings)
static

Definition at line 1604 of file EAUtils.java.

References denoptim.ga.EAUtils.FSEP, and denoptim.programs.denovo.GAParameters.getDataDirectory().

Referenced by denoptim.ga.EAUtils.outputFinalResults().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPathNameToGenerationDetailsFile()

static String denoptim.ga.EAUtils.getPathNameToGenerationDetailsFile ( int  genID,
GAParameters  settings 
)
static

Definition at line 1584 of file EAUtils.java.

References denoptim.ga.EAUtils.FSEP, denoptim.constants.DENOPTIMConstants.GAGENDIRNAMEROOT, denoptim.programs.denovo.GAParameters.getDataDirectory(), denoptim.programs.denovo.GAParameters.getNumberOfGenerations(), and denoptim.utils.GeneralUtils.getPaddedString().

Referenced by denoptim.ga.EvolutionaryAlgorithm.run(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPathNameToGenerationFolder()

static String denoptim.ga.EAUtils.getPathNameToGenerationFolder ( int  genID,
GAParameters  settings 
)
static

Definition at line 1568 of file EAUtils.java.

References denoptim.ga.EAUtils.FSEP, denoptim.constants.DENOPTIMConstants.GAGENDIRNAMEROOT, denoptim.programs.denovo.GAParameters.getDataDirectory(), denoptim.programs.denovo.GAParameters.getNumberOfGenerations(), and denoptim.utils.GeneralUtils.getPaddedString().

Referenced by denoptim.ga.EAUtils.createFolderForGeneration(), denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), denoptim.ga.EAUtils.importInitialPopulation(), denoptim.ga.EvolutionaryAlgorithm.processInitialPopCandidate(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPopulationFromFile()

static void denoptim.ga.EAUtils.getPopulationFromFile ( String  filename,
Population  population,
SizeControlledSet  uniqueIDsSet,
String  genDir,
GAParameters  settings 
) throws DENOPTIMException, IOException
staticprotected

Reconstruct the molecular population from the file.

Parameters
filenamethe pathname to read in.
populationthe collection of population members.
uniqueIDsSetcollection of unique identifiers.
Exceptions
DENOPTIMException
IOException

Definition at line 1692 of file EAUtils.java.

References denoptim.constants.DENOPTIMConstants.FITFILENAMEEXTOUT, denoptim.utils.GeneralUtils.getPaddedString(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.io.DenoptimIO.readCandidates(), denoptim.ga.EAUtils.setVertexCounterValue(), and denoptim.io.DenoptimIO.writeCandidateToFile().

Referenced by denoptim.ga.EAUtils.importInitialPopulation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPopulationSD()

static double denoptim.ga.EAUtils.getPopulationSD ( Population  molPopulation)
staticprotected

Check if fitness values have significant standard deviation.

Parameters
molPopulation
Returns
true if population standard deviation of fitness values exceeds 0.0001

Definition at line 2114 of file EAUtils.java.

References denoptim.ga.EAUtils.getFitnesses(), and denoptim.utils.StatUtils.stddev().

Referenced by denoptim.ga.EvolutionaryAlgorithm.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProbability()

static double denoptim.ga.EAUtils.getProbability ( double  value,
int  scheme,
double  lambda,
double  sigmaOne,
double  sigmaTwo 
)
static

Calculated a probability given parameters defining the shape of the probability function and a single input value.

Parameters
valuethe value x for which we calculate f(x).
schemethe chosen shape of the probability function.
lambdaparameter used by scheme 0 and 1
sigmaOneparameter used by scheme 2 (steepness)
sigmaTwoparameter used by scheme 2 (middle point)
Returns
the probability.

Definition at line 2199 of file EAUtils.java.

Referenced by denoptim.gui.GAParametersForm.createMolSizeProbDataset(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), denoptim.ga.EAUtils.getGrowthProbabilityAtLevel(), and denoptim.ga.EAUtils.getMolSizeProbability().

Here is the caller graph for this function:

◆ getSummaryStatistics()

static String denoptim.ga.EAUtils.getSummaryStatistics ( Population  popln,
GAParameters  settings 
)
staticprivate

Definition at line 1383 of file EAUtils.java.

References denoptim.ga.EAUtils.df, denoptim.ga.EAUtils.getFitnesses(), denoptim.programs.denovo.GAParameters.getPrecisionLevel(), denoptim.utils.StatUtils.max(), denoptim.utils.StatUtils.mean(), denoptim.utils.StatUtils.median(), denoptim.utils.StatUtils.min(), denoptim.ga.EAUtils.NL, denoptim.utils.StatUtils.skewness(), and denoptim.utils.StatUtils.stddev().

Referenced by denoptim.ga.EAUtils.outputPopulationDetails().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUsableAliphaticBridges()

static List< Vertex > denoptim.ga.EAUtils.getUsableAliphaticBridges ( APClass  apcA,
APClass  apcB,
int[]  allowedLengths,
FragmentSpace  fragSpace 
)
static

Finds all vertexes that can be used as aliphatic bridge.

Parameters
apcAclass of one of the AP to be used to attach the bridge.
apcBclass of the other AP to be used to attach the bridge.
allowedLengthslist of allowed lengths in number of atoms.
fragSpacethe fragment space where to look for fragments.
Returns
the list of clones of usable fragments from the fragment space. The length the bridge is recorded in Vertex property DENOPTIMConstants#VRTPROPBRIDGELENGH.

Definition at line 3038 of file EAUtils.java.

References denoptim.graph.Vertex.clone(), denoptim.fragspace.FragmentSpace.getCompatibleAPClasses(), denoptim.fragspace.FragmentSpace.getVerticesWithAPFingerprint(), denoptim.graph.Vertex.setProperty(), denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGEEND_A, denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGEEND_B, and denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGELENGTH.

Referenced by denoptim.ga.GraphOperations.addFusedRing(), and denoptim.ga.EAUtilsTest.testGetUsableAliphaticBridges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUsableAromaticBridges()

static List< Vertex > denoptim.ga.EAUtils.getUsableAromaticBridges ( String  elInIncomingFrag,
int[]  allowedLengths,
FragmentSpace  fragSpace 
)
static

Finds all vertexes that can be used as aromatic bridge, i.e., can be used to create an aromatic ring by fusion with another aromatic ring.

Parameters
elInIncomingFragbeginning of the APClass required on the aromatic bridge fragment. This is conventionally used to define the number of electrons available to the aromatic system.
allowedBridgeLengthnumber of atoms.
fragSpacethe fragment space where to look for fragments.
Returns
the list of clones of usable fragments from the fragment space. The length the bridge is recorded in Vertex property DENOPTIMConstants#VRTPROPBRIDGELENGH.

Definition at line 2994 of file EAUtils.java.

References denoptim.graph.Vertex.clone(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClassStartingWith(), denoptim.graph.Vertex.setProperty(), and denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGELENGTH.

Referenced by denoptim.ga.GraphOperations.addFusedRing(), and denoptim.ga.EAUtilsTest.testGetUsableAromaticBridges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ importInitialPopulation()

static Population denoptim.ga.EAUtils.importInitialPopulation ( SizeControlledSet  uniqueIDsSet,
GAParameters  settings 
) throws DENOPTIMException, IOException
staticprotected

Reads unique identifiers and initial population file according to the GAParameters.

Exceptions
IOException

Definition at line 162 of file EAUtils.java.

References denoptim.ga.EAUtils.getPathNameToGenerationFolder(), denoptim.ga.EAUtils.getPopulationFromFile(), and denoptim.ga.EAUtils.readUID().

Referenced by denoptim.ga.EvolutionaryAlgorithm.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseFormatter()

static DecimalFormat denoptim.ga.EAUtils.initialiseFormatter ( )
staticprivate

Definition at line 120 of file EAUtils.java.

References denoptim.ga.EAUtils.df, and denoptim.ga.EAUtils.enUsLocale.

◆ makeGraphFromFragmentationOfMol() [1/4]

static DGraph denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol ( IAtomContainer  mol,
List< CuttingRule cuttingRules,
Logger  logger,
ScaffoldingPolicy  scaffoldingPolicy 
) throws DENOPTIMException
static

Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments.

Parameters
molthe molecule to convert
cuttingRulesthe cutting rules defining how to do fragmentation.
loggertool managing log.
scaffoldingPolicythe policy for deciding which vertex should be given the role of scaffold.
Returns
the graph.
Exceptions
DENOPTIMException

Definition at line 1044 of file EAUtils.java.

References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().

Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), denoptim.programs.mol2graph.Mol2Graph.runProgram(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_cappingGroups(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_linearities(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_ScaffoldingPolicy(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_Symmetry(), and denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_symmetry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeGraphFromFragmentationOfMol() [2/4]

static DGraph denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol ( IAtomContainer  mol,
List< CuttingRule cuttingRules,
Logger  logger,
ScaffoldingPolicy  scaffoldingPolicy,
double  linearAngleLimit 
) throws DENOPTIMException
static

Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments.

Parameters
molthe molecule to convert
cuttingRulesthe cutting rules defining how to do fragmentation.
loggertool managing log.
scaffoldingPolicythe policy for deciding which vertex should be given the role of scaffold.
linearAngleLimitthe max bond angle before we start considering the angle linear and add a linearity-breaking dummy atom.
Returns
the graph.
Exceptions
DENOPTIMException

Definition at line 1070 of file EAUtils.java.

References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().

Here is the call graph for this function:

◆ makeGraphFromFragmentationOfMol() [3/4]

static DGraph denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol ( IAtomContainer  mol,
List< CuttingRule cuttingRules,
Logger  logger,
ScaffoldingPolicy  scaffoldingPolicy,
double  linearAngleLimit,
FragmentSpace  fragSpace 
) throws DENOPTIMException
static

Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments.

Parameters
molthe molecule to convert
cuttingRulesthe cutting rules defining how to do fragmentation.
loggertool managing log.
scaffoldingPolicythe policy for deciding which vertex should be given the role of scaffold.
linearAngleLimitthe max bond angle before we start considering the angle linear and add a linearity-breaking dummy atom.
fragSpacethe definition of the fragment space to consider when generating fragments.
Returns
the graph.
Exceptions
DENOPTIMException

Definition at line 1122 of file EAUtils.java.

References denoptim.utils.DummyAtomHandler.addDummiesOnLinearities(), denoptim.graph.DGraph.addVertex(), denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges(), denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.detectSymVertexSets(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.graph.Vertex.getHeavyAtomsCount(), denoptim.graph.Vertex.getIAtomContainer(), denoptim.utils.MoleculeUtils.getSymbolOrLabel(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.Fragment.isIsomorphicTo(), denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.graph.Vertex.setBuildingBlockType(), denoptim.graph.Vertex.setVertexId(), and denoptim.graph.Fragment.updateAPs().

Here is the call graph for this function:

◆ makeGraphFromFragmentationOfMol() [4/4]

static DGraph denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol ( IAtomContainer  mol,
List< CuttingRule cuttingRules,
Logger  logger,
ScaffoldingPolicy  scaffoldingPolicy,
FragmentSpace  fragSpace 
) throws DENOPTIMException
static

Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments.

Parameters
molthe molecule to convert
cuttingRulesthe cutting rules defining how to do fragmentation.
loggertool managing log.
scaffoldingPolicythe policy for deciding which vertex should be given the role of scaffold.
fragSpacethe fragment space for defining things like, what capping groups we have.
Returns
the graph.
Exceptions
DENOPTIMException

Definition at line 1094 of file EAUtils.java.

References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().

Here is the call graph for this function:

◆ outputFinalResults()

static void denoptim.ga.EAUtils.outputFinalResults ( Population  popln,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Saves the final results to disk.

If the files for each candidate have been saved on disk along the way, then it copies them from their location into the folder for final results, which is defined based on the GA settings.

Parameters
poplnthe final list of best molecules
settingsthe GS settings containing defaults and parameters given by the user.

Definition at line 1634 of file EAUtils.java.

References denoptim.programs.RunTimeParameters.ParametersType.FIT_PARAMS, denoptim.constants.DENOPTIMConstants.FITFILENAMEEXTOUT, denoptim.graph.Candidate.getImageFile(), denoptim.graph.Candidate.getName(), denoptim.ga.EAUtils.getPathNameToFinalPopulationDetailsFile(), denoptim.ga.EAUtils.getPathNameToFinalPopulationFolder(), denoptim.graph.Candidate.getSDFFile(), denoptim.ga.EAUtils.outputPopulationDetails(), denoptim.graph.Candidate.setSDFFile(), and denoptim.io.DenoptimIO.writeCandidateToFile().

Referenced by denoptim.ga.EvolutionaryAlgorithm.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outputPopulationDetails()

static void denoptim.ga.EAUtils.outputPopulationDetails ( Population  population,
String  filename,
GAParameters  settings,
boolean  printpathNames 
) throws DENOPTIMException
static

Write out summary for the current GA population.

Parameters
population
filenamethe pathname of the file where we write the details of the population. If required by the GAParameters, we use this also to define a pathname where to write all the members of the population.
Exceptions
DENOPTIMException

Definition at line 1324 of file EAUtils.java.

References denoptim.ga.EAUtils.df, denoptim.constants.DENOPTIMConstants.GAGENSUMMARYHEADER, denoptim.graph.Candidate.getFitness(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.Candidate.getName(), denoptim.graph.Candidate.getSDFFile(), denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.graph.Candidate.getUID(), denoptim.ga.EAUtils.NL, denoptim.io.DenoptimIO.writeCandidatesToFile(), and denoptim.io.DenoptimIO.writeData().

Referenced by denoptim.ga.EAUtils.outputFinalResults(), denoptim.ga.EvolutionaryAlgorithm.run(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ performFBCC()

static XoverSite denoptim.ga.EAUtils.performFBCC ( List< Candidate eligibleParents,
Population  population,
int[]  choiceOfParents,
int  choiceOfXOverSites,
GAParameters  settings 
)
staticprotected

Perform fitness-based, class-compatible selection of parents that can do crossover operations.

Parameters
eligibleParentslist of candidates among which to choose.
populationthe dynamic population containing the eligible parents.
choiceOfParentsthe integers dictating the selection of parents. Use this only to ensure reproducibility in tests, otherwise use null
choiceOfXOverSitesthe integers dictating the selection of crossover sites. Use this only to ensure reproducibility in tests, otherwise use negative
Returns
returns the definition of the crossover in terms of subgraphs to swap.

Definition at line 1518 of file EAUtils.java.

References denoptim.programs.RunTimeParameters.containsParameters(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.programs.RunTimeParameters.getRandomizer(), denoptim.ga.Population.getXoverPartners(), denoptim.ga.Population.getXoverSites(), denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.ga.EAUtils.selectBasedOnFitness().

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pickNewCandidateGenerationMode()

static CandidateSource denoptim.ga.EAUtils.pickNewCandidateGenerationMode ( double  xoverWeight,
double  mutWeight,
double  newWeight,
Randomizer  randomizer 
)
static

Takes a decision on which CandidateSource method to use for generating a new Candidate.

The choice is made according to the weights given as arguments, and shooting a random number over a weighted score range.

Parameters
xoverWeightweight of crossover between existing population members.
mutWeightweight of mutation of existing population members.
newWeightweight of construction from scratch.
Returns
one among the possible CandidateSource excluding {@value CandidateSource::MANUAL}.

Definition at line 263 of file EAUtils.java.

References denoptim.ga.EAUtils.CandidateSource.CONSTRUCTION, denoptim.ga.EAUtils.CandidateSource.CROSSOVER, denoptim.ga.EAUtils.CandidateSource.MUTATION, and denoptim.utils.Randomizer.nextDouble().

Referenced by denoptim.ga.EAUtils.chooseGenerationMethod(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringB(), denoptim.ga.EAUtilsTest.testCandidateGenerationMethod(), and denoptim.ga.EAUtilsTest.testCandidateGenerationMethodReproducibility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCandidateFromFile()

◆ readUID()

static void denoptim.ga.EAUtils.readUID ( String  infile,
HashSet< String >  lstInchi 
) throws DENOPTIMException
staticprotected

Definition at line 2432 of file EAUtils.java.

References denoptim.io.DenoptimIO.readList().

Referenced by denoptim.ga.EAUtils.importInitialPopulation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchRingFusionSites() [1/2]

static List< List< RelatedAPPair > > denoptim.ga.EAUtils.searchRingFusionSites ( DGraph  graph,
FragmentSpace  fragSpace,
RingClosureParameters  rcParams,
boolean  projectOnSymmetricAPs,
Logger  logger,
Randomizer  rng 
) throws DENOPTIMException
static

Searches for combinations of sites suitable for ring fusion, i.e., combinations of RelatedAPPair where each such pair allows to expand a ring system by adding a fused ring resulting by connecting the two AttachmentPoints in the RelatedAPPair by a non-empty bridge. The tile of bridge can depend on the properties of the RelatedAPPair.

The set of combinations is only a sample resulting by taking random decisions that prevent combinatorial explosion.

Parameters
graphthe definition of the system to work with
projectOnSymmetricAPsuse true to impose projection onto symmetric APs (within a vertex) and onto symmetric vertexes. When this is true the result will be a list of lists, where the nested list may contain more than one item. Yet, each such item is symmetric projection of the other items.
loggera tool to deal with log messages.
rnga tool to deal with random decisions.
Returns
the list of combinations of RelatedAPPair.
Exceptions
DENOPTIMExceptionif the conversion into a molecular representation fails.

Definition at line 2527 of file EAUtils.java.

References denoptim.constants.DENOPTIMConstants.ATMPROPAPS, denoptim.constants.DENOPTIMConstants.ATMPROPVERTEXID, denoptim.ga.EAUtils.canBeUsedForRingFusion(), denoptim.graph.DGraph.clone(), denoptim.ga.EAUtils.combineRelatedAPPair(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.graph.AttachmentPoint.getID(), denoptim.utils.ManySMARTSQuery.getMatchesOfSMARTS(), denoptim.utils.ManySMARTSQuery.getMessage(), denoptim.utils.ManySMARTSQuery.getNumMatchesOfQuery(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getSymmetricAPs(), denoptim.utils.ManySMARTSQuery.hasProblems(), denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), and denoptim.ga.EAUtils.storePairsSymmetricRelations().

Here is the call graph for this function:

◆ searchRingFusionSites() [2/2]

static List< List< RelatedAPPair > > denoptim.ga.EAUtils.searchRingFusionSites ( DGraph  graph,
GAParameters  gaParams 
) throws DENOPTIMException
static

Searches for combinations of sites suitable for ring fusion, i.e., combinations of RelatedAPPair where each such pair allows to expand a ring system by adding a fused ring resulting by connecting the two AttachmentPoints in the RelatedAPPair by a non-empty bridge. The tile of bridge can depend on the properties of the RelatedAPPair.

The set of combinations is only a sample resulting by taking random decisions that prevent combinatorial explosion.

Parameters
graphthe definition of the system to work with
projectOnSymmetricAPsuse true to impose projection onto symmetric APs (within a vertex) and onto symmetric vertexes. When this is true the result will be a list of lists, where the nested list may contain more than one item. Yet, each such item is symmetric projection of the other items.
loggera tool to deal with log messages.
rnga tool to deal with random decisions.
Returns
the list of combinations of RelatedAPPair.
Exceptions
DENOPTIMExceptionif the conversion into a molecular representation fails.

Definition at line 2471 of file EAUtils.java.

References denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.Randomizer.nextBoolean(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, and denoptim.ga.EAUtils.searchRingFusionSites().

Referenced by denoptim.ga.GraphOperations.addFusedRing(), denoptim.ga.GraphOperations.performMutation(), denoptim.ga.EAUtils.searchRingFusionSites(), denoptim.ga.EAUtilsTest.testFusionSiteDetection_ImposeSymmetry(), and denoptim.ga.EAUtilsTest.testSearchForApPairsSuitableToRingFusion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectBasedOnFitness()

static Candidate[] denoptim.ga.EAUtils.selectBasedOnFitness ( List< Candidate eligibleParents,
int  number,
GAParameters  settings 
)
staticprotected

Selects a number of members from the given population.

The selection method is what specified by the configuration of the genetic algorithm (GAParameters).

Parameters
eligibleParentsthe list of candidates to chose from.
numberhow many candidate to pick.
Returns
indexes of the selected members of the given population.

Definition at line 1440 of file EAUtils.java.

References denoptim.programs.denovo.GAParameters.getMonitorFile(), denoptim.programs.denovo.GAParameters.getSelectionStrategyType(), denoptim.graph.Candidate.getUID(), denoptim.programs.RunTimeParameters.NL, denoptim.ga.SelectionHelper.performRandomSelection(), denoptim.ga.SelectionHelper.performRWS(), denoptim.ga.SelectionHelper.performSUS(), denoptim.ga.SelectionHelper.performTournamentSelection(), denoptim.programs.denovo.GAParameters.recordMateSelection, and denoptim.io.DenoptimIO.writeData().

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.EAUtils.performFBCC().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectNonScaffoldNonCapVertex()

static Vertex denoptim.ga.EAUtils.selectNonScaffoldNonCapVertex ( DGraph  g,
Randomizer  randomizer 
)
staticprotected

Chose randomly a vertex that is neither scaffold or capping group.

Definition at line 1490 of file EAUtils.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.getVertexList(), denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.graph.Vertex.BBType.SCAFFOLD.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.EAUtilsTest.testSelectNonScaffoldNonCapVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupRings()

static boolean denoptim.ga.EAUtils.setupRings ( Object[]  res,
DGraph  molGraph,
GAParameters  settings 
) throws DENOPTIMException
staticprotected

Evaluates the possibility of closing rings in a given graph and if any ring can be closed, it chooses one of the combinations of ring closures that involves the highest number of new rings.

Parameters
resan object array containing the inchi code, the smiles string and the 2D representation of the molecule. This object can be null if inchi/smiles/2D conversion fails.
molGraphthe DENOPTIMGraph on which rings are to be identified
Returns
true unless no ring can be set up even if required

Definition at line 1898 of file EAUtils.java.

References denoptim.graph.rings.RingClosureParameters.allowRingClosures(), denoptim.graph.rings.RingClosureParameters.buildChelatesMode, denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.utils.RotationalSpaceUtils.defineRotatableBonds(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbability(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.utils.MoleculeUtils.getInChIKeyForMolecule(), denoptim.graph.rings.RingClosureParameters.getMaxRingClosures(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.rings.CyclicGraphHandler.getPossibleCombinationOfRings(), denoptim.graph.rings.CyclicGraphHandler.getRandomCombinationOfRings(), denoptim.utils.MoleculeUtils.getSMILESForMolecule(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), and denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVertexCounterValue()

static void denoptim.ga.EAUtils.setVertexCounterValue ( Population  population) throws DENOPTIMException
staticprotected

Set the Vertex counter value according to the largest value found in the given population.

Parameters
populationthe collection of candidates to analyse.
Exceptions
DENOPTIMException

Definition at line 1782 of file EAUtils.java.

References denoptim.utils.GraphUtils.ensureVertexIDConsistency(), and denoptim.graph.DGraph.getMaxVertexId().

Referenced by denoptim.ga.EAUtils.getPopulationFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shareAPs()

static Boolean denoptim.ga.EAUtils.shareAPs ( RelatedAPPair  pairA,
Iterable< RelatedAPPair lstB 
)
static

Evaluates if a RelatedAPPair involves the same AttachmentPoint present in a collection.

Parameters
pairAthe pair to test.
lstBthe collection.
Returns
true if any AttachmentPoint of the given pair is present in the collection.

Definition at line 2931 of file EAUtils.java.

References denoptim.graph.RelatedAPPair.apA, and denoptim.graph.RelatedAPPair.apB.

Referenced by denoptim.ga.EAUtils.combineRelatedAPPairUtil().

Here is the caller graph for this function:

◆ storePairsSymmetricRelations()

static void denoptim.ga.EAUtils.storePairsSymmetricRelations ( RelatedAPPair  pair,
SymmetricAPs  symAPs,
Map< SymmetricSetWithMode, List< RelatedAPPair > >  storage 
)
staticprivate

Definition at line 2880 of file EAUtils.java.

References denoptim.graph.RelatedAPPair.propID.

Referenced by denoptim.ga.EAUtils.searchRingFusionSites().

Here is the caller graph for this function:

◆ writeUID()

static void denoptim.ga.EAUtils.writeUID ( String  outfile,
HashSet< String >  lstInchi,
boolean  append 
) throws DENOPTIMException
staticprotected

Definition at line 1749 of file EAUtils.java.

References denoptim.ga.EAUtils.NL, and denoptim.io.DenoptimIO.writeData().

Here is the call graph for this function:

Member Data Documentation

◆ df

DecimalFormat denoptim.ga.EAUtils.df = initialiseFormatter()
staticprivate

Format for decimal fitness numbers that overwrites Locale to en_US.

Definition at line 119 of file EAUtils.java.

Referenced by denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.ga.EAUtils.initialiseFormatter(), and denoptim.ga.EAUtils.outputPopulationDetails().

◆ enUsLocale

Locale denoptim.ga.EAUtils.enUsLocale = new Locale("en", "US")
staticprivate

Locale used to write reports.

Definition at line 114 of file EAUtils.java.

Referenced by denoptim.ga.EAUtils.initialiseFormatter().

◆ fragmentPool

HashMap<Integer, ArrayList<Integer> > denoptim.ga.EAUtils.fragmentPool
staticprotected

Definition at line 109 of file EAUtils.java.

◆ FSEP

◆ lstFragmentClass

HashMap<Integer, ArrayList<String> > denoptim.ga.EAUtils.lstFragmentClass
staticprotected

Definition at line 128 of file EAUtils.java.

◆ NL

final String denoptim.ga.EAUtils.NL =System.getProperty("line.separator")
staticprivate

The documentation for this class was generated from the following file: