import initialisation
import iteration
from scipy.spatial import ConvexHull
from parameters import dt, tSim, N, S, p, num_fact, p_fact, dzeta, a_pf, eps, \
    f_russo, cm, a, U, w, tau_1, tau_2, tau_3_A, tau_3_B, g_A, beta, tau, \
    t_0, g, random_seed, set_name, p_0, n_p, nSnap

import matplotlib as mpl
import matplotlib.pyplot as plt
if os.environ.get('DISPLAY', '') == '':
    print('no display found. Using non-interactive Agg backend')
    mpl.use('Agg')

plt.ion()
plt.close('all')


ksi_i_mu, delta__ksi_i_mu__k \
    = patterns.get_from_file('pattern_generation_saved')
C1C2C0 = correlations.cross_correlations(ksi_i_mu, normalized=False)
data = C1C2C0[:, 0]
c_min = np.min(data)
c_max = np.max(data)
c_bins_Ale = np.arange(c_min, c_max, 1)
c_ticks_Ale = np.arange(c_min, c_max, max(1, int((c_max - c_min) / 15)))

plt.figure(1)
plt.hist(C1C2C0[:, 0], bins=c_bins_Ale, edgecolor='black', density=True)
plt.xticks(c_ticks_Ale)
plt.title(r"Ale's C algorithm, $a_{pf}=0.75$, $\zeta=0.02$")
Ejemplo n.º 2
0
# plt.tight_layout()

s = 2
shift = 1 / N / a / 5  # In order categories to be visible in scatter
lamb = np.array(crossovers)

low_cor = lamb < 0.3
l_low_cor = r'$\lambda < 0.3$'
mid_low_cor = np.logical_and(0.3 <= lamb, lamb < 0.5)
l_mid_low_cor = r'$0.3 \leq \lambda < 0.5$'
mid_high_cor = np.logical_and(0.5 <= lamb, lamb < 0.7)
l_mid_high_cor = r'$0.5 \leq \lambda < 0.7$'
high_cor = 0.7 <= lamb
l_high_cor = r'$0.7 \leq \lambda $'

C1C2C0 = correlations.cross_correlations(ksi_i_mu)

ax_order = 'xC1yC2'
if ax_order == 'xC1yC2':
    xx = correlations.active_same_state(ksi_i_mu[:, previous],
                                        ksi_i_mu[:, following])
    yy = correlations.active_diff_state(ksi_i_mu[:, previous],
                                        ksi_i_mu[:, following])
    zz = correlations.active_inactive(ksi_i_mu[:, previous],
                                      ksi_i_mu[:, following])
    XX = C1C2C0[:, 0]
    YY = C1C2C0[:, 1]
else:
    xx = correlations.active_diff_state(ksi_i_mu[:, previous],
                                        ksi_i_mu[:, following])
    yy = correlations.active_same_state(ksi_i_mu[:, previous],