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) class
DCController.agentthread
Thread 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) int
clustersize
Size of the cluster of candidate hosts.(package private) network.Codec
cod
(package private) double[]
currentmodel
Current model in use.(package private) int
duration
VNF lifecycle duration.(package private) java.lang.String
err
error message(package private) java.lang.Double
fitness
Solution fitness.(package private) int
fnodes
Parameter to define cluster size.(package private) int
iteration
Simulation iteration, request ID.(package private) int[]
mapping
Produced mapping.(package private) int
maxsfcsize
Maximum SFC size(package private) java.lang.Double
mode
Agent modes(package private) java.lang.Double[]
msg0
Messages to the agents.(package private) network.FTnetwork
net
Network object.(package private) int
netid
Network id.(package private) boolean
printmapping
Print mapping?(package private) boolean
recompute
Recompute in case of failure?(package private) boolean
reject
Is request rejected?(package private) int[]
servercnt
Measures the cluster nodes sent to each server.(package private) int
servperrack
Servers per rack.(package private) boolean
solfound
Solution found?(package private) double[]
solutionew
Solution edge weights in Edge Vector indexing.(package private) boolean
spatial
Are there spatial constraints?(package private) int
sr
Size of servers registry.(package private) services.VNFgraph
vnfgraph
Fields 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 void
addnode(int a)
Add another node to cluster by sending message to the agent.private void
addnodes(int a, int b)
Send candidate hosts to distributed functions.boolean
chkbnd(int snode, int vnode)
Check bandwidth.void
compute()
Run distributed Deep Learning algorithm.void
computesolution()
Compute and get the best solution computed by the distributed agents.void
distribute0()
Cluster formation function #0.void
distribute1()
Cluster formation function #1.void
distribute1m()
Cluster formation function #1m.void
distribute2()
Cluster formation function #2.void
distribute3()
Cluster formation function #3.void
distribute3m()
Cluster formation function #3m.int
getiteration()
Get iteration.int[]
getmapping()
Get latest computed mappingprivate java.lang.Double
getminband(int a, int b)
Get minimum available bandwidth between two nodes.int
getnetid()
Set iteration.void
getrequest(services.VNFgraph vnfg)
Get request.boolean
inlist(int n, java.util.ArrayList<java.lang.Integer> pnodes)
Is node in list?boolean
isrejected()
Request rejected?void
printmapping()
Print successful mapping.private void
sendmessage(network.Message m, int server)
Send messages to servers.void
setclustersize(int fnodes1)
Set cluster size.void
setduration(int d)
Set VNF lifecyle.void
setiteration(int s)
Set iteration.void
setmapping(int[] m)
Set latest computed mappingvoid
setmaxsfcsize(int maxsize)
Set maximum node size.void
setmode(double a)
Set mode.void
setnetid(int s)
Set domain id.void
setprintmapping(boolean b)
Set true to print the output on screen.void
setspatial(boolean tf)
Apply or deprecate spatial constraints.void
storemodel(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, yield
Methods 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.
-