public class GeneticMappingGenotype
extends java.lang.Object
implements org.opt4j.core.Genotype
Constructor and Description |
---|
GeneticMappingGenotype()
Constructs a new genotype with an empty
mapping matrix
|
GeneticMappingGenotype(int[][] mapping_matrix)
Constructs a new genotype given a
mapping matrix
|
GeneticMappingGenotype(int[][] mapping_matrix,
boolean mutate)
Constructs a new genotype given a
mapping matrix and optionally mutates
the matrix values
|
GeneticMappingGenotype(int[][] phenotype_parent_i,
int[][] phenotype_parent_j)
Constructs a new genotype given two
mapping matrices and using the cycle crossover.
|
Modifier and Type | Method and Description |
---|---|
int[][] |
getGenotype_mapping_matrix() |
GeneticMappingGenotype |
newInstance() |
void |
printMatrix() |
int |
size() |
public GeneticMappingGenotype()
public GeneticMappingGenotype(int[][] mapping_matrix)
mapping_matrix
- The mapping matrixpublic GeneticMappingGenotype(int[][] mapping_matrix, boolean mutate)
mapping_matrix
- The mapping matrixmutate
- true
in order to randomly mutate the mapping matrix;
false
otherwisepublic GeneticMappingGenotype(int[][] phenotype_parent_i, int[][] phenotype_parent_j)
phenotype_parent_i
- The mapping matrix of the first parentphenotype_parent_j
- The mapping matrix of the second parentpublic GeneticMappingGenotype newInstance()
newInstance
in interface org.opt4j.core.Genotype
public int size()
size
in interface org.opt4j.core.Genotype
public int[][] getGenotype_mapping_matrix()
public void printMatrix()