def sync_local_order(self): """! @brief Calculates level of local (partial) synchronization in the network. @return (double) Level of local (partial) synchronization. @see sync_order() """ if (self._ccore_network_pointer is not None): return wrapper.sync_local_order(self._ccore_network_pointer) exp_amount = 0.0 num_neigh = 0 for i in range(0, self._num_osc, 1): for j in range(0, self._num_osc, 1): if (self.has_connection(i, j) == True): exp_amount += math.exp(-abs(self._phases[j] - self._phases[i])) num_neigh += 1 if (num_neigh == 0): num_neigh = 1 return exp_amount / num_neigh
def sync_local_order(self): """! @brief Calculates level of local (partial) synchronization in the network. @return (double) Level of local (partial) synchronization. @see sync_order() """ if (self._ccore_network_pointer is not None): return wrapper.sync_local_order(self._ccore_network_pointer); exp_amount = 0.0; num_neigh = 0; for i in range(0, self._num_osc, 1): for j in range(0, self._num_osc, 1): if (self.has_connection(i, j) == True): exp_amount += math.exp(-abs(self._phases[j] - self._phases[i])); num_neigh += 1; if (num_neigh == 0): num_neigh = 1; return exp_amount / num_neigh;
def sync_local_order(self): """! @brief Calculates current level of local (partial) synchronization in the network. @return (double) Level of local (partial) synchronization. @see sync_order() """ if (self._ccore_network_pointer is not None): return wrapper.sync_local_order(self._ccore_network_pointer); return order_estimator.calculate_local_sync_order(self._phases, self);