Package sfc_ft_a
Class GA2
java.lang.Object
sfc_ft_a.GA2
public class GA2
extends java.lang.Object
Instance of the Genetic Algorithm for the parallel computation of supergenerations
-
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(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) services.VNFgraph
cnet
VNF graphint
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.FTnetwork
pnet
substrate networkint
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) int
supergen
GA parameters(package private) double
totalTime
runtime -
Constructor Summary
-
Method Summary
Modifier and Type Method Description private void
crossover()
Crossovervoid
genefitness(Mapping m)
compute fitness on given mappingvoid
genfit()
compute fitness for populationvoid
genfit1(Mapping[] somepop)
compute and store fitness on chromosomevoid
genpop()
determines the nodes that will be used for population generationvoid
genpop_v1()
generation of random population without the use of a heuristicvoid
genpop2()
generates populationBest
getbest()
Best
getbest2()
Mapping[]
getpop()
Mapping[]
getpop2()
Mapping[]
getpops()
Mapping[]
getpops2()
double
gettotaltime()
get runtimevoid
init()
initialize Genetic Algorithmvoid
init2()
execute genetic procedures for current generationboolean
isrejected()
is current request rejected?void
loadSetup(Setup s, java.lang.String dsetup)
load GA setupvoid
loadVNFgraph(services.VNFgraph vnf)
load VNF graphprivate void
multymutation(int d)
multiple point Mutationprivate void
mutation()
Mutationvoid
printgenes()
print populationvoid
printsuper()
print super bestprivate void
range()
compute the range in the fitness of the populationprivate void
selection()
Selectionvoid
setavnodes(java.util.ArrayList<java.lang.Integer> a)
set available nodesvoid
setduration(int d)
set SFC lifetimevoid
setpopgenheuristic(boolean popgenheur)
set true to enable population generation heuristic, set false to disablevoid
superbest(int in)
save generation best solutionvoid
superbest2(int in)
save supergeneration best solutionvoid
updatebest()
update currently best mappingvoid
updatetraffic()
update network traffic and CPU load if request is acceptedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
cod
Codec codEdge Vector codec -
pop
Mapping[] poparrays for storing populations -
pop2
Mapping[] pop2arrays for storing populations -
pops
Mapping[] popsarrays for storing populations -
pops2
Mapping[] pops2arrays for storing populations -
m
Mapping mmapping GA output -
maxnodeb
int maxnodebmaximum node bandwidth; for FatTree it is 1Gbps -
cnet
services.VNFgraph cnetVNF graph -
pnet
network.FTnetwork pnetsubstrate network -
cnodes
public int cnodessubstrate nodes -
pnodes
public int pnodesVNF nodes -
crossprop
double crosspropGA parameters -
mutprop
double mutpropGA parameters -
chromes
int chromesGA parameters -
supergen
int supergenGA parameters -
generations
int generationsGA parameters -
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 -
popgenheuristic
boolean popgenheuristicset true to use population generation heuristic -
duration
int durationembedded VNF life cycle duration -
min
double minmin max population fitness -
max
double maxmin max population fitness -
dif
double difpopulation fitness range -
best
Best bestcurrent best solution -
best2
Best best2best solution produce by the supergenerations -
rejection
boolean rejectionis last request rejected? -
totalTime
double totalTimeruntime -
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 -
defsetup
java.lang.String defsetupGA default setup
-
-
Constructor Details
-
GA2
public GA2(int gens, int gnrs, int sgnrs, int cr, int mu)initialize GA with running parameters -
GA2
public GA2(network.FTnetwork pnet)initialize GA with substrate network object
-
-
Method Details
-
loadVNFgraph
public void loadVNFgraph(services.VNFgraph vnf)load VNF graph -
loadSetup
load GA setup -
setpopgenheuristic
public void setpopgenheuristic(boolean popgenheur)set true to enable population generation heuristic, set false to disable -
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 -
genpop
public void genpop()determines the nodes that will be used for population generation -
genpop2
public void genpop2()generates population -
genpop_v1
public void genpop_v1()generation of random population without the use of a heuristic -
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 -
gettotaltime
public double gettotaltime()get runtime -
setavnodes
public void setavnodes(java.util.ArrayList<java.lang.Integer> a)set available nodes -
getbest
-
getbest2
-
getpop
-
getpop2
-
getpops
-
getpops2
-