Package sfc_c

Class GA_c

java.lang.Object
sfc_c.GA_c

public class GA_c
extends java.lang.Object
Genetic Algorithm, used by PAGA for computing the fitness of candidate setups
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) java.util.ArrayList<java.lang.Integer> availnodes
    available nodes; nodes capable to host the minimum capacity VNF of the chain
    Best_c best
    current best solution
    (package private) Best_c best2
    best solution produce by supergenerations
    (package private) int chromes
    GA parameters
    (package private) network.VNFgraph cnet
    VNF-graph
    int cnodes
    substrate nodes
    (package private) Codec_c cod
    Edge Vector codec
    (package private) double crossprop
    GA parameters
    (package private) double dif
    population fitness range
    (package private) java.util.ArrayList<int[]> edgecharge
    edge traffic load
    (package private) int generations
    GA parameters
    Mapping_c m
    mapping GA output
    (package private) double max
    min max population fitness
    (package private) int maxnodeb
    maximum node bandwidth; for FatTree it is 1Gbps
    (package private) double min
    min max population fitness
    (package private) double mutprop
    GA parameters
    (package private) java.util.ArrayList<int[]> nodecharge
    node capacity load
    (package private) double normaliz
    normalization factors for fitness function; set to 1.0 if not applicable
    (package private) double normaliz2
    normalization factors for fitness function; set to 1.0 if not applicable
    (package private) network.Network pnet
    substrate network
    int pnodes
    VNF nodes
    (package private) Mapping_c[] pop
    arrays for storing populations
    (package private) Mapping_c[] pop2
    arrays for storing populations
    (package private) boolean popgenheuristic
    set true to use population generation heuristic
    (package private) Mapping_c[] pops
    arrays for storing populations
    (package private) Mapping_c[] pops2
    arrays for storing populations
    (package private) boolean rejection
    is last request rejected?
    (package private) int supergen
    GA parameters
  • Constructor Summary

    Constructors
    Constructor Description
    GA_c()  
    GA_c​(int chromes, int gnrs, int sgnrs, int cr, int mu, network.VNFgraph incnet, network.Network inpnet)
    construct GA object on input of running parameters, virtual topology and substrate network
  • Method Summary

    Modifier and Type Method Description
    private void crossover()
    Crossover
    void genefitness​(Mapping_c m)
    compute fitness on given mapping
    void genfit()
    compute fitness for population
    void genfit1​(Mapping_c[] somepop)
    compute and store fitness on chromosome
    void genpop()
    determines the nodes that will be used for population generation
    void genpop2()
    generates population
    void init()
    initialize Genetic Algorithm
    void init2()
    execute genetic procedures for current generation
    private void multymutation​(int d)
    multiple point Mutation
    private void mutation()
    Mutation
    void printgenes()
    print population
    void printparams()
    print GA parameters
    void printsuper()
    print super best
    private void range()
    compute the range in the fitness of the population
    private void selection()
    Selection
    void setparams​(int chrmes, int gnrs, int sgnrs, int cr, int mu)
    set GA parameters
    void superbest​(int in)
    save generation best solution
    void superbest2​(int in)
    save supergeneration best solution
    void updatebest()
    update currently best mapping

    Methods inherited from class java.lang.Object

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

    • cod

      Codec_c cod
      Edge Vector codec
    • pop

      Mapping_c[] pop
      arrays for storing populations
    • pop2

      Mapping_c[] pop2
      arrays for storing populations
    • pops

      Mapping_c[] pops
      arrays for storing populations
    • pops2

      Mapping_c[] pops2
      arrays for storing populations
    • m

      public Mapping_c m
      mapping GA output
    • cnodes

      public int cnodes
      substrate nodes
    • pnodes

      public int pnodes
      VNF nodes
    • maxnodeb

      int maxnodeb
      maximum node bandwidth; for FatTree it is 1Gbps
    • pnet

      network.Network pnet
      substrate network
    • cnet

      network.VNFgraph cnet
      VNF-graph
    • crossprop

      double crossprop
      GA parameters
    • mutprop

      double mutprop
      GA parameters
    • chromes

      int chromes
      GA parameters
    • supergen

      int supergen
      GA parameters
    • generations

      int generations
      GA parameters
    • min

      double min
      min max population fitness
    • max

      double max
      min max population fitness
    • dif

      double dif
      population fitness range
    • best

      public Best_c best
      current best solution
    • best2

      Best_c best2
      best solution produce by supergenerations
    • popgenheuristic

      boolean popgenheuristic
      set true to use population generation heuristic
    • rejection

      boolean rejection
      is last request rejected?
    • nodecharge

      java.util.ArrayList<int[]> nodecharge
      node capacity load
    • edgecharge

      java.util.ArrayList<int[]> edgecharge
      edge traffic load
    • availnodes

      java.util.ArrayList<java.lang.Integer> availnodes
      available nodes; nodes capable to host the minimum capacity VNF of the chain
    • normaliz

      double normaliz
      normalization factors for fitness function; set to 1.0 if not applicable
    • normaliz2

      double normaliz2
      normalization factors for fitness function; set to 1.0 if not applicable
  • Constructor Details

    • GA_c

      public GA_c​(int chromes, int gnrs, int sgnrs, int cr, int mu, network.VNFgraph incnet, network.Network inpnet)
      construct GA object on input of running parameters, virtual topology and substrate network
    • GA_c

      public GA_c()
  • Method Details

    • setparams

      public void setparams​(int chrmes, int gnrs, int sgnrs, int cr, int mu)
      set GA parameters
    • printparams

      public void printparams()
      print GA parameters
    • init

      public void init()
      initialize Genetic Algorithm
    • init2

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

      public void updatebest()
      update currently best mapping
    • superbest

      public void superbest​(int in)
      save generation best solution
    • superbest2

      public void superbest2​(int in)
      save supergeneration best solution
    • range

      private void range()
      compute the range in the fitness of the population
    • selection

      private void selection()
      Selection
    • crossover

      private void crossover()
      Crossover
    • multymutation

      private void multymutation​(int d)
      multiple point Mutation
    • mutation

      private void mutation()
      Mutation
    • genpop

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

      public void genpop2()
      generates population
    • genfit

      public void genfit()
      compute fitness for population
    • genfit1

      public void genfit1​(Mapping_c[] somepop)
      compute and store fitness on chromosome
    • genefitness

      public void genefitness​(Mapping_c m)
      compute fitness on given mapping
    • printgenes

      public void printgenes()
      print population
    • printsuper

      public void printsuper()
      print super best