void place_cell_generator::update(Time const & T, const long_t from, const long_t to)
{
    assert(to >= 0 && (delay) from < Scheduler::get_min_delay());
    assert(from < to);

    for (long_t lag = from; lag < to; ++lag)
    {
        long_t now = T.get_steps() + lag;

        if (device_.is_active(T + Time::step(lag)))
        {
            librandom::RngPtr rng = net_->get_rng(get_thread());
            ulong_t n_spikes = poisson_dev_.uldev(rng);

            if (n_spikes > 0) // we must not send events with multiplicity 0
            {
                nest::SpikeEvent se;
                se.set_multiplicity(n_spikes);
                network()->send(*this, se, lag);
            }

            // Advance the positional information if there is space in the
            // positional vector
            if (now >= next_pos_step) {
                next_pos_step = now + sim_dt_per_pos_dt;
                if (pos_it < P_.rat_pos_x.size() - 1)
                    pos_it++;
                setFiringRate();
            }
        }
    }
}
Ejemplo n.º 2
0
	void Neuron::updateFiringRateLinear()
	{
		// IDEA: it might speed things up to keep track of whether the 
		// input sum has changed, then only update things if it has.  
		// The Neuron::setFiringRate should at least avoid updating 
		// post-synaptic input sums when the firing rate hasn't changed.

		// Just use the linear function firing rate = input sum.
		setFiringRate(mSynapticInputSum);
	}
Ejemplo n.º 3
0
	void Neuron::updateFiringRateSigmoid()
	{
		// IDEA: it might speed things up to keep track of whether the 
		// input sum has changed, then only update things if it has.  
		// The Neuron::setFiringRate should at least avoid updating 
		// post-synaptic input sums when the firing rate hasn't changed.

		// Sigmoid function.  Avoid overflow.
		if (mSynapticInputSum < -500)
		{
			setFiringRate(0);
		}
		else if (mSynapticInputSum > 500)
		{
			setFiringRate(1);
		}
		else
		{
			setFiringRate(1 / (1 + globals::exp(-mSynapticInputSum)));
		}
	}
void place_cell_generator::calibrate()
{
    device_.calibrate();

    double sim_dt = Time::get_resolution().get_ms();

    // Calibrate how often to advance the positional index
    sim_dt_per_pos_dt = (int) (P_.rat_pos_dt / sim_dt);
    next_pos_step = sim_dt_per_pos_dt;
    pos_it = 0; 

    setFiringRate();
}