Package sfc_b

Class Chromosome_b

java.lang.Object
sfc_b.Chromosome_b

public class Chromosome_b
extends java.lang.Object
chromosome of the population
  • Field Summary

    Fields
    Modifier and Type Field Description
    private double fitness
    fitness for this chromosome
    private int[] genes
    the phenotype of the chromosome
  • Constructor Summary

    Constructors
    Constructor Description
    Chromosome_b​(int d)
    initialize the phenotype of this chromosome
    Chromosome_b​(int[] c)
    initialize this chromosome on given mapping
    Chromosome_b​(int[][] parameter_dom)
    generates random parameter values
    Chromosome_b​(int f, int[] m)
    initialize the object on given mapping and fitness
    Chromosome_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 gene
    java.lang.String[] changem​(int index, int value)
    change one gene and return phenotype
    double getfitness()
    get fitness
    int[] getgenes()
    get phenotype
    java.lang.String[] getstringmap()
    phenotype to string
    void randomgeneration​(int[][] parameter_dom)
    generate random chromosome values
    void setfitness​(double newfit)
    set fitness
    void setgenes​(int[] ma)
    set phenotype
    void strtomap​(java.lang.String[] c)
    string to map

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • genes

      private int[] genes
      the phenotype of the chromosome
    • fitness

      private double fitness
      fitness 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