本文整理汇总了C++中DSSpikeEvent::set_multiplicity方法的典型用法代码示例。如果您正苦于以下问题:C++ DSSpikeEvent::set_multiplicity方法的具体用法?C++ DSSpikeEvent::set_multiplicity怎么用?C++ DSSpikeEvent::set_multiplicity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DSSpikeEvent
的用法示例。
在下文中一共展示了DSSpikeEvent::set_multiplicity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
nest::mip_generator::event_hook( DSSpikeEvent& e )
{
// note: event_hook() receives a reference of the spike event that
// was originally created in the update function. there we set
// the multiplicty to store the number of mother spikes. the *same*
// reference will be delivered multiple times to the event hook,
// once for every receiver. when calling handle() of the receiver
// above, we need to change the multiplicty to the number of copied
// child process spikes, so afterwards it needs to be reset to correctly
// store the number of mother spikes again during the next call of event_hook().
// reichert
librandom::RngPtr rng = net_->get_rng( get_thread() );
ulong_t n_mother_spikes = e.get_multiplicity();
ulong_t n_spikes = 0;
for ( ulong_t n = 0; n < n_mother_spikes; n++ )
{
if ( rng->drand() < P_.p_copy_ )
n_spikes++;
}
if ( n_spikes > 0 )
{
e.set_multiplicity( n_spikes );
e.get_receiver().handle( e );
}
e.set_multiplicity( n_mother_spikes );
}
示例2: kernel
void
nest::poisson_generator::event_hook( DSSpikeEvent& e )
{
librandom::RngPtr rng = kernel().rng_manager.get_rng( get_thread() );
long n_spikes = V_.poisson_dev_.ldev( rng );
if ( n_spikes > 0 ) // we must not send events with multiplicity 0
{
e.set_multiplicity( n_spikes );
e.get_receiver().handle( e );
}
}
示例3: assert
void
nest::ppd_sup_generator::event_hook( DSSpikeEvent& e )
{
// get port number
const port prt = e.get_port();
// we handle only one port here, get reference to vector element
assert( 0 <= prt && static_cast< size_t >( prt ) < B_.age_distributions_.size() );
// age_distribution object propagates one time step and returns number of spikes
ulong_t n_spikes =
B_.age_distributions_[ prt ].update( V_.hazard_step_t_, net_->get_rng( get_thread() ) );
if ( n_spikes > 0 ) // we must not send events with multiplicity 0
{
e.set_multiplicity( n_spikes );
e.get_receiver().handle( e );
}
}
示例4: assert
void nest::mip_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 )
{
if ( !device_.is_active(T) || P_.rate_ <= 0 )
return; // no spikes to be generated
// generate spikes of mother process for each time slice
ulong_t n_mother_spikes = V_.poisson_dev_.uldev(P_.rng_);
if ( n_mother_spikes )
{
DSSpikeEvent se;
se.set_multiplicity(n_mother_spikes);
network()->send(*this, se, lag);
}
}
}
示例5: assert
void
nest::spike_dilutor::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 )
{
if ( !device_.is_active( T ) )
return; // no spikes to be repeated
// generate spikes of mother process for each time slice
ulong_t n_mother_spikes = static_cast< ulong_t >( B_.n_spikes_.get_value( lag ) );
if ( n_mother_spikes )
{
DSSpikeEvent se;
se.set_multiplicity( n_mother_spikes );
network()->send( *this, se, lag );
}
}
}