Exemplo n.º 1
0
 def __init__(self, sample, radius, conn_repr = conn_represent.MATRIX, initial_phases = initial_type.RANDOM_GAUSSIAN, enable_conn_weight = False, ccore = False):
     """!
     @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;
     
     if (ccore is True):
         self.__ccore_network_pointer = syncnet_create_network(sample, radius, initial_phases, enable_conn_weight);
     else:
         super().__init__(len(sample), 1, 0, conn_type.DYNAMIC, initial_phases);
         
         self._conn_weight = None;
         self._ena_conn_weight = enable_conn_weight;
         self._osc_loc = sample;
         self._conn_represent = conn_repr;
         
         # Create connections.
         if (radius is not None):
             self._create_connections(radius);
Exemplo n.º 2
0
 def __init__(self, sample, radius, conn_repr = conn_represent.MATRIX, initial_phases = initial_type.RANDOM_GAUSSIAN, enable_conn_weight = False, ccore = False):
     """!
     @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;
     
     if (ccore is True):
         self.__ccore_network_pointer = syncnet_create_network(sample, radius, initial_phases, enable_conn_weight);
     else:
         super().__init__(len(sample), 1, 0, conn_type.DYNAMIC, initial_phases);
         
         self._conn_weight = None;
         self._ena_conn_weight = enable_conn_weight;
         self._osc_loc = sample;
         self._conn_represent = conn_repr;
         
         # Create connections.
         if (radius is not None):
             self._create_connections(radius);