// function handles exact spike times
void
nest::iaf_psc_alpha_presc::handle( SpikeEvent& e )
{
  assert( e.get_delay() > 0 );

  const long_t Tdeliver = e.get_rel_delivery_steps(
    nest::kernel().simulation_manager.get_slice_origin() );

  const double_t spike_weight =
    V_.PSCInitialValue_ * e.get_weight() * e.get_multiplicity();
  const double_t dt = e.get_offset();

  // Building the new matrix for the offset of the spike
  // NOTE: We do not use get matrix, but compute only those
  //       components we actually need for spike registration
  // needed in any case
  const double_t ps_e_TauSyn = numerics::expm1( -dt / P_.tau_syn_ );
  const double_t ps_e_Tau = numerics::expm1( -dt / P_.tau_m_ );
  const double_t ps_P31 = V_.gamma_sq_ * ps_e_Tau - V_.gamma_sq_ * ps_e_TauSyn
    - dt * V_.gamma_ * ps_e_TauSyn - dt * V_.gamma_;

  B_.spike_y1_.add_value( Tdeliver, spike_weight * ps_e_TauSyn + spike_weight );
  B_.spike_y2_.add_value(
    Tdeliver, spike_weight * dt * ps_e_TauSyn + spike_weight * dt );
  B_.spike_y3_.add_value( Tdeliver, spike_weight * ps_P31 );
}
Exemplo n.º 2
0
void pif_psc_delta_canon_cvv::handle(SpikeEvent & e)
{
  assert(e.get_delay() > 0);

  /* We need to compute the absolute time stamp of the delivery time
     of the spike, since spikes might spend longer than min_delay_
     in the queue.  The time is computed according to Time Memo, Rule 3.
  */
  const long_t Tdeliver = e.get_stamp().get_steps() + e.get_delay() - 1;
  B_.events_.add_spike(e.get_rel_delivery_steps(network()->get_slice_origin()), 
		    Tdeliver, e.get_offset(), e.get_weight() * e.get_multiplicity());
}
// function handles exact spike times
void
parrot_neuron_ps::handle( SpikeEvent& e )
{
  // Repeat only spikes incoming on port 0, port 1 will be ignored
  if ( 0 == e.get_rport() )
  {
    assert( e.get_delay() > 0 );

    // We need to compute the absolute time stamp of the delivery time
    // of the spike, since spikes might spend longer than min_delay_
    // in the queue.  The time is computed according to Time Memo, Rule 3.
    const long_t Tdeliver = e.get_stamp().get_steps() + e.get_delay() - 1;

    // parrot ignores weight of incoming connection, store multiplicity
    B_.events_.add_spike(
      e.get_rel_delivery_steps(
        nest::kernel().simulation_manager.get_slice_origin() ),
      Tdeliver,
      e.get_offset(),
      static_cast< double_t >( e.get_multiplicity() ) );
  }
}