Package controller
Class HyperController
java.lang.Object
java.lang.Thread
controller.HyperController
- All Implemented Interfaces:
java.lang.Runnable
public class HyperController
extends java.lang.Thread
Hypergraph controller that runs the distributed multi-threaded algorithm.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classHyperController.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) booleandiscloseDisclose total domain capacity.(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[]mappingLatest produced mapping for last incoming request.(package private) intmaxsfcsizeMaximum SFC size(package private) java.lang.DoublemodeAgent modes(package private) java.lang.Double[]msg0Messages to the agents.(package private) network.HypergraphnetNetwork object.(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 domain registry.(package private) intsubgraphidSubrequest id, when set >-1 the Hypergraph controller processes a VNF-subgraph par of the incoming request(package private) services.VNFgraphvnfgraphFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors Constructor Description HyperController(network.Hypergraph net, java.lang.Double 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.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.voiddistributebyconstraint()Cluster formation function based on spatial constraint.intgetiteration()Get iteration.int[]getmapping()Get latest computed mapping.private java.lang.Doublegetminband(int a, int b)Get minimum available bandwidth between two nodes.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 last successful mapping.private voidsendmessage(network.Message m, int server)Send messages to servers.voidsetclustersize(int fnodes1)Set cluster size.voidsetdisclose(boolean a)Set disclosurevoidsetduration(int d)Set VNF lifecyle.voidsetiteration(int s)Set iteration.voidsetmapping(int[] m)Set latest computed mapping.voidsetmaxsfcsize(int maxsize)Set maximum node size.voidsetprintmapping(boolean b)Set true to print the output on screen.voidsetspatial(boolean tf)Apply or deprecate spatial constraints.voidsetsubgraphid(int a)Set subgraph id when the controller processes a VNF-subgraph that is a part of the incoming requestvoidstoremodel(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.Hypergraph netNetwork object. -
iteration
int iterationSimulation iteration, request ID. -
sr
int srSize of domain 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[] mappingLatest produced mapping for last incoming request. -
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. -
subgraphid
int subgraphidSubrequest id, when set >-1 the Hypergraph controller processes a VNF-subgraph par of the incoming request -
disclose
boolean discloseDisclose total domain capacity. -
mode
java.lang.Double modeAgent modes -
maxsfcsize
int maxsfcsizeMaximum SFC size
-
-
Constructor Details
-
HyperController
public HyperController(network.Hypergraph net, java.lang.Double 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. -
distributebyconstraint
public void distributebyconstraint()Cluster formation function based on spatial constraint. -
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 last 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. -
setmapping
public void setmapping(int[] m)Set latest computed mapping. -
setclustersize
public void setclustersize(int fnodes1)Set cluster size. -
setmaxsfcsize
public void setmaxsfcsize(int maxsize)Set maximum node size. -
setsubgraphid
public void setsubgraphid(int a)Set subgraph id when the controller processes a VNF-subgraph that is a part of the incoming request -
setprintmapping
public void setprintmapping(boolean b)Set true to print the output on screen. -
setdisclose
public void setdisclose(boolean a)Set disclosure -
setiteration
public void setiteration(int s)Set iteration. -
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. -
storemodel
public void storemodel(int sz, java.lang.String b)Store model.
-