$darkmode
DENOPTIM
denoptim.graph.Candidate Class Reference

A candidate is the combination of a denoptim graph with molecular representation and may include also fitness/error, and possibly other stuff. More...

Inheritance diagram for denoptim.graph.Candidate:
[legend]
Collaboration diagram for denoptim.graph.Candidate:
[legend]

Public Member Functions

 Candidate ()
 
 Candidate (DGraph graph)
 
 Candidate (String name, DGraph graph)
 
 Candidate (String name, DGraph graph, double fitness, String uid, String smiles)
 
 Candidate (IAtomContainer iac, boolean useFragSpace) throws DENOPTIMException
 Builds a candidate from the SDF representation of an atom container. More...
 
 Candidate (IAtomContainer iac, boolean useFragSpace, boolean allowNoUID) throws DENOPTIMException
 Builds a candidate from the SDF representation of an atom container. More...
 
void setChemicalRepresentation (IAtomContainer iac)
 Just place the argument in the IAtomContainer field of this object. More...
 
IAtomContainer getChemicalRepresentation ()
 Returns the atom container representing this candidate. More...
 
IAtomContainer getFitnessProviderOutputRepresentation () throws DENOPTIMException
 Returns an atom container representing this item in a way that is compatible for writing this item to an SDF file. More...
 
void setComments (String str)
 
String getComments ()
 
void setSDFFile (String molFile)
 
void setImageFile (String imgFile)
 
void setGraph (DGraph graph)
 
void setUID (String uid)
 
void setSmiles (String smiles)
 
void setFitness (double fitness)
 
void setError (String error)
 
void setName (String name)
 
String getName ()
 
String getError ()
 
String getUID ()
 
String getSmiles ()
 
String getSDFFile ()
 
String getImageFile ()
 
DGraph getGraph ()
 
double getFitness ()
 
boolean hasFitness ()
 
void setGeneration (int genId)
 
int getGeneration ()
 The generation this candidate belong to is that in which it was generated. More...
 
void setLevel (int lev)
 Sets level that generated this graph in a fragment space exploration experiment. More...
 
int getLevel ()
 Returns the level that generated this graph in a fragment space exploration experiment. More...
 
int compareTo (Candidate other)
 
String toString ()
 
void cleanup ()
 Clear the graph describing this candidate. More...
 
Candidate clone ()
 

Static Public Member Functions

static Candidate fromAtomContainerNoGraph (IAtomContainer iac, boolean allowNoUID) throws DENOPTIMException
 Wraps an atom container as a candidate even if a graph is not available. More...
 

Private Member Functions

 Candidate (String name, DGraph graph, String uid, String smiles, String molFile, String imgFile, String comment, int generationId, int level)
 

Private Attributes

String uid
 Unique identifier of this candidate. More...
 
DGraph graph
 Graph representation. More...
 
IAtomContainer iac
 Chemical object representation. More...
 
String smiles
 SMILES representation. More...
 
double fitness
 fitness value More...
 
String sdfFile
 Pathname to SDF file. More...
 
String imgFile
 Pathname to an image (i.e., PNG file) More...
 
String comment
 Any comments. More...
 
String error
 Error that prevented calculation of the fitness. More...
 
boolean hasFitness
 Flag signaling the presence of a fitness value associated. More...
 
int generationId = -1
 ID of the generation at which this candidate was generated. More...
 
String name
 Name of this candidate (not guaranteed to be unique) More...
 
int level
 Level that generated this graph in fragment space exploration. More...
 

Detailed Description

A candidate is the combination of a denoptim graph with molecular representation and may include also fitness/error, and possibly other stuff.

Definition at line 39 of file Candidate.java.

Constructor & Destructor Documentation

◆ Candidate() [1/7]

denoptim.graph.Candidate.Candidate ( )

Definition at line 110 of file Candidate.java.

References denoptim.graph.Candidate.hasFitness, denoptim.graph.Candidate.name, denoptim.graph.Candidate.smiles, and denoptim.graph.Candidate.uid.

Referenced by denoptim.graph.Candidate.clone(), and denoptim.graph.Candidate.fromAtomContainerNoGraph().

Here is the caller graph for this function:

◆ Candidate() [2/7]

denoptim.graph.Candidate.Candidate ( DGraph  graph)

Definition at line 120 of file Candidate.java.

References denoptim.graph.Candidate.graph, denoptim.graph.Candidate.hasFitness, denoptim.graph.DGraph.setCandidateOwner(), denoptim.graph.Candidate.smiles, and denoptim.graph.Candidate.uid.

Here is the call graph for this function:

◆ Candidate() [3/7]

denoptim.graph.Candidate.Candidate ( String  name,
DGraph  graph 
)

Definition at line 132 of file Candidate.java.

References denoptim.graph.Candidate.graph, denoptim.graph.Candidate.hasFitness, denoptim.graph.Candidate.name, denoptim.graph.DGraph.setCandidateOwner(), denoptim.graph.Candidate.smiles, and denoptim.graph.Candidate.uid.

Here is the call graph for this function:

◆ Candidate() [4/7]

denoptim.graph.Candidate.Candidate ( String  name,
DGraph  graph,
double  fitness,
String  uid,
String  smiles 
)

Definition at line 145 of file Candidate.java.

References denoptim.graph.Candidate.fitness, denoptim.graph.Candidate.graph, denoptim.graph.Candidate.hasFitness, denoptim.graph.Candidate.name, denoptim.graph.DGraph.setCandidateOwner(), denoptim.graph.Candidate.smiles, and denoptim.graph.Candidate.uid.

Here is the call graph for this function:

◆ Candidate() [5/7]

denoptim.graph.Candidate.Candidate ( String  name,
DGraph  graph,
String  uid,
String  smiles,
String  molFile,
String  imgFile,
String  comment,
int  generationId,
int  level 
)
private

Definition at line 160 of file Candidate.java.

References denoptim.graph.Candidate.comment, denoptim.graph.Candidate.generationId, denoptim.graph.Candidate.graph, denoptim.graph.Candidate.imgFile, denoptim.graph.Candidate.level, denoptim.graph.Candidate.name, denoptim.graph.DGraph.setCandidateOwner(), denoptim.graph.Candidate.smiles, and denoptim.graph.Candidate.uid.

Here is the call graph for this function:

◆ Candidate() [6/7]

denoptim.graph.Candidate.Candidate ( IAtomContainer  iac,
boolean  useFragSpace 
) throws DENOPTIMException

Builds a candidate from the SDF representation of an atom container.

This method does interpret the properties of the atom container object and used them to define the various field values that define this candidate.

Parameters
iacthe container to read and interpret.
useFragSpaceset true to enable usage of the building block space when reading in the string-encoder graph representation of this object. Use false when a building block space is undefined and the graph representation can only be built assuming that there are as many APs as used in this graph, while other information on the graph building blocks cannot be inferred.
Exceptions
DENOPTIMException

Definition at line 193 of file Candidate.java.

References denoptim.graph.Candidate.iac.

◆ Candidate() [7/7]

denoptim.graph.Candidate.Candidate ( IAtomContainer  iac,
boolean  useFragSpace,
boolean  allowNoUID 
) throws DENOPTIMException

Builds a candidate from the SDF representation of an atom container.

This method does interpret the properties of the atom container object and used them to define the various field values that define this candidate.

Parameters
iacthe container to read and interpret.
useFragSpaceset true to enable usage of the building block space when reading in the string-encoder graph representation of this object. Use false when a building block space is undefined and the graph representation can only be built assuming that there are as many APs as used in this graph, while other information on the graph building blocks cannot be inferred.
allowNoUIDuse true to allow creation on a candidate that has no unique identifier.
Exceptions
DENOPTIMException

Definition at line 217 of file Candidate.java.

References denoptim.constants.DENOPTIMConstants.FITNESSTAG, denoptim.constants.DENOPTIMConstants.GRAPHLEVELTAG, denoptim.graph.Candidate.iac, denoptim.utils.MoleculeUtils.makeSameAs(), denoptim.constants.DENOPTIMConstants.MOLERRORTAG, denoptim.constants.DENOPTIMConstants.PROVENANCE, denoptim.io.DenoptimIO.readGraphFromSDFileIAC(), denoptim.graph.DGraph.setCandidateOwner(), denoptim.constants.DENOPTIMConstants.SMILESTAG, and denoptim.constants.DENOPTIMConstants.UNIQUEIDTAG.

Here is the call graph for this function:

Member Function Documentation

◆ cleanup()

void denoptim.graph.Candidate.cleanup ( )

Clear the graph describing this candidate.

Definition at line 670 of file Candidate.java.

References denoptim.graph.DGraph.cleanup(), and denoptim.graph.Candidate.graph.

Here is the call graph for this function:

◆ clone()

◆ compareTo()

int denoptim.graph.Candidate.compareTo ( Candidate  other)
Returns
a negative integer, 0, or a positive integer depending on whether this object is less than, equal to, or greater than the other object given as argument.

Definition at line 621 of file Candidate.java.

References denoptim.graph.Candidate.fitness, denoptim.graph.Candidate.graph, denoptim.graph.DGraph.graphId, and denoptim.graph.Candidate.hasFitness.

◆ fromAtomContainerNoGraph()

static Candidate denoptim.graph.Candidate.fromAtomContainerNoGraph ( IAtomContainer  iac,
boolean  allowNoUID 
) throws DENOPTIMException
static

Wraps an atom container as a candidate even if a graph is not available.

Essentially, this method produces a candidate that has as much info as available in the atom container, but ignores the lack of a valid graph definition.

Parameters
iacthe atom container to be wrapped.
allowNoUIDuse true to allow creation on a candidate that has no unique identifier.
Returns
a new candidate with no graph but with a molecular representation.
Exceptions
DENOPTIMExceptionif the UID is required but not found.

Definition at line 301 of file Candidate.java.

References denoptim.graph.Candidate.Candidate(), denoptim.constants.DENOPTIMConstants.FITNESSTAG, denoptim.constants.DENOPTIMConstants.GRAPHLEVELTAG, denoptim.graph.Candidate.iac, denoptim.utils.MoleculeUtils.makeSameAs(), denoptim.constants.DENOPTIMConstants.MOLERRORTAG, denoptim.constants.DENOPTIMConstants.PROVENANCE, denoptim.constants.DENOPTIMConstants.SMILESTAG, and denoptim.constants.DENOPTIMConstants.UNIQUEIDTAG.

Referenced by denoptim.gui.MoleculeViewPanel.loadChemicalStructureFromFile().

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

◆ getChemicalRepresentation()

IAtomContainer denoptim.graph.Candidate.getChemicalRepresentation ( )

Returns the atom container representing this candidate.

Returns
the atom container.

Definition at line 389 of file Candidate.java.

References denoptim.graph.Candidate.iac.

Referenced by denoptim.ga.OffspringEvaluationTask.OffspringEvaluationTask(), and denoptim.programs.moldecularmodelbuilder.MolecularModelBuilder.runProgram().

Here is the caller graph for this function:

◆ getComments()

String denoptim.graph.Candidate.getComments ( )

Definition at line 438 of file Candidate.java.

References denoptim.graph.Candidate.comment.

Referenced by denoptim.gui.MoleculeViewPanel.fillDataTable().

Here is the caller graph for this function:

◆ getError()

String denoptim.graph.Candidate.getError ( )

Definition at line 509 of file Candidate.java.

References denoptim.graph.Candidate.error.

Referenced by denoptim.ga.OffspringEvaluationTask.call(), and denoptim.gui.MoleculeViewPanel.fillDataTable().

Here is the caller graph for this function:

◆ getFitness()

double denoptim.graph.Candidate.getFitness ( )

◆ getFitnessProviderOutputRepresentation()

IAtomContainer denoptim.graph.Candidate.getFitnessProviderOutputRepresentation ( ) throws DENOPTIMException

◆ getGeneration()

int denoptim.graph.Candidate.getGeneration ( )

The generation this candidate belong to is that in which it was generated.

In asynchronous experiments, the generation at which a candidate is generated and that when it enters the population may be different.

Returns
the generation at which a candidate is generated.

Definition at line 578 of file Candidate.java.

References denoptim.graph.Candidate.generationId.

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.gui.MoleculeViewPanel.fillDataTable().

Here is the caller graph for this function:

◆ getGraph()

◆ getImageFile()

String denoptim.graph.Candidate.getImageFile ( )

Definition at line 537 of file Candidate.java.

References denoptim.graph.Candidate.imgFile.

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

Here is the caller graph for this function:

◆ getLevel()

int denoptim.graph.Candidate.getLevel ( )

Returns the level that generated this graph in a fragment space exploration experiment.

Returns
the level that generated this graph in a fragment space exploration experiment.

Definition at line 603 of file Candidate.java.

References denoptim.graph.Candidate.level.

◆ getName()

◆ getSDFFile()

String denoptim.graph.Candidate.getSDFFile ( )

Definition at line 530 of file Candidate.java.

References denoptim.graph.Candidate.sdfFile.

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.outputFinalResults(), denoptim.ga.EAUtils.outputPopulationDetails(), and denoptim.gui.MoleculeViewPanel.showPopup().

Here is the caller graph for this function:

◆ getSmiles()

String denoptim.graph.Candidate.getSmiles ( )

Definition at line 523 of file Candidate.java.

References denoptim.graph.Candidate.smiles.

Referenced by denoptim.ga.OffspringEvaluationTask.call(), and denoptim.ga.OffspringEvaluationTask.OffspringEvaluationTask().

Here is the caller graph for this function:

◆ getUID()

String denoptim.graph.Candidate.getUID ( )

Definition at line 516 of file Candidate.java.

References denoptim.graph.Candidate.uid.

Referenced by denoptim.ga.OffspringEvaluationTask.call(), denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), denoptim.gui.MoleculeViewPanel.fillDataTable(), denoptim.ga.OffspringEvaluationTask.OffspringEvaluationTask(), and denoptim.ga.EAUtils.outputPopulationDetails().

Here is the caller graph for this function:

◆ hasFitness()

boolean denoptim.graph.Candidate.hasFitness ( )

Definition at line 558 of file Candidate.java.

References denoptim.graph.Candidate.hasFitness.

◆ setChemicalRepresentation()

void denoptim.graph.Candidate.setChemicalRepresentation ( IAtomContainer  iac)

Just place the argument in the IAtomContainer field of this object.

We do not read and interpret the input argument as done in Candidate(IAtomContainer) or Candidate(IAtomContainer, boolean).

Parameters
iacnew value of IAtomContainer field

Definition at line 378 of file Candidate.java.

References denoptim.graph.Candidate.iac.

Referenced by denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.graph.Candidate.clone(), denoptim.ga.EAUtils.readCandidateFromFile(), denoptim.task.FitnessTask.runExternalFitness(), and denoptim.task.FitnessTask.runFitnessProvider().

Here is the caller graph for this function:

◆ setComments()

void denoptim.graph.Candidate.setComments ( String  str)

Definition at line 431 of file Candidate.java.

◆ setError()

void denoptim.graph.Candidate.setError ( String  error)

Definition at line 488 of file Candidate.java.

References denoptim.graph.Candidate.error.

Referenced by denoptim.graph.Candidate.clone(), denoptim.task.FitnessTask.runExternalFitness(), and denoptim.task.FitnessTask.runInternalFitness().

Here is the caller graph for this function:

◆ setFitness()

void denoptim.graph.Candidate.setFitness ( double  fitness)

◆ setGeneration()

void denoptim.graph.Candidate.setGeneration ( int  genId)

Definition at line 565 of file Candidate.java.

References denoptim.graph.Candidate.generationId.

Referenced by denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), and denoptim.io.DenoptimIO.readCandidates().

Here is the caller graph for this function:

◆ setGraph()

void denoptim.graph.Candidate.setGraph ( DGraph  graph)

Definition at line 459 of file Candidate.java.

References denoptim.graph.Candidate.graph.

Referenced by denoptim.combinatorial.GraphBuildingTask.call().

Here is the caller graph for this function:

◆ setImageFile()

void denoptim.graph.Candidate.setImageFile ( String  imgFile)

Definition at line 452 of file Candidate.java.

References denoptim.graph.Candidate.imgFile.

Referenced by denoptim.task.FitnessTask.runFitnessProvider().

Here is the caller graph for this function:

◆ setLevel()

void denoptim.graph.Candidate.setLevel ( int  lev)

Sets level that generated this graph in a fragment space exploration experiment.

Parameters
levthe level index

Definition at line 590 of file Candidate.java.

References denoptim.graph.Candidate.level.

◆ setName()

void denoptim.graph.Candidate.setName ( String  name)

◆ setSDFFile()

void denoptim.graph.Candidate.setSDFFile ( String  molFile)

Definition at line 445 of file Candidate.java.

Referenced by denoptim.ga.EAUtils.outputFinalResults(), denoptim.io.DenoptimIO.readCandidates(), denoptim.task.FitnessTask.runFitnessProvider(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().

Here is the caller graph for this function:

◆ setSmiles()

void denoptim.graph.Candidate.setSmiles ( String  smiles)

◆ setUID()

◆ toString()

String denoptim.graph.Candidate.toString ( )

Member Data Documentation

◆ comment

String denoptim.graph.Candidate.comment
private

◆ error

String denoptim.graph.Candidate.error
private

◆ fitness

◆ generationId

int denoptim.graph.Candidate.generationId = -1
private

ID of the generation at which this candidate was generated.

This may not be the generation at which this candidate entered the population!

Definition at line 95 of file Candidate.java.

Referenced by denoptim.graph.Candidate.Candidate(), denoptim.graph.Candidate.clone(), denoptim.graph.Candidate.getGeneration(), and denoptim.graph.Candidate.setGeneration().

◆ graph

◆ hasFitness

◆ iac

◆ imgFile

String denoptim.graph.Candidate.imgFile
private

◆ level

int denoptim.graph.Candidate.level
private

Level that generated this graph in fragment space exploration.

Definition at line 105 of file Candidate.java.

Referenced by denoptim.graph.Candidate.Candidate(), denoptim.graph.Candidate.clone(), denoptim.graph.Candidate.getLevel(), and denoptim.graph.Candidate.setLevel().

◆ name

◆ sdfFile

String denoptim.graph.Candidate.sdfFile
private

◆ smiles

◆ uid


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