class_docstr: !
  @brief Class represents clustering algorithm SyncNet. 
  @details SyncNet is bio-inspired algorithm that is based on oscillatory network that uses modified Kuramoto model. Each attribute of a data object
           is considered as a phase oscillator.
  
  Example:
  @code
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.cluster.syncnet import syncnet, solve_type
      from pyclustering.samples.definitions import SIMPLE_SAMPLES
      from pyclustering.utils import read_sample
  
      # Read sample for clustering from some file.
      sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)
  
      # Create oscillatory network with connectivity radius 1.0.
      network = syncnet(sample, 1.0)
  
      # Run cluster analysis and collect output dynamic of the oscillatory network.
      # Network simulation is performed by Runge Kutta 4.
      analyser = network.process(0.998, solve_type.RK4)
  
      # Show oscillatory network.
      network.show_network()
  
      # Obtain clustering results.
      clusters = analyser.allocate_clusters()
  
      # Visualize clustering results.
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
class_docstr_tok: ["!","@","brief","Class","represents","clustering","algorithm","SyncNet",".","@","details","SyncNet","is","bio-inspired","algorithm","that","is","based","on","oscillatory","network","that","uses","modified","Kuramoto","model",".","Each","attribute","of","a","data","object","is","considered","as","a","phase","oscillator",".","Example",":","@","code","from","pyclustering.cluster","import","cluster_visualizer","from","pyclustering.cluster.syncnet","import","syncnet",",","solve_type","from","pyclustering.samples.definitions","import","SIMPLE_SAMPLES","from","pyclustering.utils","import","read_sample","#","Read","sample","for","clustering","from","some","file",".","sample","=","read_sample","(","SIMPLE_SAMPLES.SAMPLE_SIMPLE3",")","#","Create","oscillatory","network","with","connectivity","radius","1.0.","network","=","syncnet","(","sample",",","1.0",")","#","Run","cluster","analysis","and","collect","output","dynamic","of","the","oscillatory","network",".","#","Network","simulation","is","performed","by","Runge","Kutta","4.","analyser","=","network.process","(","0.998",",","solve_type.RK4",")","#","Show","oscillatory","network",".","network.show_network","(",")","#","Obtain","clustering","results",".","clusters","=","analyser.allocate_clusters","(",")","#","Visualize","clustering","results",".","visualizer","=","cluster_visualizer","(",")","visualizer.append_clusters","(","clusters",",","sample",")","visualizer.show","(",")","@","endcode"]
docstr: !
  @brief Contructor of the oscillatory network SYNC for cluster analysis.
  
  @param[in] sample (list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
  @param[in] radius (double): Connectivity radius between points, points should be connected if distance between them less then the radius.
  @param[in] conn_repr (conn_represent): Internal representation of connection in the network: matrix or list. Ignored in case of usage of CCORE library.
  @param[in] initial_phases (initial_type): Type of initialization of initial phases of oscillators (random, uniformly distributed, etc.).
  @param[in] enable_conn_weight (bool): If True - enable mode when strength between oscillators depends on distance between two oscillators.
        If False - all connection between oscillators have the same strength that equals to 1 (True).
  @param[in] ccore (bool): Defines should be CCORE C++ library used instead of Python code or not.
docstr_tok: ["!","@","brief","Contructor","of","the","oscillatory","network","SYNC","for","cluster","analysis",".","@","param","[","in","]","sample","(","list",")",":","Input","data","that","is","presented","as","list","of","points","(","objects",")",",","each","point","should","be","represented","by","list","or","tuple",".","@","param","[","in","]","radius","(","double",")",":","Connectivity","radius","between","points",",","points","should","be","connected","if","distance","between","them","less","then","the","radius",".","@","param","[","in","]","conn_repr","(","conn_represent",")",":","Internal","representation","of","connection","in","the","network",":","matrix","or","list",".","Ignored","in","case","of","usage","of","CCORE","library",".","@","param","[","in","]","initial_phases","(","initial_type",")",":","Type","of","initialization","of","initial","phases","of","oscillators","(","random",",","uniformly","distributed",",","etc.",")",".","@","param","[","in","]","enable_conn_weight","(","bool",")",":","If","True","-","enable","mode","when","strength","between","oscillators","depends","on","distance","between","two","oscillators",".","If","False","-","all","connection","between","oscillators","have","the","same","strength","that","equals","to","1","(","True",")",".","@","param","[","in","]","ccore","(","bool",")",":","Defines","should","be","CCORE","C++","library","used","instead","of","Python","code","or","not","."]
code: def __init__(
      self,
      sample,
      radius,
      conn_repr=conn_represent.MATRIX,
      initial_phases=initial_type.RANDOM_GAUSSIAN,
      enable_conn_weight=False,
      ccore=True,
  ):
      """!
      @brief Contructor of the oscillatory network SYNC for cluster analysis.
  
      @param[in] sample (list): Input data that is presented as list of points (objects), each point should be represented by list or tuple.
      @param[in] radius (double): Connectivity radius between points, points should be connected if distance between them less then the radius.
      @param[in] conn_repr (conn_represent): Internal representation of connection in the network: matrix or list. Ignored in case of usage of CCORE library.
      @param[in] initial_phases (initial_type): Type of initialization of initial phases of oscillators (random, uniformly distributed, etc.).
      @param[in] enable_conn_weight (bool): If True - enable mode when strength between oscillators depends on distance between two oscillators.
            If False - all connection between oscillators have the same strength that equals to 1 (True).
      @param[in] ccore (bool): Defines should be CCORE C++ library used instead of Python code or not.
  
      """
  
      self._ccore_network_pointer = None
      self._osc_loc = sample
      self._num_osc = len(sample)
  
      self._verify_arguments()
  
      if (ccore is True) and ccore_library.workable():
          self._ccore_network_pointer = syncnet_create_network(
              sample, radius, initial_phases, enable_conn_weight
          )
  
          # Default representation that is returned by CCORE is matrix.
          self._conn_represent = conn_represent.MATRIX
  
      else:
          super().__init__(
              len(sample),
              1,
              0,
              conn_type.DYNAMIC,
              conn_repr,
              initial_phases,
              False,
          )
  
          self._conn_weight = None
          self._ena_conn_weight = enable_conn_weight
  
          # Create connections.
          if radius is not None:
              self._create_connections(radius)
  
imports: import math
  import matplotlib.pyplot
  import matplotlib.animation
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.cluster import cluster_visualizer
  from pyclustering.core.syncnet_wrapper import syncnet_create_network, syncnet_process, syncnet_destroy_network, syncnet_analyser_destroy
  from pyclustering.core.sync_wrapper import sync_connectivity_matrix
  from pyclustering.core.wrapper import ccore_library
  from pyclustering.nnet.sync import sync_dynamic, sync_network, sync_visualizer
  from pyclustering.nnet import conn_represent, initial_type, conn_type, solve_type
  from pyclustering.utils import euclidean_distance
label_desc: Use image node_id 1 to create a new syncnet object from inherited base classes: sync_network with example: obj = syncnet(sample, radius, conn_repr, initial_phases, enable_conn_weight, ccore)