19package denoptim.programs.denovo;
21import static org.junit.jupiter.api.Assertions.assertEquals;
22import static org.junit.jupiter.api.Assertions.assertFalse;
23import static org.junit.jupiter.api.Assertions.assertNotNull;
24import static org.junit.jupiter.api.Assertions.assertTrue;
25import static org.junit.jupiter.api.condition.OS.WINDOWS;
28import java.util.ArrayList;
29import java.util.logging.Level;
31import org.junit.jupiter.api.Test;
32import org.junit.jupiter.api.condition.DisabledOnOs;
33import org.junit.jupiter.api.io.TempDir;
35import denoptim.files.FileUtils;
36import denoptim.io.DenoptimIO;
37import denoptim.programs.RunTimeParameters.ParametersType;
47 private final String
SEP = System.getProperty(
"file.separator");
84 "GA-MULTISITEMUTATIONWEIGHTS=1.1,2.2 , 3.3");
86 assertEquals(3,r.length);
87 assertTrue(Math.abs(1.1-r[0]) < t);
88 assertTrue(Math.abs(2.2-r[1]) < t);
89 assertTrue(Math.abs(3.3-r[2]) < t);
92 "GA-MULTISITEMUTATIONWEIGHTS=1 2 3 4");
94 assertEquals(4,r.length);
95 assertTrue(Math.abs(1.0-r[0]) < t);
96 assertTrue(Math.abs(2.0-r[1]) < t);
97 assertTrue(Math.abs(3.0-r[2]) < t);
103 @DisabledOnOs(WINDOWS)
106 assertTrue(this.tempDir.isDirectory(),
"Should be a directory ");
109 String uniqueString =
"UNIQUESTRING@LOG";
110 int[] expectedCounts =
new int[] {0, 0, 1, 2, 3, 4, 5, 6, 6, 6};
112 for (
int i=0; i<10; i++)
115 String pathname =
tempDir.getAbsolutePath() +
SEP + i;
119 +
"VERBOSITY="+verbosity);
123 gaParams.
getLogger().log(Level.SEVERE,
"msg-severe "+uniqueString);
124 gaParams.
getLogger().log(Level.WARNING,
"msg-warning "+uniqueString);
125 gaParams.
getLogger().log(Level.INFO,
"msg-info "+uniqueString);
126 gaParams.
getLogger().log(Level.FINE,
"msg-fine "+uniqueString);
127 gaParams.
getLogger().log(Level.FINER,
"msg-finer "+uniqueString);
128 gaParams.
getLogger().log(Level.FINEST,
"msg-finest "+uniqueString);
135 for (String line : lines)
137 if (line.contains(uniqueString))
140 assertEquals(expectedCounts[i],counter);
static boolean checkExists(String fileName)
static boolean createDirectory(String fileName)
Creates a directory.
Utility methods for input/output.
static ArrayList< String > readList(String fileName)
Read list of data as text.
Logger startProgramSpecificLogger(String loggerIdentifier)
Starts a logger with the given name.
Logger getLogger()
Get the name of the program specific logger.
String getLogFilePathname()
Gets the pathname to the log file.
void readParameterLine(String line)
Parameters for genetic algorithm.
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
String getDataDirectory()
boolean mutatedGraphFailedEvalTolerant
Flag that enables the ignoring of mutated graphs that lead to a failure in the evaluation of graphs t...
double[] getMultiSiteMutationWeights()
void processParameters()
Processes currently loaded fields.
void setWorkingDirectory(String pathName)
void testYesNoTrueFalseKeyword()
void testInterpretationOfKeywords()
Identifier of the type of parameters.
GA_PARAMS
Parameters pertaining the genetic algorithm.