$darkmode
DENOPTIM
|
DENOPTIM's (internal) fitness provider calculates the value of Variable
s that are used in an expression for calculating a single numerical results, i.e., the fitness.
More...
Public Member Functions | |
FitnessProvider (List< DescriptorForFitness > descriptors, String expression, Logger logger) | |
Constructs an instance that will calculate the fitness according to the given parameters. More... | |
double | getFitness (IAtomContainer iac) throws Exception |
Calculated the fitness according to the current configuration. More... | |
Protected Attributes | |
DescriptorEngine | engine |
The engine that collects and calculates descriptors. More... | |
Private Member Functions | |
double | processValue (String descName, DescriptorForFitness descriptor, IDescriptor implementation, IImplementationSpecification descSpec, DescriptorValue value, String varName, IAtomContainer iac) throws Exception |
Takes the value and checks that it is all good, then processes the value to extract the result defined by the DescriptorForFitness, puts a human-readable version in the molecular representation, and the numerical value for fitness calculation in the appropriate map. More... | |
Private Attributes | |
List< DescriptorForFitness > | descriptors |
The collection of descriptors to consider. More... | |
String | expression |
The equation used to calculate the fitness value. More... | |
Logger | logger = null |
Program-specific logger. More... | |
DENOPTIM's (internal) fitness provider calculates the value of Variable
s that are used in an expression for calculating a single numerical results, i.e., the fitness.
Each the value of each Variable
derived from the calculation of DescriptorForFitness
for a specific chemical object.
Definition at line 70 of file FitnessProvider.java.
denoptim.fitness.FitnessProvider.FitnessProvider | ( | List< DescriptorForFitness > | descriptors, |
String | expression, | ||
Logger | logger | ||
) |
Constructs an instance that will calculate the fitness according to the given parameters.
Note that the descriptors implementation instances are not the same (not same hash) than those that will be used to compute the descriptor values. This to make the descriptor calculations thread-safe. Any parameter that is set to the descriptors argument is copied into the new instances of the descriptor implementations.
descriptors | the list of descriptors to calculate in order to calculate the fitness value |
expression | the string defining in expression-language format the mathematical formulation used to calculate the fitness from the descriptor values. |
Definition at line 109 of file FitnessProvider.java.
References denoptim.fitness.DescriptorForFitness.cloneAllButImpl(), denoptim.fitness.FitnessProvider.descriptors, denoptim.fitness.FitnessProvider.engine, denoptim.fitness.FitnessProvider.expression, denoptim.fitness.DescriptorForFitness.getClassName(), and denoptim.fitness.FitnessProvider.logger.
double denoptim.fitness.FitnessProvider.getFitness | ( | IAtomContainer | iac | ) | throws Exception |
Calculated the fitness according to the current configuration.
The values of the descriptors, as well as the fitness value, are added to the properties of the atom container.
iac | the chemical object to evaluate. |
Exception | if an error occurs during calculation of the descriptor or any initial configuration was missing/wrong. |
Definition at line 164 of file FitnessProvider.java.
References denoptim.fitness.FitnessProvider.descriptors, denoptim.constants.DENOPTIMConstants.DUMMYATMSYMBOL, denoptim.fitness.FitnessProvider.engine, denoptim.fitness.FitnessProvider.expression, denoptim.constants.DENOPTIMConstants.FITNESSTAG, denoptim.utils.ManySMARTSQuery.getAllMatches(), denoptim.utils.ManySMARTSQuery.getMessage(), denoptim.utils.ManySMARTSQuery.getProblem(), denoptim.fitness.DescriptorForFitness.getVariables(), denoptim.utils.ManySMARTSQuery.hasProblems(), denoptim.fitness.FitnessProvider.logger, denoptim.utils.MathUtils.mean(), denoptim.fitness.FitnessProvider.processValue(), denoptim.utils.DummyAtomHandler.removeDummy(), denoptim.utils.DummyAtomHandler.removeDummyInHapto(), and denoptim.fitness.DescriptorForFitness.shortName.
Referenced by denoptim.task.FitnessTask.runInternalFitness(), denoptim.fitness.FitnessProviderTest.testGetConstantFitness(), denoptim.fitness.FitnessProviderTest.testGetFitness(), denoptim.fitness.FitnessProviderTest.testGetFitnessWithCustomDescriptors(), and denoptim.fitness.FitnessProviderTest.testGetFitnessWithParametrizedDescriptors().
|
private |
Takes the value and checks that it is all good, then processes the value to extract the result defined by the DescriptorForFitness, puts a human-readable version in the molecular representation, and the numerical value for fitness calculation in the appropriate map.
Exception |
Definition at line 491 of file FitnessProvider.java.
Referenced by denoptim.fitness.FitnessProvider.getFitness().
|
private |
The collection of descriptors to consider.
Definition at line 80 of file FitnessProvider.java.
Referenced by denoptim.fitness.FitnessProvider.FitnessProvider(), and denoptim.fitness.FitnessProvider.getFitness().
|
protected |
The engine that collects and calculates descriptors.
Definition at line 75 of file FitnessProvider.java.
Referenced by denoptim.fitness.FitnessProvider.FitnessProvider(), denoptim.fitness.FitnessProvider.getFitness(), and denoptim.fitness.FitnessProviderTest.testConfigureDescriptorsList().
|
private |
The equation used to calculate the fitness value.
Definition at line 85 of file FitnessProvider.java.
Referenced by denoptim.fitness.FitnessProvider.FitnessProvider(), and denoptim.fitness.FitnessProvider.getFitness().
|
private |
Program-specific logger.
Definition at line 90 of file FitnessProvider.java.
Referenced by denoptim.fitness.FitnessProvider.FitnessProvider(), and denoptim.fitness.FitnessProvider.getFitness().