public class IntmaxProblem extends Problem<IntegerRepresentation>
Constructor and Description |
---|
IntmaxProblem(int size,
int min,
int max)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(double d1,
double d2)
Comparator which defines if it's a minimization or maximization problem.
|
void |
crossover(IntegerRepresentation r1,
IntegerRepresentation r2,
java.util.BitSet n)
Epigenetic crossover of two solutions.
|
IntegerRepresentation |
generateSolution()
Generate a new solution of the Problem.
|
void |
methilate(IntegerRepresentation r,
java.util.BitSet n,
float eprobability)
Epigenetic methilation of a solution.
|
void |
save(IntegerRepresentation representation,
java.lang.String file)
Saves the problem representation to a file.
|
java.lang.String |
toString()
Returns the String representation of the Problem
|
getEvaluations, getFitness, getSize, isBetter
public IntmaxProblem(int size, int min, int max) throws EpigeneticException
size
- the problem sizemin
- the minimum allowed integermax
- the maximum allowed integerEpigeneticException
- if something goes wrongpublic java.lang.String toString()
Problem
toString
in class Problem<IntegerRepresentation>
public void crossover(IntegerRepresentation r1, IntegerRepresentation r2, java.util.BitSet n)
Problem
crossover
in class Problem<IntegerRepresentation>
r1
- the representation of the first solutionr2
- the representation of the second solutionn
- the nucleosome vectorpublic void methilate(IntegerRepresentation r, java.util.BitSet n, float eprobability)
Problem
methilate
in class Problem<IntegerRepresentation>
r
- the representation of the solutionn
- the nucleosome vectoreprobability
- the epigenetic probabilitypublic IntegerRepresentation generateSolution()
Problem
generateSolution
in class Problem<IntegerRepresentation>
public int compare(double d1, double d2)
Problem
compare
in class Problem<IntegerRepresentation>
d1
- the first fitness valued2
- the second fitness valuepublic void save(IntegerRepresentation representation, java.lang.String file) throws java.io.FileNotFoundException
Problem
save
in class Problem<IntegerRepresentation>
representation
- the representationfile
- the filenamejava.io.FileNotFoundException
- If the file cannot be saved