class_docstr: !
  @brief Chaotic neural network based on system of logistic map where clustering phenomenon can be observed.
  @details Here is an example how to perform cluster analysis using chaotic neural network:
  @code
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.samples.definitions import SIMPLE_SAMPLES
      from pyclustering.utils import read_sample
      from pyclustering.nnet.cnn import cnn_network, cnn_visualizer
  
      # Load stimulus from file.
      stimulus = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)
  
      # Create chaotic neural network, amount of neurons should be equal to amount of stimulus.
      network_instance = cnn_network(len(stimulus))
  
      # Perform simulation during 100 steps.
      steps = 100
      output_dynamic = network_instance.simulate(steps, stimulus)
  
      # Display output dynamic of the network.
      cnn_visualizer.show_output_dynamic(output_dynamic)
  
      # Display dynamic matrix and observation matrix to show clustering phenomenon.
      cnn_visualizer.show_dynamic_matrix(output_dynamic)
      cnn_visualizer.show_observation_matrix(output_dynamic)
  
      # Visualize clustering results.
      clusters = output_dynamic.allocate_sync_ensembles(10)
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, stimulus)
      visualizer.show()
  @endcode
class_docstr_tok: ["!","@","brief","Chaotic","neural","network","based","on","system","of","logistic","map","where","clustering","phenomenon","can","be","observed",".","@","details","Here","is","an","example","how","to","perform","cluster","analysis","using","chaotic","neural","network",":","@","code","from","pyclustering.cluster","import","cluster_visualizer","from","pyclustering.samples.definitions","import","SIMPLE_SAMPLES","from","pyclustering.utils","import","read_sample","from","pyclustering.nnet.cnn","import","cnn_network",",","cnn_visualizer","#","Load","stimulus","from","file",".","stimulus","=","read_sample","(","SIMPLE_SAMPLES.SAMPLE_SIMPLE3",")","#","Create","chaotic","neural","network",",","amount","of","neurons","should","be","equal","to","amount","of","stimulus",".","network_instance","=","cnn_network","(","len","(","stimulus",")",")","#","Perform","simulation","during","100","steps",".","steps","=","100","output_dynamic","=","network_instance.simulate","(","steps",",","stimulus",")","#","Display","output","dynamic","of","the","network",".","cnn_visualizer.show_output_dynamic","(","output_dynamic",")","#","Display","dynamic","matrix","and","observation","matrix","to","show","clustering","phenomenon",".","cnn_visualizer.show_dynamic_matrix","(","output_dynamic",")","cnn_visualizer.show_observation_matrix","(","output_dynamic",")","#","Visualize","clustering","results",".","clusters","=","output_dynamic.allocate_sync_ensembles","(","10",")","visualizer","=","cluster_visualizer","(",")","visualizer.append_clusters","(","clusters",",","stimulus",")","visualizer.show","(",")","@","endcode"]
docstr: !
  @brief Simulates chaotic neural network with extrnal stimulus during specified steps.
  @details Stimulus are considered as a coordinates of neurons and in line with that weights
           are initialized.
  
  @param[in] steps (uint): Amount of steps for simulation.
  @param[in] stimulus (list): Stimulus that are used for simulation.
  
  @return (cnn_dynamic) Output dynamic of the chaotic neural network.
docstr_tok: ["!","@","brief","Simulates","chaotic","neural","network","with","extrnal","stimulus","during","specified","steps",".","@","details","Stimulus","are","considered","as","a","coordinates","of","neurons","and","in","line","with","that","weights","are","initialized",".","@","param","[","in","]","steps","(","uint",")",":","Amount","of","steps","for","simulation",".","@","param","[","in","]","stimulus","(","list",")",":","Stimulus","that","are","used","for","simulation",".","@","return","(","cnn_dynamic",")","Output","dynamic","of","the","chaotic","neural","network","."]
code: def simulate(self, steps, stimulus):
      """!
      @brief Simulates chaotic neural network with extrnal stimulus during specified steps.
      @details Stimulus are considered as a coordinates of neurons and in line with that weights
               are initialized.
  
      @param[in] steps (uint): Amount of steps for simulation.
      @param[in] stimulus (list): Stimulus that are used for simulation.
  
      @return (cnn_dynamic) Output dynamic of the chaotic neural network.
  
      """
  
      self.__create_weights(stimulus)
      self.__location = stimulus
  
      dynamic = cnn_dynamic([], [])
      dynamic.output.append(self.__output)
      dynamic.time.append(0)
  
      for step in range(1, steps, 1):
          self.__output = self.__calculate_states()
  
          dynamic.output.append(self.__output)
          dynamic.time.append(step)
  
      return dynamic
  
imports: import math
  import numpy
  import random
  import matplotlib.pyplot
  from matplotlib import rcParams
  from matplotlib.font_manager import FontProperties
  from mpl_toolkits.mplot3d import Axes3D
  from enum import IntEnum
  from scipy.spatial import Delaunay
  from pyclustering.utils import euclidean_distance_square, average_neighbor_distance, heaviside, draw_dynamics
label_desc: Use image node_id 3 for calling the cnn_network obj's underlying member method code with example usage: obj.simulate(steps, stimulus) and returns: dynamic