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>
availnodes
available nodes; nodes capable to host the minimum capacity VNF of the chainBest_c
best
current best solution(package private) Best_c
best2
best solution produce by supergenerations(package private) int
chromes
GA parameters(package private) services.VNFgraph
cnet
VNF-graphint
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 parametersMapping_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.FTnetwork
pnet
substrate networkint
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
-
Method Summary
Modifier and Type Method Description private void
crossover()
Crossovervoid
genefitness(Mapping_c m)
compute fitness on given mappingvoid
genfit()
compute fitness for populationvoid
genfit1(Mapping_c[] somepop)
compute and store fitness on chromosomevoid
genpop()
determines the nodes that will be used for population generationvoid
genpop2()
generates populationvoid
init()
initialize Genetic Algorithmvoid
init2()
execute genetic procedures for current generationprivate void
multymutation(int d)
multiple point Mutationprivate void
mutation()
Mutationvoid
printgenes()
print populationvoid
printparams()
print GA parametersvoid
printsuper()
print super bestprivate void
range()
compute the range in the fitness of the populationprivate void
selection()
Selectionvoid
setparams(int chrmes, int gnrs, int sgnrs, int cr, int mu)
set GA parametersvoid
superbest(int in)
save generation best solutionvoid
superbest2(int in)
save supergeneration best solutionvoid
updatebest()
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
-