Package sfc_b

Class GA_b

java.lang.Object
sfc_b.GA_b

public class GA_b
extends java.lang.Object
Parameter Adjustment Genetic Algorithm
  • Field Summary

    Fields
    Modifier and Type Field Description
    Best_b best
    preserves best solution on each stage
    (package private) int chromes
    PAGA parameter, even numbers only
    (package private) network.VNFgraph cnet  
    (package private) java.lang.String[] command
    apply command to OS
    (package private) double crossprob
    crossover probability
    (package private) double dif
    range of fitness in population
    (package private) boolean first
    indicates the generation of first population
    GA_c ga_c  
    (package private) int generations
    PAGA parameter, even numbers only
    (package private) int k
    number of parameters
    (package private) Best_b lastbest
    preserves latest best solution
    (package private) int[] mapping
    mapping of parameter values to the command to OS
    (package private) double max
    minimum, maximum fitness
    (package private) double min
    minimum, maximum fitness
    (package private) double mutprob
    mutation probability
    (package private) java.lang.String objective
    set to min or max
    (package private) int[][] parameter_dom
    parameter domains
    (package private) java.lang.String[] params
    parameter names
    (package private) network.Network pnet  
    (package private) Chromosome_b[] pop
    population arrays
    (package private) Chromosome_b[] pop2
    population arrays
    (package private) Chromosome_b[] pops
    population arrays
    (package private) Chromosome_b[] pops2
    population arrays
    (package private) int supergen
    PAGA supergeneration parameter, even numbers only set supergen=1 for simple GA configuration
  • Constructor Summary

    Constructors
    Constructor Description
    GA_b()  
    GA_b​(int chroms, int gnrs, int sgnrs, java.lang.String[] params, java.lang.String[] command, double crossprop, double mutprop, int[][] parameter_dom, java.lang.String objective, network.VNFgraph cnet, network.Network pnet)  
  • Method Summary

    Modifier and Type Method Description
    private void crossover()
    Crossover
    void genchromefit​(Chromosome_b h)
    compute and store fitness of a single chromosome
    void genfit()
    computes and stores the fitness of each cromosome
    void genfit1()
    computes fitness for pop
    void genfit2()
    compute fitness for population generated by crossover and mutation (pop2)
    void genpop()
    determines the nodes that will be used for population generation
    void init()
    Initialize structure of procedures in PAGA
    void init2()
    execute genetic procedures for current generation
    void initializebest()
    initialize the object that stores the best solution in each team and group
    void initializelastbest()
    initialize the object that stores the best overall solution
    private void mutation()
    Mutation
    void printbest()
    print current generation best solution
    void printlastbest()
    print current overall best solution
    void printpop()
    prints population of the current generation
    private void range()
    computes the range in the fitness of the population
    private void selection()
    Selection
    void superbest​(int in)
    stores the best solution of the current generation for the next stage of the algorithm
    void superbest2​(int in)
    stores the best solution of the current generation for the next stage of the algorithm
    void updatebest()
    update best solution
    void updatebestmax()
    update best solution when the objective is the maximization
    void updatebestmin()
    update best solution when the objective is the minimization

    Methods inherited from class java.lang.Object

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

    • chromes

      int chromes
      PAGA parameter, even numbers only
    • generations

      int generations
      PAGA parameter, even numbers only
    • supergen

      int supergen
      PAGA supergeneration parameter, even numbers only set supergen=1 for simple GA configuration
    • pop

      population arrays
    • pop2

      Chromosome_b[] pop2
      population arrays
    • pops

      Chromosome_b[] pops
      population arrays
    • pops2

      Chromosome_b[] pops2
      population arrays
    • k

      int k
      number of parameters
    • params

      java.lang.String[] params
      parameter names
    • parameter_dom

      int[][] parameter_dom
      parameter domains
    • command

      java.lang.String[] command
      apply command to OS
    • objective

      java.lang.String objective
      set to min or max
    • best

      public Best_b best
      preserves best solution on each stage
    • lastbest

      Best_b lastbest
      preserves latest best solution
    • min

      double min
      minimum, maximum fitness
    • max

      double max
      minimum, maximum fitness
    • dif

      double dif
      range of fitness in population
    • crossprob

      double crossprob
      crossover probability
    • mutprob

      double mutprob
      mutation probability
    • first

      boolean first
      indicates the generation of first population
    • mapping

      int[] mapping
      mapping of parameter values to the command to OS
    • pnet

      network.Network pnet
    • cnet

      network.VNFgraph cnet
    • ga_c

      public GA_c ga_c
  • Constructor Details

    • GA_b

      public GA_b​(int chroms, int gnrs, int sgnrs, java.lang.String[] params, java.lang.String[] command, double crossprop, double mutprop, int[][] parameter_dom, java.lang.String objective, network.VNFgraph cnet, network.Network pnet)
    • GA_b

      public GA_b()
  • Method Details

    • init

      public void init()
      Initialize structure of procedures in PAGA
    • init2

      public void init2()
      execute genetic procedures for current generation
    • selection

      private void selection()
      Selection
    • crossover

      private void crossover()
      Crossover
    • mutation

      private void mutation()
      Mutation
    • genpop

      public void genpop()
      determines the nodes that will be used for population generation
    • initializebest

      public void initializebest()
      initialize the object that stores the best solution in each team and group
    • initializelastbest

      public void initializelastbest()
      initialize the object that stores the best overall solution
    • printpop

      public void printpop()
      prints population of the current generation
    • superbest

      public void superbest​(int in)
      stores the best solution of the current generation for the next stage of the algorithm
    • superbest2

      public void superbest2​(int in)
      stores the best solution of the current generation for the next stage of the algorithm
    • genfit

      public void genfit()
      computes and stores the fitness of each cromosome
    • genfit1

      public void genfit1()
      computes fitness for pop
    • genfit2

      public void genfit2()
      compute fitness for population generated by crossover and mutation (pop2)
    • genchromefit

      public void genchromefit​(Chromosome_b h)
      compute and store fitness of a single chromosome
    • range

      private void range()
      computes the range in the fitness of the population
    • updatebest

      public void updatebest()
      update best solution
    • updatebestmin

      public void updatebestmin()
      update best solution when the objective is the minimization
    • updatebestmax

      public void updatebestmax()
      update best solution when the objective is the maximization
    • printlastbest

      public void printlastbest()
      print current overall best solution
    • printbest

      public void printbest()
      print current generation best solution