19package denoptim.fitness;
21import java.lang.reflect.Field;
22import java.util.ArrayList;
25import denoptim.exception.DENOPTIMException;
26import denoptim.files.FileUtils;
27import denoptim.programs.RunTimeParameters;
63 new ArrayList<String>();
70 new ArrayList<DescriptorForFitness>();
214 switch (key.toUpperCase())
229 case "DESCRIPTORSPECS=":
237 case "NO3DTREEMODEL":
241 case "DONTWRITECANDIDATESONDISK":
245 case "CHECKUIDBEFOREFITNESS=":
251 msg =
"Keyword " + key +
" is not a known fitness-related "
252 +
"keyword. Check input files.";
265 msg =
"Cannot find the fitness provider: " +
externalExe;
297 StringBuilder sb =
new StringBuilder(1024);
299 for (Field f : this.getClass().getDeclaredFields())
303 sb.append(f.getName()).append(
" = ").append(
304 f.get(
this)).append(
NL);
309 +
" parameters. Cause: " + t);
315 sb.append(otherCollector.getPrintedList());
317 return sb.toString();
static boolean checkExists(String fileName)
Class parsing fitness expression by means of Expression Language.
List< DescriptorForFitness > getDescriptors()
Returns the list of descriptors needed to compute the numerical values of the variables in the expres...
void parse(String fitnessExpression, List< String > customVarDescExpressions)
Parses the given expressions.
Settings defining the calculation of fitness.
String fitnessExpression
Formulation of the internally provided fitness.
String getExternalFitnessProvider()
Gets the pathname of the external executable file.
boolean make3DTrees
Flag requesting the generation of a 3d-tree model instead of a plain collection of 3d building blocks...
void processParameters()
Processes all parameters and initialize related objects.
boolean checkPreFitnessUIDFromInput
Flag recording that we have explicitly expressed the choice of checkPreFitnessUID.
String getExternalFitnessProviderInterpreter()
Gets the interpreter used to run the external fitness provider.
boolean checkPreFitnessUID()
boolean useExternalFitness
Flag indication we want to use external fitness provider.
String externalExe
Pathname of an external fitness provider executable.
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
List< String > customVarDescExpressions
List of custom variable definitions read from input.
String getFitnessExpression()
boolean checkPreFitnessUID
Flag requesting to test for uniqueness of a candidate based on the unique identifier (UID) generated ...
List< DescriptorForFitness > getDescriptors()
String interpreterExternalExe
Interpreter for the external fitness provider.
FitnessParameters()
Constructor.
boolean makePictures
Flag controlling production of png graphics for each candidate.
boolean writeCandidatesOnDisk
Flag requesting to write a file that collects all info on an evaluated candidate, i....
void checkParameters()
Evaluate consistency of input parameters.
List< DescriptorForFitness > descriptors
The list of descriptors needed to calculate the variables that are used to calculate the fitness with...
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
boolean useExternalFitness()
boolean writeCandidatesOnDisk()
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
static boolean readYesNoTrueFalse(String s)
Reads a string searching for any common way to say either yes/true (including shorthand t/y) or no/fa...
String paramTypeName()
Returns a string defining the type the parameters collected here.
void checkOtherParameters()
Checks any of the parameter collections contained in this instance.
final String NL
New line character.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
Identifier of the type of parameters.
FIT_PARAMS
Parameters pertaining the calculation of fitness (i.e., the fitness provider).