public class OnemaxProblem extends AbstractOnemaxProblem<BinaryRepresentation>
Constructor and Description |
---|
OnemaxProblem(int size)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
crossover(BinaryRepresentation r1,
BinaryRepresentation r2,
java.util.BitSet n)
Epigenetic crossover of two solutions.
|
BinaryRepresentation |
generateSolution()
Generate a new solution of the Problem.
|
void |
methilate(BinaryRepresentation r,
java.util.BitSet n,
float eprobability)
Epigenetic methilation of a solution.
|
void |
save(BinaryRepresentation representation,
java.lang.String file)
Saves the problem representation to a file.
|
compare, toString
getEvaluations, getFitness, getSize, isBetter
public OnemaxProblem(int size)
size
- the problem sizepublic void crossover(BinaryRepresentation r1, BinaryRepresentation r2, java.util.BitSet n)
Problem
crossover
in class Problem<BinaryRepresentation>
r1
- the representation of the first solutionr2
- the representation of the second solutionn
- the nucleosome vectorpublic void methilate(BinaryRepresentation r, java.util.BitSet n, float eprobability)
Problem
methilate
in class Problem<BinaryRepresentation>
r
- the representation of the solutionn
- the nucleosome vectoreprobability
- the epigenetic probabilitypublic BinaryRepresentation generateSolution()
Problem
generateSolution
in class Problem<BinaryRepresentation>
public void save(BinaryRepresentation representation, java.lang.String file) throws java.io.FileNotFoundException
Problem
save
in class Problem<BinaryRepresentation>
representation
- the representationfile
- the filenamejava.io.FileNotFoundException
- If the file cannot be saved