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) class  HyperController.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) boolean disclose
    Disclose total domain capacity.
    (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
    Latest produced mapping for last incoming request.
    (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.Hypergraph net
    Network object.
    (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 domain registry.
    (package private) int subgraphid
    Subrequest id, when set >-1 the Hypergraph controller processes a VNF-subgraph par of the incoming request
    (package private) services.VNFgraph vnfgraph  

    Fields 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 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.
    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.
    void distributebyconstraint()
    Cluster formation function based on spatial constraint.
    int getiteration()
    Get iteration.
    int[] getmapping()
    Get latest computed mapping.
    private java.lang.Double getminband​(int a, int b)
    Get minimum available bandwidth between two nodes.
    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 last successful mapping.
    private void sendmessage​(network.Message m, int server)
    Send messages to servers.
    void setclustersize​(int fnodes1)
    Set cluster size.
    void setdisclose​(boolean a)
    Set disclosure
    void setduration​(int d)
    Set VNF lifecyle.
    void setiteration​(int s)
    Set iteration.
    void setmapping​(int[] m)
    Set latest computed mapping.
    void setmaxsfcsize​(int maxsize)
    Set maximum node size.
    void setprintmapping​(boolean b)
    Set true to print the output on screen.
    void setspatial​(boolean tf)
    Apply or deprecate spatial constraints.
    void setsubgraphid​(int a)
    Set subgraph id when the controller processes a VNF-subgraph that is a part of the incoming request
    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.Hypergraph net
      Network object.
    • iteration

      int iteration
      Simulation iteration, request ID.
    • sr

      int sr
      Size of domain registry.
    • servperrack

      int servperrack
      Servers per rack.
    • servercnt

      int[] servercnt
      Measures the cluster nodes sent to each server.
    • duration

      int duration
      VNF lifecycle duration.
    • clustersize

      int clustersize
      Size of the cluster of candidate hosts.
    • fnodes

      int fnodes
      Parameter to define cluster size.
    • mapping

      int[] mapping
      Latest produced mapping for last incoming request.
    • spatial

      boolean spatial
      Are there spatial constraints?
    • fitness

      java.lang.Double fitness
      Solution fitness.
    • vnfgraph

      services.VNFgraph vnfgraph
    • reject

      boolean reject
      Is request rejected?
    • printmapping

      boolean printmapping
      Print mapping?
    • solfound

      boolean solfound
      Solution found?
    • cod

      network.Codec cod
    • err

      java.lang.String err
      error message
    • msg0

      java.lang.Double[] msg0
      Messages to the agents.
    • recompute

      boolean recompute
      Recompute in case of failure?
    • solutionew

      double[] solutionew
      Solution edge weights in Edge Vector indexing.
    • currentmodel

      double[] currentmodel
      Current model in use.
    • subgraphid

      int subgraphid
      Subrequest id, when set >-1 the Hypergraph controller processes a VNF-subgraph par of the incoming request
    • disclose

      boolean disclose
      Disclose total domain capacity.
    • mode

      java.lang.Double mode
      Agent modes
    • maxsfcsize

      int maxsfcsize
      Maximum 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.