$darkmode
DENOPTIM
denoptim.fitness.FitnessParameters Class Reference

Settings defining the calculation of fitness. More...

Inheritance diagram for denoptim.fitness.FitnessParameters:
[legend]
Collaboration diagram for denoptim.fitness.FitnessParameters:
[legend]

Public Member Functions

 FitnessParameters ()
 Constructor. More...
 
boolean useExternalFitness ()
 
boolean makePictures ()
 
boolean make3dTree ()
 
boolean checkPreFitnessUID ()
 
String getExternalFitnessProvider ()
 Gets the pathname of the external executable file. More...
 
String getExternalFitnessProviderInterpreter ()
 Gets the interpreter used to run the external fitness provider. More...
 
String getFitnessExpression ()
 
List< DescriptorForFitnessgetDescriptors ()
 
void interpretKeyword (String key, String value) throws DENOPTIMException
 Processes a keyword/value pair and assign the related parameters. More...
 
void checkParameters () throws DENOPTIMException
 Evaluate consistency of input parameters. More...
 
void processParameters () throws DENOPTIMException
 Processes all parameters and initialize related objects. More...
 
String getPrintedList ()
 Returns the list of parameters in a string with newline characters as delimiters. More...
 
boolean writeCandidatesOnDisk ()
 
- Public Member Functions inherited from denoptim.programs.RunTimeParameters
 RunTimeParameters (ParametersType paramType)
 Constructor. More...
 
String paramTypeName ()
 Returns a string defining the type the parameters collected here. More...
 
String getWorkDirectory ()
 Gets the pathname to the working directory. More...
 
void setWorkDirectory (String pathname)
 Gets the pathname to the working directory. More...
 
String getLogFilePathname ()
 Gets the pathname to the log file. More...
 
void setLogFilePathname (String pathname)
 Sets the pathname to the log file. More...
 
Logger getLogger ()
 Get the name of the program specific logger. More...
 
Logger startProgramSpecificLogger (String loggerIdentifier) throws SecurityException, IOException
 Starts a logger with the given name. More...
 
Logger startProgramSpecificLogger (String loggerIdentifier, boolean toLogFile) throws SecurityException, IOException
 Starts a logger with the given name. More...
 
Logger startConsoleLogger (String loggerIdentifier)
 Starts a program-specific logger that prints to System.err stream. More...
 
int getVerbosity ()
 Returns the level of verbosity, i.e., the amount of log that we want to print. More...
 
void setVerbosity (int l)
 Set the level of verbosity. More...
 
Randomizer getRandomizer ()
 Returns the current program-specific randomizer. More...
 
long getRandomSeed ()
 Returns the seed. More...
 
void setRandomizer (Randomizer rng)
 Sets the randomizer. More...
 
Randomizer startRandomizer ()
 Starts a program specific randomizer, i.e., a tool for generating random numbers and taking random decisions. More...
 
Randomizer startRandomizer (long seed)
 Starts a program specific randomizer, i.e., a tool for generating random numbers and taking random decisions. More...
 
void readParameterFile (String infile) throws DENOPTIMException
 Read the parameter TXT file line by line and interpret its content. More...
 
void readParameterLine (String line) throws DENOPTIMException
 
boolean containsParameters (ParametersType type)
 
RunTimeParameters getParameters (ParametersType type)
 
void setParameters (RunTimeParameters otherParams)
 
void interpretKeyword (String line) throws DENOPTIMException
 Processes a string looking for keyword and a possibly associated value. More...
 
abstract void interpretKeyword (String key, String value) throws DENOPTIMException
 Processes a keyword/value pair and assign the related parameters. More...
 
abstract void checkParameters () throws DENOPTIMException
 Evaluate consistency of input parameters. More...
 
abstract void processParameters () throws DENOPTIMException
 Processes all parameters and initialize related objects. More...
 
abstract String getPrintedList ()
 Returns the list of parameters in a string with newline characters as delimiters. More...
 
void printParameters ()
 Print all parameters. More...
 

Private Attributes

boolean useExternalFitness = true
 Flag indication we want to use external fitness provider. More...
 
String externalExe = ""
 Pathname of an external fitness provider executable. More...
 
String interpreterExternalExe = "bash"
 Interpreter for the external fitness provider. More...
 
String fitnessExpression = ""
 Formulation of the internally provided fitness. More...
 
List< String > customVarDescExpressions
 List of custom variable definitions read from input. More...
 
List< DescriptorForFitnessdescriptors
 The list of descriptors needed to calculate the variables that are used to calculate the fitness with the internal fitness provider. More...
 
boolean makePictures = false
 Flag controlling production of png graphics for each candidate. More...
 
boolean make3DTrees = true
 Flag requesting the generation of a 3d-tree model instead of a plain collection of 3d building blocks. More...
 
boolean checkPreFitnessUID = true
 Flag requesting to test for uniqueness of a candidate based on the unique identifier (UID) generated by conversion of the graph into a molecular entity. More...
 
boolean checkPreFitnessUIDFromInput = false
 Flag recording that we have explicitly expressed the choice of checkPreFitnessUID. More...
 
boolean writeCandidatesOnDisk = true
 Flag requesting to write a file that collects all info on an evaluated candidate, i.e., the "FIT" file, even in case of internal fitness. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from denoptim.programs.RunTimeParameters
static boolean readYesNoTrueFalse (String s)
 Reads a string searching for any common way to say either yes/true (including shorthand t/y) or no/false (including shorthand f/n either). More...
 
- Public Attributes inherited from denoptim.programs.RunTimeParameters
final String NL = System.getProperty("line.separator")
 New line character. More...
 
- Protected Member Functions inherited from denoptim.programs.RunTimeParameters
void checkOtherParameters () throws DENOPTIMException
 Checks any of the parameter collections contained in this instance. More...
 
void processOtherParameters () throws DENOPTIMException
 Processes any of the parameter collections contained in this instance. More...
 
void ensureFileExistsIfSet (String pathname)
 Ensures a pathname is not empty nor null and that it does lead to an existing file or triggers an error. More...
 
void ensureFileExists (String pathname)
 Ensures a pathname does lead to an existing file or triggers an error. More...
 
void ensureNotNull (String paramName, String param, String paramKey)
 Ensures that a parameter is not null or triggers an error. More...
 
void ensureIsPositive (String paramName, int value, String paramKey)
 Ensures that a parameter is a positive number (x>=0) or triggers an error. More...
 
void ensureIsPositiveOrZero (String paramName, int value, String paramKey)
 Ensures that a parameter is a positive number (x>=0) or triggers an error. More...
 
void ensureInRange (String paramName, int value, int min, int max, String paramKey)
 Ensures that a parameter is within a range or triggers an error. More...
 
- Protected Attributes inherited from denoptim.programs.RunTimeParameters
boolean isMaster = true
 Flag signaling this is the master collection of parameters. More...
 
String workDir = System.getProperty("user.dir")
 Working directory. More...
 
String logFile = "unset"
 Log file. More...
 
int verbosity = 0
 Verbosity level for logger. More...
 
Map< ParametersType, RunTimeParametersotherParameters
 Collection of other parameters by type. More...
 

Detailed Description

Settings defining the calculation of fitness.

Author
Marco Foscato

Definition at line 35 of file FitnessParameters.java.

Constructor & Destructor Documentation

◆ FitnessParameters()

denoptim.fitness.FitnessParameters.FitnessParameters ( )

Member Function Documentation

◆ checkParameters()

void denoptim.fitness.FitnessParameters.checkParameters ( ) throws DENOPTIMException

Evaluate consistency of input parameters.

Exceptions
DENOPTIMException

Reimplemented from denoptim.programs.RunTimeParameters.

Definition at line 259 of file FitnessParameters.java.

References denoptim.files.FileUtils.checkExists(), denoptim.programs.RunTimeParameters.checkOtherParameters(), and denoptim.fitness.FitnessParameters.externalExe.

Here is the call graph for this function:

◆ checkPreFitnessUID()

boolean denoptim.fitness.FitnessParameters.checkPreFitnessUID ( )
Returns
true if we want to check the unique identifier (UID) of candidates prior to submitting them to the fitness provider.

Definition at line 161 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.checkPreFitnessUID.

◆ getDescriptors()

List< DescriptorForFitness > denoptim.fitness.FitnessParameters.getDescriptors ( )
Returns
list of descriptors needed to calculate the fitness

Definition at line 204 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.descriptors.

Referenced by denoptim.task.FitnessTask.runInternalFitness(), denoptim.fitness.FitnessProviderTest.testGetConstantFitness(), denoptim.fitness.FitnessProviderTest.testGetFitnessWithParametrizedDescriptors(), and denoptim.fitness.FitnessExpressionParserTest.testProcessExpressions().

Here is the caller graph for this function:

◆ getExternalFitnessProvider()

String denoptim.fitness.FitnessParameters.getExternalFitnessProvider ( )

Gets the pathname of the external executable file.

Returns
the pathname to the external fitness provider.

Definition at line 172 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.externalExe.

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

Here is the caller graph for this function:

◆ getExternalFitnessProviderInterpreter()

String denoptim.fitness.FitnessParameters.getExternalFitnessProviderInterpreter ( )

Gets the interpreter used to run the external fitness provider.

Returns
the interpreter name.

Definition at line 183 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.interpreterExternalExe.

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

Here is the caller graph for this function:

◆ getFitnessExpression()

String denoptim.fitness.FitnessParameters.getFitnessExpression ( )
Returns
the expression used to calculate the fitness with the internal fitness provider

Definition at line 194 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.fitnessExpression.

Referenced by denoptim.task.FitnessTask.runInternalFitness(), denoptim.fitness.FitnessProviderTest.testGetConstantFitness(), and denoptim.fitness.FitnessProviderTest.testGetFitnessWithParametrizedDescriptors().

Here is the caller graph for this function:

◆ getPrintedList()

String denoptim.fitness.FitnessParameters.getPrintedList ( )

Returns the list of parameters in a string with newline characters as delimiters.

Returns
the list of parameters in a string with newline characters as delimiters.

Reimplemented from denoptim.programs.RunTimeParameters.

Definition at line 295 of file FitnessParameters.java.

References denoptim.programs.RunTimeParameters.NL, denoptim.programs.RunTimeParameters.otherParameters, and denoptim.programs.RunTimeParameters.paramTypeName().

Here is the call graph for this function:

◆ interpretKeyword()

void denoptim.fitness.FitnessParameters.interpretKeyword ( String  key,
String  value 
) throws DENOPTIMException

Processes a keyword/value pair and assign the related parameters.

Parameters
keythe keyword as string
valuethe value as a string
Exceptions
DENOPTIMExceptionis the parameter cannot be configured from the given value.

Reimplemented from denoptim.programs.RunTimeParameters.

Definition at line 211 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.checkPreFitnessUID, denoptim.fitness.FitnessParameters.checkPreFitnessUIDFromInput, denoptim.fitness.FitnessParameters.customVarDescExpressions, denoptim.fitness.FitnessParameters.externalExe, denoptim.fitness.FitnessParameters.fitnessExpression, denoptim.fitness.FitnessParameters.interpreterExternalExe, denoptim.fitness.FitnessParameters.make3DTrees, denoptim.fitness.FitnessParameters.makePictures, denoptim.programs.RunTimeParameters.readYesNoTrueFalse(), denoptim.fitness.FitnessParameters.useExternalFitness, and denoptim.fitness.FitnessParameters.writeCandidatesOnDisk.

Referenced by denoptim.fitness.FitnessProviderTest.testGetConstantFitness(), denoptim.fitness.FitnessProviderTest.testGetFitnessWithParametrizedDescriptors(), and denoptim.fitness.FitnessExpressionParserTest.testProcessExpressions().

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

◆ make3dTree()

boolean denoptim.fitness.FitnessParameters.make3dTree ( )
Returns
true if we are asked to make a tree-like 3d molecular model prior fitness evaluation. The model is built by aligning 3d-building blocks to the attachment point vectors, so there is no energy refinement.

Definition at line 150 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.make3DTrees.

Referenced by denoptim.combinatorial.GraphBuildingTask.call(), denoptim.ga.OffspringEvaluationTask.call(), and denoptim.programs.fitnessevaluator.FitnessEvaluationTask.call().

Here is the caller graph for this function:

◆ makePictures()

boolean denoptim.fitness.FitnessParameters.makePictures ( )
Returns
true if generation of the candidate's picture is required.

Definition at line 137 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.makePictures.

◆ processParameters()

void denoptim.fitness.FitnessParameters.processParameters ( ) throws DENOPTIMException

◆ useExternalFitness()

boolean denoptim.fitness.FitnessParameters.useExternalFitness ( )
Returns
true if we are asked to execute an external fitness provider.

Definition at line 126 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.useExternalFitness.

◆ writeCandidatesOnDisk()

boolean denoptim.fitness.FitnessParameters.writeCandidatesOnDisk ( )
Returns
true if we are asked to write on disk every candidate that has been evaluated.

Definition at line 326 of file FitnessParameters.java.

References denoptim.fitness.FitnessParameters.writeCandidatesOnDisk.

Member Data Documentation

◆ checkPreFitnessUID

boolean denoptim.fitness.FitnessParameters.checkPreFitnessUID = true
private

Flag requesting to test for uniqueness of a candidate based on the unique identifier (UID) generated by conversion of the graph into a molecular entity.

Definition at line 92 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.checkPreFitnessUID(), denoptim.fitness.FitnessParameters.interpretKeyword(), and denoptim.fitness.FitnessParameters.processParameters().

◆ checkPreFitnessUIDFromInput

boolean denoptim.fitness.FitnessParameters.checkPreFitnessUIDFromInput = false
private

Flag recording that we have explicitly expressed the choice of checkPreFitnessUID.

Definition at line 98 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.interpretKeyword(), and denoptim.fitness.FitnessParameters.processParameters().

◆ customVarDescExpressions

List<String> denoptim.fitness.FitnessParameters.customVarDescExpressions
private
Initial value:
=
new ArrayList<String>()

List of custom variable definitions read from input.

These lines are the definition of atom/bond specific descriptors, and custom parametrised descriptors.

Definition at line 62 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.interpretKeyword(), and denoptim.fitness.FitnessParameters.processParameters().

◆ descriptors

List<DescriptorForFitness> denoptim.fitness.FitnessParameters.descriptors
private
Initial value:
=
new ArrayList<DescriptorForFitness>()

The list of descriptors needed to calculate the variables that are used to calculate the fitness with the internal fitness provider.

Definition at line 69 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.getDescriptors(), and denoptim.fitness.FitnessParameters.processParameters().

◆ externalExe

String denoptim.fitness.FitnessParameters.externalExe = ""
private

◆ fitnessExpression

String denoptim.fitness.FitnessParameters.fitnessExpression = ""
private

◆ interpreterExternalExe

String denoptim.fitness.FitnessParameters.interpreterExternalExe = "bash"
private

◆ make3DTrees

boolean denoptim.fitness.FitnessParameters.make3DTrees = true
private

Flag requesting the generation of a 3d-tree model instead of a plain collection of 3d building blocks.

In the latter, the coordinated of each fragment are not changed when building the molecular representation that is sent to the fitness provider. Setting this to true asks for roto-translation of each fragment, but does not perform any energy-driven refinement of the geometry.

Definition at line 85 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.interpretKeyword(), and denoptim.fitness.FitnessParameters.make3dTree().

◆ makePictures

boolean denoptim.fitness.FitnessParameters.makePictures = false
private

Flag controlling production of png graphics for each candidate.

Definition at line 75 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.interpretKeyword(), denoptim.fitness.FitnessParameters.makePictures(), and denoptim.task.FitnessTask.runFitnessProvider().

◆ useExternalFitness

boolean denoptim.fitness.FitnessParameters.useExternalFitness = true
private

◆ writeCandidatesOnDisk

boolean denoptim.fitness.FitnessParameters.writeCandidatesOnDisk = true
private

Flag requesting to write a file that collects all info on an evaluated candidate, i.e., the "FIT" file, even in case of internal fitness.

When this is true, we write one file for each evaluated candidate. Note that in case of external fitness provider this file is created by the external fitness provider and this flag has no effect.

Definition at line 107 of file FitnessParameters.java.

Referenced by denoptim.fitness.FitnessParameters.interpretKeyword(), denoptim.task.FitnessTask.runFitnessProvider(), and denoptim.fitness.FitnessParameters.writeCandidatesOnDisk().


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