Package sfc_ft_c
Class GA_c
java.lang.Object
sfc_ft_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>availnodesavailable nodes; nodes capable to host the minimum capacity VNF of the chainBest_cbestcurrent best solution(package private) Best_cbest2best solution produce by supergenerations(package private) intchromesGA parameters(package private) services.VNFgraphcnetVNF-graphintcnodessubstrate nodes(package private) Codec_ccodEdge Vector codec(package private) doublecrosspropGA parameters(package private) doubledifpopulation fitness range(package private) java.util.ArrayList<int[]>edgechargeedge traffic load(package private) intgenerationsGA parametersMapping_cmmapping GA output(package private) doublemaxmin max population fitness(package private) intmaxnodebmaximum node bandwidth; for FatTree it is 1Gbps(package private) doubleminmin max population fitness(package private) doublemutpropGA parameters(package private) java.util.ArrayList<int[]>nodechargenode capacity load(package private) doublenormaliznormalization factors for fitness function; set to 1.0 if not applicable(package private) doublenormaliz2normalization factors for fitness function; set to 1.0 if not applicable(package private) network.FTnetworkpnetsubstrate networkintpnodesVNF nodes(package private) Mapping_c[]poparrays for storing populations(package private) Mapping_c[]pop2arrays for storing populations(package private) booleanpopgenheuristicset true to use population generation heuristic(package private) Mapping_c[]popsarrays for storing populations(package private) Mapping_c[]pops2arrays for storing populations(package private) booleanrejectionis last request rejected?(package private) intsupergenGA parameters -
Constructor Summary
-
Method Summary
Modifier and Type Method Description private voidcrossover()Crossovervoidgenefitness(Mapping_c m)compute fitness on given mappingvoidgenfit()compute fitness for populationvoidgenfit1(Mapping_c[] somepop)compute and store fitness on chromosomevoidgenpop()determines the nodes that will be used for population generationvoidgenpop2()generates populationvoidinit()initialize Genetic Algorithmvoidinit2()execute genetic procedures for current generationprivate voidmultymutation(int d)multiple point Mutationprivate voidmutation()Mutationvoidprintgenes()print populationvoidprintparams()print GA parametersvoidprintsuper()print super bestprivate voidrange()compute the range in the fitness of the populationprivate voidselection()Selectionvoidsetparams(int chrmes, int gnrs, int sgnrs, int cr, int mu)set GA parametersvoidsuperbest(int in)save generation best solutionvoidsuperbest2(int in)save supergeneration best solutionvoidupdatebest()update currently best mappingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
cod
Codec_c codEdge Vector codec -
pop
Mapping_c[] poparrays for storing populations -
pop2
Mapping_c[] pop2arrays for storing populations -
pops
Mapping_c[] popsarrays for storing populations -
pops2
Mapping_c[] pops2arrays for storing populations -
m
mapping GA output -
cnodes
public int cnodessubstrate nodes -
pnodes
public int pnodesVNF nodes -
maxnodeb
int maxnodebmaximum node bandwidth; for FatTree it is 1Gbps -
pnet
network.FTnetwork pnetsubstrate network -
cnet
services.VNFgraph cnetVNF-graph -
crossprop
double crosspropGA parameters -
mutprop
double mutpropGA parameters -
chromes
int chromesGA parameters -
supergen
int supergenGA parameters -
generations
int generationsGA parameters -
min
double minmin max population fitness -
max
double maxmin max population fitness -
dif
double difpopulation fitness range -
best
current best solution -
best2
Best_c best2best solution produce by supergenerations -
popgenheuristic
boolean popgenheuristicset true to use population generation heuristic -
rejection
boolean rejectionis last request rejected? -
nodecharge
java.util.ArrayList<int[]> nodechargenode capacity load -
edgecharge
java.util.ArrayList<int[]> edgechargeedge traffic load -
availnodes
java.util.ArrayList<java.lang.Integer> availnodesavailable nodes; nodes capable to host the minimum capacity VNF of the chain -
normaliz
double normaliznormalization factors for fitness function; set to 1.0 if not applicable -
normaliz2
double normaliz2normalization 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, services.VNFgraph incnet, network.FTnetwork 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
compute and store fitness on chromosome -
genefitness
compute fitness on given mapping -
printgenes
public void printgenes()print population -
printsuper
public void printsuper()print super best
-