Package sfc_a

Class GA

java.lang.Object
java.lang.Thread
sfc_a.GA
All Implemented Interfaces:
java.lang.Runnable

public class GA
extends java.lang.Thread
Genetic Algorithm
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    (package private) class  GA.supergenthread
    Thread for the parallel computation of the GA within supergenerations loop

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) boolean[] activethreads
    Check for active threads
    (package private) java.util.ArrayList<java.lang.Integer> availnodes
    available nodes; nodes capable to host the minimum capacity VNF of the chain
    (package private) Best best
    current best solution
    (package private) Best best2
    best solution produce by the supergenerations
    (package private) int chromes
    GA parameters
    (package private) network.VNFgraph cnet
    VNF graph
    int cnodes
    substrate nodes
    (package private) Codec cod
    Edge Vector codec
    (package private) double crossprop
    GA parameters
    (package private) java.lang.String defsetup
    GA default setup
    (package private) double dif
    population fitness range
    (package private) int duration
    embedded VNF life cycle duration
    (package private) java.util.ArrayList<int[]> edgecharge
    edge traffic load
    (package private) int generations
    GA parameters
    (package private) Mapping 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[] pop
    arrays for storing populations
    (package private) Mapping[] pop2
    arrays for storing populations
    (package private) boolean popgenheuristic
    set true to use population generation heuristic
    (package private) Mapping[] pops
    arrays for storing populations
    (package private) Mapping[] pops2
    arrays for storing populations
    (package private) boolean rejection
    is last request rejected?
    (package private) Setup setup
    Running parameter setup
    (package private) int supergen
    GA parameters
    (package private) double totalTime
    runtime

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors
    Constructor Description
    GA​(int gens, int gnrs, int sgnrs, int cr, int mu)  
    GA​(network.Network pnet)  
  • Method Summary

    Modifier and Type Method Description
    private void crossover()
    Crossover
    void genefitness​(Mapping m)
    compute fitness on given mapping
    void genefitness_experimental1​(Mapping m)
    compute fitness on given mapping experimental version 1
    void genefitness_experimental2​(Mapping m)
    compute fitness on given mapping experimental version 2
    void genfit()
    compute fitness for population
    void genfit1​(Mapping[] somepop)
    compute and store fitness on chromosome
    double gettotaltime()
    get runtime
    void init()
    initialize Genetic Algorithm
    void init2()
    execute genetic procedures for current generation
    boolean isrejected()
    is current request rejected?
    void loadSetup​(Setup s, java.lang.String dsetup)
    load GA setup
    void loadVNFgraph​(network.VNFgraph vnf)
    load VNF graph
    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 setduration​(int d)
    set SFC lifetime
    void setpopgenheuristic​(boolean popgenheur)
    set true to enable population generation heuristic, set false to disable
    void superbest​(int in)
    save generation best solution
    void superbest2​(int in)
    save supergeneration best solution
    void updatebest()
    update currently best mapping
    void updatetraffic()
    update network traffic and CPU load if request is accepted

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield

    Methods inherited from class java.lang.Object

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

    • cod

      Codec cod
      Edge Vector codec
    • pop

      Mapping[] pop
      arrays for storing populations
    • pop2

      Mapping[] pop2
      arrays for storing populations
    • pops

      Mapping[] pops
      arrays for storing populations
    • pops2

      Mapping[] pops2
      arrays for storing populations
    • m

      mapping GA output
    • maxnodeb

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

      network.VNFgraph cnet
      VNF graph
    • pnet

      network.Network pnet
      substrate network
    • cnodes

      public int cnodes
      substrate nodes
    • pnodes

      public int pnodes
      VNF nodes
    • 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
    • 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
    • popgenheuristic

      boolean popgenheuristic
      set true to use population generation heuristic
    • duration

      int duration
      embedded VNF life cycle duration
    • min

      double min
      min max population fitness
    • max

      double max
      min max population fitness
    • dif

      double dif
      population fitness range
    • best

      Best best
      current best solution
    • best2

      Best best2
      best solution produce by the supergenerations
    • rejection

      boolean rejection
      is last request rejected?
    • totalTime

      double totalTime
      runtime
    • 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
    • defsetup

      java.lang.String defsetup
      GA default setup
    • setup

      Setup setup
      Running parameter setup
    • activethreads

      boolean[] activethreads
      Check for active threads
  • Constructor Details

    • GA

      public GA​(int gens, int gnrs, int sgnrs, int cr, int mu)
    • GA

      public GA​(network.Network pnet)
  • Method Details

    • loadVNFgraph

      public void loadVNFgraph​(network.VNFgraph vnf)
      load VNF graph
    • loadSetup

      public void loadSetup​(Setup s, java.lang.String dsetup)
      load GA setup
    • setpopgenheuristic

      public void setpopgenheuristic​(boolean popgenheur)
      set true to enable population generation heuristic, set false to disable
    • printparams

      public void printparams()
      print GA parameters
    • init

      public void init()
      initialize Genetic Algorithm
    • init2

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

      public void setduration​(int d)
      set SFC lifetime
    • isrejected

      public boolean isrejected()
      is current request rejected?
    • updatetraffic

      public void updatetraffic()
      update network traffic and CPU load if request is accepted
    • 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
    • genfit

      public void genfit()
      compute fitness for population
    • genfit1

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

      public void genefitness​(Mapping m)
      compute fitness on given mapping
    • genefitness_experimental1

      public void genefitness_experimental1​(Mapping m)
      compute fitness on given mapping experimental version 1
    • genefitness_experimental2

      public void genefitness_experimental2​(Mapping m)
      compute fitness on given mapping experimental version 2
    • printgenes

      public void printgenes()
      print population
    • gettotaltime

      public double gettotaltime()
      get runtime
    • printsuper

      public void printsuper()
      print super best