public class DigitalCircuitProblem extends TestCaseProblem<UnsignedInteger>
parseData() must be used to load the desired circuit
truth table in the standard CGP .plu format.DigitalCircuitFunctionsTestCaseProblem.TestCase<U>| Constructor and Description |
|---|
DigitalCircuitProblem(Resources resources)
Construct a new instance of DigitalCircuitProblem.
|
| Modifier and Type | Method and Description |
|---|---|
void |
evaluate(Population population,
Resources resources)
The most important method of the problem type.
|
int |
hasImprovement(Population population)
Used to assert whether a given population has a chromosome that is an improvement over
the current best chromosome.
|
TestCaseProblem.TestCase<UnsignedInteger> |
parseTestCase(java.lang.String[] inputs,
java.lang.String[] outputs)
This method is used internally by
addTestCase() in order
to appropriately parse strings into the right data type for the
test cases. |
int |
perfectSolutionFound(Population population)
Used to assert whether a given population contains a perfect solution
to the problem.
|
addTestCase, clearTestCases, getTestCases, parseProblemDatagetBestFitness, getFileExtension, getFitnessOrientation, getFunctionSet, resetgetLocalParameters, toStringpublic DigitalCircuitProblem(Resources resources)
resources - a reference to the experiment's resources.public void evaluate(Population population, Resources resources)
Problempublic TestCaseProblem.TestCase<UnsignedInteger> parseTestCase(java.lang.String[] inputs, java.lang.String[] outputs)
TestCaseProblemaddTestCase() in order
to appropriately parse strings into the right data type for the
test cases. Since the data type is problem-dependent, subclasses must
implement this method. This method must return a built TestCase
object from the arguments given.inputs - the inputs represented as strings.outputs - the outputs represented as strings.public int perfectSolutionFound(Population population)
ProblemperfectSolutionFound in class Problempopulation - the population to search through for a perfect chromosome.public int hasImprovement(Population population)
ProblemhasImprovement in class Problempopulation - the population potentially containing a fitter chromosome.