Exemplo n.º 1
0
void legion_network::neuron_states(const double t, const differ_state<double> & inputs, const differ_extra<void *> & argv, differ_state<double> & outputs) {
	unsigned int index = *(unsigned int *) argv[1];

	const double x = inputs[0];
	const double y = inputs[1];
	const double p = inputs[2];

	double potential_influence = heaviside(p + std::exp(-m_params.alpha * t) - m_params.teta);

	double stumulus = 0.0;
	if ((*m_stimulus)[index] > 0) {
		stumulus = m_params.I;
	}

	double dx = 3.0 * x - std::pow(x, 3) + 2.0 - y + stumulus * potential_influence + m_oscillators[index].m_coupling_term + m_oscillators[index].m_noise;
	double dy = m_params.eps * (m_params.gamma * (1.0 + std::tanh(x / m_params.betta)) - y);

	std::vector<unsigned int> * neighbors = get_neighbors(index);
	double potential = 0.0;

	for (std::vector<unsigned int>::const_iterator index_iterator = neighbors->begin(); index_iterator != neighbors->end(); index_iterator++) {
		unsigned int index_neighbor = *index_iterator;
		potential += m_params.T * heaviside(m_oscillators[index_neighbor].m_excitatory - m_params.teta_x);
	}

	delete neighbors;

	double dp = m_params.lamda * (1 - p) * heaviside(potential - m_params.teta_p) - m_params.mu * p;

	outputs.clear();
	outputs.push_back(dx);
	outputs.push_back(dy);
	outputs.push_back(dp);
}
Exemplo n.º 2
0
void legion_network::inhibitor_state(const double t, const differ_state<double> & inputs, const differ_extra<void *> & argv, differ_state<double> & outputs) {
	const double z = inputs[0];

	double sigma = 0.0;
	for (unsigned int index = 0; index < size(); index++) {
		if (m_oscillators[index].m_excitatory > m_params.teta_zx) {
			sigma = 1.0;
			break;
		}
	}

	double dz = m_params.fi * (sigma - z);

	outputs.clear();
	outputs.push_back(dz);
}
Exemplo n.º 3
0
void legion_network::neuron_simplify_states(const double t, const differ_state<double> & inputs, const differ_extra<void *> & argv, differ_state<double> & outputs) {
	unsigned int index = *(unsigned int *) argv[1];

	const double x = inputs[0];
	const double y = inputs[1];

	double stumulus = 0.0;
	if ((*m_stimulus)[index] > 0) {
		stumulus = m_params.I;
	}

	double dx = 3.0 * x - std::pow(x, 3) + 2.0 - y + stumulus + m_oscillators[index].m_coupling_term + m_oscillators[index].m_noise;
	double dy = m_params.eps * (m_params.gamma * (1.0 + std::tanh(x / m_params.betta)) - y);

	outputs.clear();
	outputs.push_back(dx);
	outputs.push_back(dy);
}