public class DigitalCircuitProblem extends TestCaseProblem<UnsignedInteger>
parseData()
must be used to load the desired circuit
truth table in the standard CGP .plu format.DigitalCircuitFunctions
TestCaseProblem.TestCase<U>
Constructor and Description |
---|
DigitalCircuitProblem(Resources resources)
Construct a new instance of DigitalCircuitProblem.
|
Modifier and Type | Method and Description |
---|---|
void |
evaluate(Population population)
The most important method of the problem type.
|
int |
hasPerfectSolution(Population population)
Used to assert whether a given population contains a perfect solution
to the problem.
|
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. |
addTestCase, clearTestCases, getTestCases, hasImprovement, parseProblemData
getBestFitness, getFileExtension, getFitnessOrientation, getFunctionSet, reset
getLocalParameters, toString
public DigitalCircuitProblem(Resources resources)
resources
- a reference to the experiment's resources.public void evaluate(Population population)
Problem
public TestCaseProblem.TestCase<UnsignedInteger> parseTestCase(java.lang.String[] inputs, java.lang.String[] outputs)
TestCaseProblem
addTestCase()
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 hasPerfectSolution(Population population)
Problem
hasPerfectSolution
in class Problem
population
- the population to search through for a perfect chromosome.