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 Returns new value of the neuron (oscillator).
  
  @param[in] inputs (list): Initial values (current) of the neuron - excitatory.
  @param[in] t (double): Current time of simulation.
  @param[in] argv (tuple): Extra arguments that are not used for integration - index of the neuron.
  
  @return (double) New value of the neuron.
docstr_tok: ["!","@","brief","Returns","new","value","of","the","neuron","(","oscillator",")",".","@","param","[","in","]","inputs","(","list",")",":","Initial","values","(","current",")","of","the","neuron","-","excitatory",".","@","param","[","in","]","t","(","double",")",":","Current","time","of","simulation",".","@","param","[","in","]","argv","(","tuple",")",":","Extra","arguments","that","are","not","used","for","integration","-","index","of","the","neuron",".","@","return","(","double",")","New","value","of","the","neuron","."]
code: def _neuron_states(self, inputs, t, argv):
      """!
      @brief Returns new value of the neuron (oscillator).
  
      @param[in] inputs (list): Initial values (current) of the neuron - excitatory.
      @param[in] t (double): Current time of simulation.
      @param[in] argv (tuple): Extra arguments that are not used for integration - index of the neuron.
  
      @return (double) New value of the neuron.
  
      """
  
      xi = inputs[0]
      index = argv
  
      # own impact
      impact = self._weight[index][index] * self._outputs[index]
  
      for i in range(0, self._num_osc, 1):
          if self.has_connection(i, index):
              impact += self._weight[index][i] * self._outputs[i]
  
      x = -xi + impact
  
      if xi > 1:
          self._outputs_buffer[index] = 1
      if xi < -1:
          self._outputs_buffer[index] = -1
  
      return x
  
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 6 for calling the hysteresis_network obj's underlying member method code with example usage: obj._neuron_states(inputs, t, argv) and returns: x