T - the data type to be used by the TestCaseProblem.public abstract class TestCaseProblem<T> extends Problem
TestCaseProblem
must simply override parseTestCase() to convert parsed
problem data strings into the required data type (T).Problem| Modifier and Type | Class and Description |
|---|---|
static class |
TestCaseProblem.TestCase<U>
Basic data type for encapsulating test cases, it simply
contains arrays of inputs and outputs and associated getters.
|
| Constructor and Description |
|---|
TestCaseProblem(Resources resources)
Creates a new TestCaseProblem object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTestCase(java.lang.String[] inputs,
java.lang.String[] outputs)
Adds test cases to the problem instance as they get parsed from a
problem data file.
|
void |
clearTestCases()
Remove all test cases.
|
javafx.collections.ObservableList<TestCaseProblem.TestCase<T>> |
getTestCases() |
void |
parseProblemData(java.io.File file,
ModifiableResources resources)
Parses the specified file and uses the parsed data to
set up the problem type instance appropriately.
|
evaluate, getBestFitness, getFileExtension, getFitnessOrientation, getFunctionSet, hasImprovement, perfectSolutionFound, resetgetLocalParameters, toStringpublic TestCaseProblem(Resources resources)
resources - a reference to the experiment's resources.public javafx.collections.ObservableList<TestCaseProblem.TestCase<T>> getTestCases()
public final void addTestCase(java.lang.String[] inputs,
java.lang.String[] outputs)
parseTestCase, which
must be implemented by subclasses.inputs - the inputs represented as strings.outputs - the outputs represented as strings.public void clearTestCases()
public void parseProblemData(java.io.File file,
ModifiableResources resources)
ProblemModifiableResources
instance.
parseProblemData in class Problemfile - the data file to parse.resources - a modifiable reference to the experiment's resources.