Package controller
Class DCController
java.lang.Object
java.lang.Thread
controller.DCController
- All Implemented Interfaces:
java.lang.Runnable
public class DCController
extends java.lang.Thread
Network controller that runs the distributed multi-threaded algorithm.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classDCController.agentthreadThread that runs agent.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) intclustersizeSize of the cluster of candidate hosts.(package private) network.Codeccod(package private) double[]currentmodelCurrent model in use.(package private) intdurationVNF lifecycle duration.(package private) java.lang.Stringerrerror message(package private) java.lang.DoublefitnessSolution fitness.(package private) intfnodesParameter to define cluster size.(package private) intiterationSimulation iteration, request ID.(package private) int[]mappingProduced mapping.(package private) intmaxsfcsizeMaximum SFC size(package private) java.lang.DoublemodeAgent modes(package private) java.lang.Double[]msg0Messages to the agents.(package private) network.FTnetworknetNetwork object.(package private) intnetidNetwork id.(package private) booleanprintmappingPrint mapping?(package private) booleanrecomputeRecompute in case of failure?(package private) booleanrejectIs request rejected?(package private) int[]servercntMeasures the cluster nodes sent to each server.(package private) intservperrackServers per rack.(package private) booleansolfoundSolution found?(package private) double[]solutionewSolution edge weights in Edge Vector indexing.(package private) booleanspatialAre there spatial constraints?(package private) intsrSize of servers registry.(package private) services.VNFgraphvnfgraphFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors Constructor Description DCController(network.FTnetwork net, java.lang.Double mode)Construct distributed algorithm object on input of network and algorithm mode. -
Method Summary
Modifier and Type Method Description private voidaddnode(int a)Add another node to cluster by sending message to the agent.private voidaddnodes(int a, int b)Send candidate hosts to distributed functions.booleanchkbnd(int snode, int vnode)Check bandwidth.voidcompute()Run distributed Deep Learning algorithm.voidcomputesolution()Compute and get the best solution computed by the distributed agents.voiddistribute0()Cluster formation function #0.voiddistribute1()Cluster formation function #1.voiddistribute1m()Cluster formation function #1m.voiddistribute2()Cluster formation function #2.voiddistribute3()Cluster formation function #3.voiddistribute3m()Cluster formation function #3m.intgetiteration()Get iteration.int[]getmapping()Get latest computed mappingprivate java.lang.Doublegetminband(int a, int b)Get minimum available bandwidth between two nodes.intgetnetid()Set iteration.voidgetrequest(services.VNFgraph vnfg)Get request.booleaninlist(int n, java.util.ArrayList<java.lang.Integer> pnodes)Is node in list?booleanisrejected()Request rejected?voidprintmapping()Print successful mapping.private voidsendmessage(network.Message m, int server)Send messages to servers.voidsetclustersize(int fnodes1)Set cluster size.voidsetduration(int d)Set VNF lifecyle.voidsetiteration(int s)Set iteration.voidsetmapping(int[] m)Set latest computed mappingvoidsetmaxsfcsize(int maxsize)Set maximum node size.voidsetmode(double a)Set mode.voidsetnetid(int s)Set domain id.voidsetprintmapping(boolean b)Set true to print the output on screen.voidsetspatial(boolean tf)Apply or deprecate spatial constraints.voidstoremodel(int sz, java.lang.String b)Store model.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, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
net
network.FTnetwork netNetwork object. -
netid
int netidNetwork id. -
iteration
int iterationSimulation iteration, request ID. -
sr
int srSize of servers registry. -
servperrack
int servperrackServers per rack. -
servercnt
int[] servercntMeasures the cluster nodes sent to each server. -
duration
int durationVNF lifecycle duration. -
clustersize
int clustersizeSize of the cluster of candidate hosts. -
fnodes
int fnodesParameter to define cluster size. -
mapping
int[] mappingProduced mapping. -
spatial
boolean spatialAre there spatial constraints? -
fitness
java.lang.Double fitnessSolution fitness. -
vnfgraph
services.VNFgraph vnfgraph -
reject
boolean rejectIs request rejected? -
printmapping
boolean printmappingPrint mapping? -
solfound
boolean solfoundSolution found? -
cod
network.Codec cod -
err
java.lang.String errerror message -
msg0
java.lang.Double[] msg0Messages to the agents. -
recompute
boolean recomputeRecompute in case of failure? -
solutionew
double[] solutionewSolution edge weights in Edge Vector indexing. -
currentmodel
double[] currentmodelCurrent model in use. -
mode
java.lang.Double modeAgent modes -
maxsfcsize
int maxsfcsizeMaximum SFC size
-
-
Constructor Details
-
DCController
public DCController(network.FTnetwork net, java.lang.Double mode)Construct distributed algorithm object on input of network and algorithm mode.
-
-
Method Details
-
getrequest
public void getrequest(services.VNFgraph vnfg)Get request. -
compute
public void compute()Run distributed Deep Learning algorithm. -
computesolution
public void computesolution()Compute and get the best solution computed by the distributed agents. -
distribute0
public void distribute0()Cluster formation function #0. -
distribute1
public void distribute1()Cluster formation function #1. -
distribute1m
public void distribute1m()Cluster formation function #1m. -
distribute2
public void distribute2()Cluster formation function #2. -
distribute3
public void distribute3()Cluster formation function #3. -
distribute3m
public void distribute3m()Cluster formation function #3m. -
isrejected
public boolean isrejected()Request rejected? -
inlist
public boolean inlist(int n, java.util.ArrayList<java.lang.Integer> pnodes)Is node in list? -
printmapping
public void printmapping()Print successful mapping. -
getminband
private java.lang.Double getminband(int a, int b)Get minimum available bandwidth between two nodes. -
setspatial
public void setspatial(boolean tf)Apply or deprecate spatial constraints. -
setduration
public void setduration(int d)Set VNF lifecyle. -
setclustersize
public void setclustersize(int fnodes1)Set cluster size. -
setmaxsfcsize
public void setmaxsfcsize(int maxsize)Set maximum node size. -
setprintmapping
public void setprintmapping(boolean b)Set true to print the output on screen. -
setiteration
public void setiteration(int s)Set iteration. -
setnetid
public void setnetid(int s)Set domain id. -
setmode
public void setmode(double a)Set mode. -
getnetid
public int getnetid()Set iteration. -
setmapping
public void setmapping(int[] m)Set latest computed mapping -
getmapping
public int[] getmapping()Get latest computed mapping -
getiteration
public int getiteration()Get iteration. -
addnode
private void addnode(int a)Add another node to cluster by sending message to the agent. -
addnodes
private void addnodes(int a, int b)Send candidate hosts to distributed functions. -
sendmessage
private void sendmessage(network.Message m, int server)Send messages to servers. -
chkbnd
public boolean chkbnd(int snode, int vnode)Check bandwidth. -
storemodel
public void storemodel(int sz, java.lang.String b)Store model.
-