Package sfc_ft_b
Class Chromosome_b
java.lang.Object
sfc_ft_b.Chromosome_b
public class Chromosome_b
extends java.lang.Object
chromosome of the population
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Chromosome_b(int d)
initialize the phenotype of this chromosomeChromosome_b(int[] c)
initialize this chromosome on given mappingChromosome_b(int[][] parameter_dom)
generates random parameter valuesChromosome_b(int f, int[] m)
initialize the object on given mapping and fitnessChromosome_b(java.lang.String[] c)
initialize object on given mapping -
Method Summary
Modifier and Type Method Description void
change(int index, int value)
change one genejava.lang.String[]
changem(int index, int value)
change one gene and return phenotypedouble
getfitness()
get fitnessint[]
getgenes()
get phenotypejava.lang.String[]
getstringmap()
phenotype to stringvoid
randomgeneration(int[][] parameter_dom)
generate random chromosome valuesvoid
setfitness(double newfit)
set fitnessvoid
setgenes(int[] ma)
set phenotypevoid
strtomap(java.lang.String[] c)
string to mapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
genes
private int[] genesthe phenotype of the chromosome -
fitness
private double fitnessfitness for this chromosome
-
-
Constructor Details
-
Chromosome_b
public Chromosome_b(int[][] parameter_dom)generates random parameter values -
Chromosome_b
public Chromosome_b(int d)initialize the phenotype of this chromosome -
Chromosome_b
public Chromosome_b(int[] c)initialize this chromosome on given mapping -
Chromosome_b
public Chromosome_b(java.lang.String[] c)initialize object on given mapping -
Chromosome_b
public Chromosome_b(int f, int[] m)initialize the object on given mapping and fitness
-
-
Method Details
-
strtomap
public void strtomap(java.lang.String[] c)string to map -
randomgeneration
public void randomgeneration(int[][] parameter_dom)generate random chromosome values -
setfitness
public void setfitness(double newfit)set fitness -
getgenes
public int[] getgenes()get phenotype -
getstringmap
public java.lang.String[] getstringmap()phenotype to string -
change
public void change(int index, int value)change one gene -
changem
public java.lang.String[] changem(int index, int value)change one gene and return phenotype -
setgenes
public void setgenes(int[] ma)set phenotype -
getfitness
public double getfitness()get fitness
-