class_docstr: !
  @brief Oscillatory Neural Network with central element based on Hodgkin-Huxley neuron model.
  @details Interaction between oscillators is performed via central element (no connection between oscillators that
            are called as peripheral). Peripheral oscillators receive external stimulus. Central element consist of
            two oscillators: the first is used for synchronization some ensemble of oscillators and the second
            controls synchronization of the first central oscillator with various ensembles.
  
  Usage example where oscillatory network with 6 oscillators is used for simulation. The first two oscillators
  have the same stimulus, as well as the third and fourth oscillators and the last two. Thus three synchronous
  ensembles are expected after simulation.
  @code
      from pyclustering.nnet.hhn import hhn_network, hhn_parameters
      from pyclustering.nnet.dynamic_visualizer import dynamic_visualizer
  
      # Change period of time when high strength value of synaptic connection exists from CN2 to PN.
      params = hhn_parameters()
      params.deltah = 400
  
      # Create Hodgkin-Huxley oscillatory network with stimulus.
      net = hhn_network(6, [0, 0, 25, 25, 47, 47], params)
  
      # Simulate network.
      (t, dyn_peripheral, dyn_central) = net.simulate(2400, 600)
  
      # Visualize network's output (membrane potential of peripheral and central neurons).
      amount_canvases = 6 + 2  # 6 peripheral oscillator + 2 central elements
      visualizer = dynamic_visualizer(amount_canvases, x_title="Time", y_title="V", y_labels=False)
      visualizer.append_dynamics(t, dyn_peripheral, 0, True)
      visualizer.append_dynamics(t, dyn_central, amount_canvases - 2, True)
      visualizer.show()
  @endcode
  
  There is visualized result of simulation where three synchronous ensembles of oscillators can be observed. The
  first and the second oscillators form the first ensemble, the third and the fourth form the second ensemble and
  the last two oscillators form the third ensemble.
  @image html hhn_three_ensembles.png
class_docstr_tok: ["!","@","brief","Oscillatory","Neural","Network","with","central","element","based","on","Hodgkin-Huxley","neuron","model",".","@","details","Interaction","between","oscillators","is","performed","via","central","element","(","no","connection","between","oscillators","that","are","called","as","peripheral",")",".","Peripheral","oscillators","receive","external","stimulus",".","Central","element","consist","of","two","oscillators",":","the","first","is","used","for","synchronization","some","ensemble","of","oscillators","and","the","second","controls","synchronization","of","the","first","central","oscillator","with","various","ensembles",".","Usage","example","where","oscillatory","network","with","6","oscillators","is","used","for","simulation",".","The","first","two","oscillators","have","the","same","stimulus",",","as","well","as","the","third","and","fourth","oscillators","and","the","last","two",".","Thus","three","synchronous","ensembles","are","expected","after","simulation",".","@","code","from","pyclustering.nnet.hhn","import","hhn_network",",","hhn_parameters","from","pyclustering.nnet.dynamic_visualizer","import","dynamic_visualizer","#","Change","period","of","time","when","high","strength","value","of","synaptic","connection","exists","from","CN2","to","PN",".","params","=","hhn_parameters","(",")","params.deltah","=","400","#","Create","Hodgkin-Huxley","oscillatory","network","with","stimulus",".","net","=","hhn_network","(","6",",","[","0",",","0",",","25",",","25",",","47",",","47","]",",","params",")","#","Simulate","network",".","(","t",",","dyn_peripheral",",","dyn_central",")","=","net.simulate","(","2400",",","600",")","#","Visualize","network","'s","output","(","membrane","potential","of","peripheral","and","central","neurons",")",".","amount_canvases","=","6","+","2","#","6","peripheral","oscillator","+","2","central","elements","visualizer","=","dynamic_visualizer","(","amount_canvases",",","x_title=","''","Time","''",",","y_title=","''","V","''",",","y_labels=False",")","visualizer.append_dynamics","(","t",",","dyn_peripheral",",","0",",","True",")","visualizer.append_dynamics","(","t",",","dyn_central",",","amount_canvases","-","2",",","True",")","visualizer.show","(",")","@","endcode","There","is","visualized","result","of","simulation","where","three","synchronous","ensembles","of","oscillators","can","be","observed",".","The","first","and","the","second","oscillators","form","the","first","ensemble",",","the","third","and","the","fourth","form","the","second","ensemble","and","the","last","two","oscillators","form","the","third","ensemble",".","@","image","html","hhn_three_ensembles.png"]
docstr: !
  @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
  @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation.
            Python implementation uses 'odeint' from 'scipy', CCORE uses classical RK4 and RFK45 methods,
            therefore in case of CCORE HHN (Hodgkin-Huxley network) amount of steps should be greater than in
            case of Python HHN.
  
  @param[in] steps (uint): Number steps of simulations during simulation.
  @param[in] time (double): Time of simulation.
  @param[in] solution (solve_type): Type of solver for differential equations.
  
  @return (tuple) Dynamic of oscillatory network represented by (time, peripheral neurons dynamic, central elements
          dynamic), where types are (list, list, list).
docstr_tok: ["!","@","brief","Performs","static","simulation","of","oscillatory","network","based","on","Hodgkin-Huxley","neuron","model",".","@","details","Output","dynamic","is","sensible","to","amount","of","steps","of","simulation","and","solver","of","differential","equation",".","Python","implementation","uses","'odeint","'","from","'scipy","'",",","CCORE","uses","classical","RK4","and","RFK45","methods",",","therefore","in","case","of","CCORE","HHN","(","Hodgkin-Huxley","network",")","amount","of","steps","should","be","greater","than","in","case","of","Python","HHN",".","@","param","[","in","]","steps","(","uint",")",":","Number","steps","of","simulations","during","simulation",".","@","param","[","in","]","time","(","double",")",":","Time","of","simulation",".","@","param","[","in","]","solution","(","solve_type",")",":","Type","of","solver","for","differential","equations",".","@","return","(","tuple",")","Dynamic","of","oscillatory","network","represented","by","(","time",",","peripheral","neurons","dynamic",",","central","elements","dynamic",")",",","where","types","are","(","list",",","list",",","list",")","."]
code: def simulate_static(self, steps, time, solution=solve_type.RK4):
      """!
      @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model.
      @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation.
                Python implementation uses 'odeint' from 'scipy', CCORE uses classical RK4 and RFK45 methods,
                therefore in case of CCORE HHN (Hodgkin-Huxley network) amount of steps should be greater than in
                case of Python HHN.
  
      @param[in] steps (uint): Number steps of simulations during simulation.
      @param[in] time (double): Time of simulation.
      @param[in] solution (solve_type): Type of solver for differential equations.
  
      @return (tuple) Dynamic of oscillatory network represented by (time, peripheral neurons dynamic, central elements
              dynamic), where types are (list, list, list).
  
      """
  
      # Check solver before simulation
      if solution == solve_type.FAST:
          raise NameError(
              "Solver FAST is not support due to low accuracy that leads to huge error."
          )
  
      self._membrane_dynamic_pointer = None
  
      if self.__ccore_hhn_pointer is not None:
          self.__ccore_hhn_dynamic_pointer = wrapper.hhn_dynamic_create(
              True, False, False, False
          )
          wrapper.hhn_simulate(
              self.__ccore_hhn_pointer,
              steps,
              time,
              solution,
              self._stimulus,
              self.__ccore_hhn_dynamic_pointer,
          )
  
          peripheral_membrane_potential = (
              wrapper.hhn_dynamic_get_peripheral_evolution(
                  self.__ccore_hhn_dynamic_pointer, 0
              )
          )
          central_membrane_potential = (
              wrapper.hhn_dynamic_get_central_evolution(
                  self.__ccore_hhn_dynamic_pointer, 0
              )
          )
          dynamic_time = wrapper.hhn_dynamic_get_time(
              self.__ccore_hhn_dynamic_pointer
          )
  
          self._membrane_dynamic_pointer = peripheral_membrane_potential
  
          wrapper.hhn_dynamic_destroy(self.__ccore_hhn_dynamic_pointer)
  
          return (
              dynamic_time,
              peripheral_membrane_potential,
              central_membrane_potential,
          )
  
      if solution == solve_type.RKF45:
          raise NameError(
              "Solver RKF45 is not support in python version."
          )
  
      dyn_peripheral = [self._membrane_potential[:]]
      dyn_central = [[0.0, 0.0]]
      dyn_time = [0.0]
  
      step = time / steps
      int_step = step / 10.0
  
      for t in numpy.arange(step, time + step, step):
          # update states of oscillators
          (memb_peripheral, memb_central) = self._calculate_states(
              solution, t, step, int_step
          )
  
          # update states of oscillators
          dyn_peripheral.append(memb_peripheral)
          dyn_central.append(memb_central)
          dyn_time.append(t)
  
      self._membrane_dynamic_pointer = dyn_peripheral
      return dyn_time, dyn_peripheral, dyn_central
  
imports: from scipy.integrate import odeint
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.hhn_wrapper
  from pyclustering.nnet import *
  from pyclustering.utils import allocate_sync_ensembles
  import numpy
  import random
label_desc: Use image node_id 4 for calling the hhn_network obj's underlying member method code with example usage: obj.simulate_static(steps, time, solution) and returns: dyn_time,  dyn_peripheral,  dyn_central, dynamic_time,  peripheral_membrane_potential,  central_membrane_potential