class_docstr: !
  @brief Model of oscillatory network that is based on the Kuramoto model of synchronization.
  
  @details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
docstr: !
  @brief Calculates current level of global synchorization (order parameter) in the network.
  @details This parameter is tend 1.0 when the oscillatory network close to global synchronization and it tend to 0.0 when 
            desynchronization is observed in the network. Order parameter is calculated using following equation:
            
            [
            r_{c}=rac{1}{Ne^{iarphi }}\sum_{j=0}^{N}e^{i        heta_{j}};
            ]
            
            where $arphi$ is a average phase coordinate in the network, $N$ is an amount of oscillators in the network.
  
  Example:
  @code
      oscillatory_network = sync(16, type_conn = conn_type.ALL_TO_ALL);
      output_dynamic = oscillatory_network.simulate_static(100, 10);
      
      if (oscillatory_network.sync_order() < 0.9): print("Global synchronization is not reached yet.");
      else: print("Global synchronization is reached.");
  @endcode
  
  @return (double) Level of global synchronization (order parameter).
  
  @see sync_local_order()
docstr_tok: ["!","@","brief","Calculates","current","level","of","global","synchorization","(","order","parameter",")","in","the","network",".","@","details","This","parameter","is","tend","1.0","when","the","oscillatory","network","close","to","global","synchronization","and","it","tend","to","0.0","when","desynchronization","is","observed","in","the","network",".","Order","parameter","is","calculated","using","following","equation",":","[","r_","{","c","}","=","rac","{","1","}","{","Ne^","{","i","arphi","}","}","\\sum_","{","j=0","}","^","{","N","}","e^","{","i","heta_","{","j","}","}",";","]","where","$","arphi","$","is","a","average","phase","coordinate","in","the","network",",","$","N","$","is","an","amount","of","oscillators","in","the","network",".","Example",":","@","code","oscillatory_network","=","sync","(","16",",","type_conn","=","conn_type.ALL_TO_ALL",")",";","output_dynamic","=","oscillatory_network.simulate_static","(","100",",","10",")",";","if","(","oscillatory_network.sync_order","(",")","<","0.9",")",":","print","(","``","Global","synchronization","is","not","reached","yet",".","``",")",";","else",":","print","(","``","Global","synchronization","is","reached",".","``",")",";","@","endcode","@","return","(","double",")","Level","of","global","synchronization","(","order","parameter",")",".","@","see","sync_local_order","(",")"]
code: def sync_order(self):
      """!
      @brief Calculates current level of global synchorization (order parameter) in the network.
      @details This parameter is tend 1.0 when the oscillatory network close to global synchronization and it tend to 0.0 when
                desynchronization is observed in the network. Order parameter is calculated using following equation:
  
                \f[
                r_{c}=\frac{1}{Ne^{i\varphi }}\sum_{j=0}^{N}e^{i\theta_{j}};
                \f]
  
                where \f$\varphi\f$ is a average phase coordinate in the network, \f$N\f$ is an amount of oscillators in the network.
  
      Example:
      @code
          oscillatory_network = sync(16, type_conn = conn_type.ALL_TO_ALL);
          output_dynamic = oscillatory_network.simulate_static(100, 10);
  
          if (oscillatory_network.sync_order() < 0.9): print("Global synchronization is not reached yet.");
          else: print("Global synchronization is reached.");
      @endcode
  
      @return (double) Level of global synchronization (order parameter).
  
      @see sync_local_order()
  
      """
  
      if self._ccore_network_pointer is not None:
          return wrapper.sync_order(self._ccore_network_pointer)
  
      return order_estimator.calculate_sync_order(self._phases)
  
imports: import math
  import numpy
  import random
  import matplotlib.pyplot
  import matplotlib.animation
  import pyclustering.core.sync_wrapper
  from pyclustering.core.wrapper import ccore_library
  from scipy.integrate import odeint
  from pyclustering.nnet import network, conn_represent, conn_type, initial_type, solve_type
  from pyclustering.utils import pi, draw_dynamics, draw_dynamics_set, set_ax_param
label_desc: Use image node_id 3 for calling the sync_network obj's underlying member method code with example usage: obj.sync_order() and returns: order_estimator, wrapper