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 Calculates new states for neurons using differential calculus. Returns new states for neurons.
  
  @param[in] solution (solve_type): Type solver of the differential equation.
  @param[in] t (double): Current time of simulation.
  @param[in] step (double): Step of solution at the end of which states of oscillators should be calculated.
  @param[in] int_step (double): Step differentiation that is used for solving differential equation.
  
  @return (list) New states for neurons.
docstr_tok: ["!","@","brief","Calculates","new","states","for","neurons","using","differential","calculus",".","Returns","new","states","for","neurons",".","@","param","[","in","]","solution","(","solve_type",")",":","Type","solver","of","the","differential","equation",".","@","param","[","in","]","t","(","double",")",":","Current","time","of","simulation",".","@","param","[","in","]","step","(","double",")",":","Step","of","solution","at","the","end","of","which","states","of","oscillators","should","be","calculated",".","@","param","[","in","]","int_step","(","double",")",":","Step","differentiation","that","is","used","for","solving","differential","equation",".","@","return","(","list",")","New","states","for","neurons","."]
code: def _calculate_states(self, solution, t, step, int_step):
      """!
      @brief Calculates new states for neurons using differential calculus. Returns new states for neurons.
  
      @param[in] solution (solve_type): Type solver of the differential equation.
      @param[in] t (double): Current time of simulation.
      @param[in] step (double): Step of solution at the end of which states of oscillators should be calculated.
      @param[in] int_step (double): Step differentiation that is used for solving differential equation.
  
      @return (list) New states for neurons.
  
      """
  
      next_states = [0] * self._num_osc
  
      for index in range(0, self._num_osc, 1):
          result = odeint(
              self._neuron_states,
              self._states[index],
              numpy.arange(t - step, t, int_step),
              (index,),
          )
          next_states[index] = result[len(result) - 1][0]
  
      self._outputs = [val for val in self._outputs_buffer]
      return next_states
  
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 9 for calling the hysteresis_network obj's underlying member method code with example usage: obj._calculate_states(solution, t, step, int_step) and returns: next_states