Package sfc_ft_b
Class GA_b
java.lang.Object
sfc_ft_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) services.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 populationGA_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.FTnetwork
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
-
Method Summary
Modifier and Type Method Description private void
crossover()
Crossovervoid
genchromefit(Chromosome_b h)
compute and store fitness of a single chromosomevoid
genfit()
computes and stores the fitness of each cromosomevoid
genfit1()
computes fitness for popvoid
genfit2()
compute fitness for population generated by crossover and mutation (pop2)void
genpop()
determines the nodes that will be used for population generationvoid
init()
Initialize structure of procedures in PAGAvoid
init2()
execute genetic procedures for current generationvoid
initializebest()
initialize the object that stores the best solution in each team and groupvoid
initializelastbest()
initialize the object that stores the best overall solutionprivate void
mutation()
Mutationvoid
printbest()
print current generation best solutionvoid
printlastbest()
print current overall best solutionvoid
printpop()
prints population of the current generationprivate void
range()
computes the range in the fitness of the populationprivate void
selection()
Selectionvoid
superbest(int in)
stores the best solution of the current generation for the next stage of the algorithmvoid
superbest2(int in)
stores the best solution of the current generation for the next stage of the algorithmvoid
updatebest()
update best solutionvoid
updatebestmax()
update best solution when the objective is the maximizationvoid
updatebestmin()
update best solution when the objective is the minimizationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
chromes
int chromesPAGA parameter, even numbers only -
generations
int generationsPAGA parameter, even numbers only -
supergen
int supergenPAGA supergeneration parameter, even numbers only set supergen=1 for simple GA configuration -
pop
Chromosome_b[] poppopulation arrays -
pop2
Chromosome_b[] pop2population arrays -
pops
Chromosome_b[] popspopulation arrays -
pops2
Chromosome_b[] pops2population arrays -
k
int knumber of parameters -
params
java.lang.String[] paramsparameter names -
parameter_dom
int[][] parameter_domparameter domains -
command
java.lang.String[] commandapply command to OS -
objective
java.lang.String objectiveset to min or max -
best
preserves best solution on each stage -
lastbest
Best_b lastbestpreserves latest best solution -
min
double minminimum, maximum fitness -
max
double maxminimum, maximum fitness -
dif
double difrange of fitness in population -
crossprob
double crossprobcrossover probability -
mutprob
double mutprobmutation probability -
first
boolean firstindicates the generation of first population -
mapping
int[] mappingmapping of parameter values to the command to OS -
pnet
network.FTnetwork pnet -
cnet
services.VNFgraph cnet -
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, services.VNFgraph cnet, network.FTnetwork 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
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
-