$darkmode
DENOPTIM
denoptim.fitness.FitnessExpressionParser Class Reference

Class parsing fitness expression by means of Expression Language. More...

Collaboration diagram for denoptim.fitness.FitnessExpressionParser:
[legend]

Classes

class  CustomVariableDefiningContext
 In this context we only need to know that "Variable" is mapped to the class Variable. More...
 
class  VariableDefiningContext
 This is the context on which we read a fitness expression, and parse it to identify all variables in the expression. More...
 

Public Member Functions

 FitnessExpressionParser ()
 Creates a new parser. More...
 
void parse (String fitnessExpression, List< String > customVarDescExpressions) throws DENOPTIMException
 Parses the given expressions. More...
 
List< VariablegetVariables ()
 Returns the list of variables in the expression of the fitness. More...
 
List< DescriptorForFitnessgetDescriptors ()
 Returns the list of descriptors needed to compute the numerical values of the variables in the expression of the fitness. More...
 

Private Member Functions

String[] makeStringArray (String line) throws DENOPTIMException
 
IBitFingerprint makeIBitFingerprintBySubstructure (String line, String[] smarts) throws DENOPTIMException
 For now we only accept a filename from which we read in a molecule. More...
 
IBitFingerprint makeIBitFingerprint (String line, IFingerprinter fingerprinter) throws DENOPTIMException
 For now we only accept a filename from which we read in a molecule. More...
 
IFingerprinter makeIFingerprinter (String classShortName) throws DENOPTIMException
 

Private Attributes

List< Variablevariables = new ArrayList<Variable>()
 List of variables used in the calculation of the fitness. 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...
 

Detailed Description

Class parsing fitness expression by means of Expression Language.

Definition at line 54 of file FitnessExpressionParser.java.

Constructor & Destructor Documentation

◆ FitnessExpressionParser()

denoptim.fitness.FitnessExpressionParser.FitnessExpressionParser ( )

Creates a new parser.

Definition at line 75 of file FitnessExpressionParser.java.

Member Function Documentation

◆ getDescriptors()

List< DescriptorForFitness > denoptim.fitness.FitnessExpressionParser.getDescriptors ( )

Returns the list of descriptors needed to compute the numerical values of the variables in the expression of the fitness.

Returns
the list of descriptors needed to calculate the numerical values of the variables in the expression of the fitness.

Definition at line 624 of file FitnessExpressionParser.java.

References denoptim.fitness.FitnessExpressionParser.descriptors.

Referenced by denoptim.fitness.FitnessParameters.processParameters().

Here is the caller graph for this function:

◆ getVariables()

List< Variable > denoptim.fitness.FitnessExpressionParser.getVariables ( )

Returns the list of variables in the expression of the fitness.

Returns
the list of variables in the expression of the fitness.

Definition at line 611 of file FitnessExpressionParser.java.

References denoptim.fitness.FitnessExpressionParser.variables.

◆ makeIBitFingerprint()

IBitFingerprint denoptim.fitness.FitnessExpressionParser.makeIBitFingerprint ( String  line,
IFingerprinter  fingerprinter 
) throws DENOPTIMException
private

For now we only accept a filename from which we read in a molecule.

Exceptions
DENOPTIMException

Definition at line 540 of file FitnessExpressionParser.java.

References denoptim.io.DenoptimIO.readAllAtomContainers().

Referenced by denoptim.fitness.FitnessExpressionParser.makeIBitFingerprintBySubstructure(), and denoptim.fitness.FitnessExpressionParser.parse().

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

◆ makeIBitFingerprintBySubstructure()

IBitFingerprint denoptim.fitness.FitnessExpressionParser.makeIBitFingerprintBySubstructure ( String  line,
String[]  smarts 
) throws DENOPTIMException
private

For now we only accept a filename from which we read in a molecule.

Exceptions
DENOPTIMException

Definition at line 527 of file FitnessExpressionParser.java.

References denoptim.fitness.FitnessExpressionParser.makeIBitFingerprint().

Referenced by denoptim.fitness.FitnessExpressionParser.parse().

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

◆ makeIFingerprinter()

IFingerprinter denoptim.fitness.FitnessExpressionParser.makeIFingerprinter ( String  classShortName) throws DENOPTIMException
private

Definition at line 590 of file FitnessExpressionParser.java.

References denoptim.fitness.descriptors.TanimotoMolSimilarity.makeIFingerprinter().

Referenced by denoptim.fitness.FitnessExpressionParser.parse().

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

◆ makeStringArray()

String[] denoptim.fitness.FitnessExpressionParser.makeStringArray ( String  line) throws DENOPTIMException
private

Definition at line 501 of file FitnessExpressionParser.java.

References denoptim.io.DenoptimIO.readList().

Referenced by denoptim.fitness.FitnessExpressionParser.parse().

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

◆ parse()

void denoptim.fitness.FitnessExpressionParser.parse ( String  fitnessExpression,
List< String >  customVarDescExpressions 
) throws DENOPTIMException

Parses the given expressions.

Since the value obtained from the calculation of each single descriptor can be used for multiple purposes (i.e., as a proper descriptor and as a component used to calculate the value of more than one variable) we collect the descriptors and record the relation between each descriptor and any variables that depend on it.

Parameters
fitnessExpressionthe expression defining how to calculate the fitness from named variables.
customVarDescExpressionsthe collection of functions defining how to calculate the numerical value of the variables. Any variable that is not defined in this list is assumes to correspond to the value that is calculated by a descriptor implementation reachable in the classpath and offering a descriptor value named after the variable name. E.g., if the fitness expression contains Zagreb, we assume that the descriptor Zagreb can be calculated by a IDescriptor implementation visible in the class path.
Exceptions
DENOPTIMException

Definition at line 100 of file FitnessExpressionParser.java.

References denoptim.fitness.DescriptorForFitness.addDependentVariable(), denoptim.fitness.FitnessExpressionParser.descriptors, denoptim.fitness.DescriptorUtils.findAllDescriptorImplementations(), denoptim.fitness.Variable.getDescriptorName(), denoptim.fitness.Variable.getName(), denoptim.fitness.DescriptorForFitness.getShortName(), denoptim.fitness.DescriptorForFitness.implementation, denoptim.fitness.DescriptorForFitness.makeCopy(), denoptim.fitness.FitnessExpressionParser.makeIBitFingerprint(), denoptim.fitness.FitnessExpressionParser.makeIBitFingerprintBySubstructure(), denoptim.fitness.FitnessExpressionParser.makeIFingerprinter(), denoptim.fitness.FitnessExpressionParser.makeStringArray(), denoptim.fitness.Variable.params, and denoptim.fitness.FitnessExpressionParser.variables.

Referenced by denoptim.fitness.FitnessParameters.processParameters().

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

Member Data Documentation

◆ descriptors

List<DescriptorForFitness> denoptim.fitness.FitnessExpressionParser.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 67 of file FitnessExpressionParser.java.

Referenced by denoptim.fitness.FitnessExpressionParser.getDescriptors(), and denoptim.fitness.FitnessExpressionParser.parse().

◆ variables

List<Variable> denoptim.fitness.FitnessExpressionParser.variables = new ArrayList<Variable>()
private

List of variables used in the calculation of the fitness.

For instance, atom/bond specific descriptors, and custom parameterized descriptors.

Definition at line 61 of file FitnessExpressionParser.java.

Referenced by denoptim.fitness.FitnessExpressionParser.getVariables(), and denoptim.fitness.FitnessExpressionParser.parse().


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