NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Private Attributes | List of all members
nest::StimulatingDevice< EmittedEvent > Class Template Reference

Base class for common properties of Stimulating Devices. More...

#include <stimulating_device.h>

Inheritance diagram for nest::StimulatingDevice< EmittedEvent >:
nest::Device

Public Member Functions

 StimulatingDevice ()
 
 StimulatingDevice (StimulatingDevice< EmittedEvent > const &)
 
virtual ~StimulatingDevice ()
 
bool is_active (const Time &) const
 Determine whether device is active. More...
 
void get_status (DictionaryDatum &d) const
 
void enforce_single_syn_type (synindex)
 Throws IllegalConnection if synapse id differs from initial synapse id. More...
 
template<>
bool is_active (const Time &T) const
 Returns true if the device is active at the given time stamp. More...
 
template<>
bool is_active (const Time &T) const
 Returns true if the device is active at the given time stamp. More...
 
template<>
bool is_active (const Time &T) const
 Returns true if the device is active at the given time stamp. More...
 
- Public Member Functions inherited from nest::Device
 Device ()
 
 Device (const Device &n)
 
virtual ~Device ()
 
virtual void init_parameters (const Device &)
 Reset parameters to those of model; also resets state. More...
 
virtual void init_state (const Device &)
 Reset dynamic state to that of model. More...
 
virtual void init_buffers ()
 Reset buffers. More...
 
virtual void calibrate ()
 Set internal variables, including opening files. More...
 
virtual void finalize ()
 Housekeeping at end of simulation, eg close files. More...
 
virtual void set_status (const DictionaryDatum &)
 
long_t get_t_min_ () const
 Return lower limit in steps. More...
 
long_t get_t_max_ () const
 Return upper limit in steps. More...
 
Time const & get_origin () const
 
Time const & get_start () const
 
Time const & get_stop () const
 

Private Attributes

synindex first_syn_id_
 Synapse type of the first outgoing connection made by the Device. More...
 

Detailed Description

template<typename EmittedEvent>
class nest::StimulatingDevice< EmittedEvent >

Base class for common properties of Stimulating Devices.

Stimulating devices are all devices injecting currents, spike trains or other signals into a network. They provide only output and do not receive any input.

Stimulating devices come in (at least) two varieties: those providing analog signals (CurrentEvent) and thos providing spike trains (SpikeEvent). Device activation needs to be handled differently in both cases. The general principle is that of the left-open, right-closed interval (start, stop]. For devices emitting spikes, spikes with times in that interval will be emitted.

For analog stimuli, e.g., currents, a stimulus is present in the interval (t, t+h], where h is the simulation resolution, if the effect of the stimulus can be observed at t+h. Thus, if a stimulus is to be active from time a, its effect will first be observable at a+h. This requires that the Event communicating the stimulus must be delivered at time a, i.e., by the deliver_events() call prior to the update for (a, a+h].

Since stimulating devices are connected to their targets with a delay of one time step, this means that analog stimulating devices need to emit the event during the update step for the interval (a-h, a]. Thus, the device needs to be PRO-ACTIVE.

Further, activity of stimulating devices is determined on the basis of simulation time, not event time stamps. This means that the first simulation time step during which the device must emit events is the step for which the global clock has time a-h. If stimulation is to end by time b, this means that the last event should be emitted during the time step for which the global clock has time b-2h.

Note
Any stimulating devices transmitting analog signals must NOT HAVE PROXIES.
The distinction between analog and spike emitting devices is implemented by making StimulatingDevice a template class with the type of the Event sent as template parameter. Member is_active() is not implemented in general and is available only for those cases for which it is explicitly specialized.
StimulatingDevice inherits protected from Device, so that implementations of is_active() can access t_min and t_max.
Todo:
The timing of analog devices is correct only if they are transmitted using Network::send_local(), but we cannot enforce this currently.

Constructor & Destructor Documentation

template<typename EmittedEvent >
nest::StimulatingDevice< EmittedEvent >::StimulatingDevice ( )
template<typename EmittedEvent>
nest::StimulatingDevice< EmittedEvent >::StimulatingDevice ( StimulatingDevice< EmittedEvent > const &  sd)
template<typename EmittedEvent>
virtual nest::StimulatingDevice< EmittedEvent >::~StimulatingDevice ( )
inlinevirtual

Member Function Documentation

template<typename EmittedEvent >
void nest::StimulatingDevice< EmittedEvent >::enforce_single_syn_type ( synindex  syn_id)
inline

Throws IllegalConnection if synapse id differs from initial synapse id.

References nest::invalid_synindex.

template<typename EmittedEvent >
void nest::StimulatingDevice< EmittedEvent >::get_status ( DictionaryDatum d) const
inlinevirtual

Reimplemented from nest::Device.

References nest::names::element_type, and nest::names::stimulator.

template<typename EmittedEvent>
bool nest::StimulatingDevice< EmittedEvent >::is_active ( const Time ) const
virtual

Determine whether device is active.

The argument is the value of the simulation time.

See also
class comment for details.

Implements nest::Device.

template<>
bool nest::StimulatingDevice< nest::CurrentEvent >::is_active ( const Time T) const
inlinevirtual

Returns true if the device is active at the given time stamp.

Semantics are implemented by subclasses.

Implements nest::Device.

References nest::Time::get_steps().

template<>
bool nest::StimulatingDevice< nest::DoubleDataEvent >::is_active ( const Time T) const
inlinevirtual

Returns true if the device is active at the given time stamp.

Semantics are implemented by subclasses.

Implements nest::Device.

References nest::Time::get_steps().

template<>
bool nest::StimulatingDevice< nest::SpikeEvent >::is_active ( const Time T) const
inlinevirtual

Returns true if the device is active at the given time stamp.

Semantics are implemented by subclasses.

Implements nest::Device.

References nest::Time::get_steps().

Member Data Documentation

template<typename EmittedEvent>
synindex nest::StimulatingDevice< EmittedEvent >::first_syn_id_
private

Synapse type of the first outgoing connection made by the Device.

Used to check that devices connect using only a single synapse type, see #481 and #737. Since this value must survive resets, it is stored here, even though it is an implementation detail.


The documentation for this class was generated from the following file: