class_docstr: !
  @brief Hysteresis oscillatory network that uses relaxation oscillators that are represented by objective hysteresis neurons whose output in range [-1, +1].
  
  Examples:
  @code
      # create hysteresis oscillatory network with 5 oscillators.
      network = hysteresis_network(5);
      
      # set initial states (from range [-1, +1]).
      network.states = [1 0 1 0 1];
      
      # set initial outputs.
      network.outputs = [1 1 1 1 1];
      
      # perform simulation of the network during 1000 steps in 10 time units.
      output_dynamic = network.simulate(1000, 10);
      
      # show output dynamic of the network.
      hysteresis_visualizer.show_output_dynamic(output_dynamic);
      
      # obtain synchronous ensembles.
      ensembles = output_dynamic.allocate_sync_ensembles(tolerance = 0.5, threshold_steps = 5);
      print(ensembles);
  @endcode
class_docstr_tok: ["!","@","brief","Hysteresis","oscillatory","network","that","uses","relaxation","oscillators","that","are","represented","by","objective","hysteresis","neurons","whose","output","in","range","[","-1",",","+1","]",".","Examples",":","@","code","#","create","hysteresis","oscillatory","network","with","5","oscillators",".","network","=","hysteresis_network","(","5",")",";","#","set","initial","states","(","from","range","[","-1",",","+1","]",")",".","network.states","=","[","1","0","1","0","1","]",";","#","set","initial","outputs",".","network.outputs","=","[","1","1","1","1","1","]",";","#","perform","simulation","of","the","network","during","1000","steps","in","10","time","units",".","output_dynamic","=","network.simulate","(","1000",",","10",")",";","#","show","output","dynamic","of","the","network",".","hysteresis_visualizer.show_output_dynamic","(","output_dynamic",")",";","#","obtain","synchronous","ensembles",".","ensembles","=","output_dynamic.allocate_sync_ensembles","(","tolerance","=","0.5",",","threshold_steps","=","5",")",";","print","(","ensembles",")",";","@","endcode"]
docstr: !
  @brief Constructor of hysteresis oscillatory network.
  
  @param[in] num_osc (uint): Number of oscillators in the network.
  @param[in] own_weight (double): Weight of connection from oscillator to itself - own weight.
  @param[in] neigh_weight (double): Weight of connection between oscillators.
  @param[in] type_conn (conn_type): Type of connection between oscillators in the network.
  @param[in] type_conn_represent (conn_represent): Internal representation of connection in the network: matrix or list.
docstr_tok: ["!","@","brief","Constructor","of","hysteresis","oscillatory","network",".","@","param","[","in","]","num_osc","(","uint",")",":","Number","of","oscillators","in","the","network",".","@","param","[","in","]","own_weight","(","double",")",":","Weight","of","connection","from","oscillator","to","itself","-","own","weight",".","@","param","[","in","]","neigh_weight","(","double",")",":","Weight","of","connection","between","oscillators",".","@","param","[","in","]","type_conn","(","conn_type",")",":","Type","of","connection","between","oscillators","in","the","network",".","@","param","[","in","]","type_conn_represent","(","conn_represent",")",":","Internal","representation","of","connection","in","the","network",":","matrix","or","list","."]
code: def __init__(
      self,
      num_osc,
      own_weight=-4,
      neigh_weight=-1,
      type_conn=conn_type.ALL_TO_ALL,
      type_conn_represent=conn_represent.MATRIX,
  ):
      """!
      @brief Constructor of hysteresis oscillatory network.
  
      @param[in] num_osc (uint): Number of oscillators in the network.
      @param[in] own_weight (double): Weight of connection from oscillator to itself - own weight.
      @param[in] neigh_weight (double): Weight of connection between oscillators.
      @param[in] type_conn (conn_type): Type of connection between oscillators in the network.
      @param[in] type_conn_represent (conn_represent): Internal representation of connection in the network: matrix or list.
  
      """
  
      super().__init__(num_osc, type_conn, type_conn_represent)
  
      # list of states of neurons.
      self._states = [0] * self._num_osc
  
      # list of current outputs of neurons.
      self._outputs = [-1] * self._num_osc
  
      # list of previous outputs of neurons
      self._outputs_buffer = [-1] * self._num_osc
  
      # matrix of connection weights between neurons.
      self._weight = list()
      for index in range(0, self._num_osc, 1):
          self._weight.append([neigh_weight] * self._num_osc)
          self._weight[index][index] = own_weight
  
imports: import numpy
  import matplotlib.pyplot
  from scipy.integrate import odeint
  from pyclustering.nnet import *
  from pyclustering.utils import draw_dynamics
label_desc: Use image node_id 5 to create a new hysteresis_network object from inherited base classes: network with example: obj = hysteresis_network(num_osc, own_weight, neigh_weight, type_conn, type_conn_represent)