Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
auryn::Connection Class Referenceabstract

The abstract base class for all Connection objects in Auryn. More...

#include <Connection.h>

Inheritance diagram for auryn::Connection:
Inheritance graph
[legend]
Collaboration diagram for auryn::Connection:
Collaboration graph
[legend]

Public Member Functions

 Connection ()
 
 Connection (NeuronID rows, NeuronID cols)
 
 Connection (SpikingGroup *source, NeuronGroup *destination, TransmitterType transmitter=GLUT, std::string name="Connection")
 
virtual ~Connection ()
 
void set_size (NeuronID i, NeuronID j)
 
void set_name (std::string name)
 Set name of connection. More...
 
std::string get_name ()
 Returns name of connection. More...
 
std::string get_file_name ()
 Extracts the class name of the connection from the file name. More...
 
std::string get_log_name ()
 Returns a string which is the combination of file and connection name for logging. More...
 
AurynStateVectorget_target_vector ()
 Returns target state vector if one is defined. More...
 
NeuronID get_m_rows ()
 Get number of rows (presynaptic) in connection. More...
 
NeuronID get_n_cols ()
 Get number of columns (postsynaptic) in connection. More...
 
TransmitterType get_transmitter ()
 Returns transmitter type. More...
 
void set_target (AurynWeight *ptr)
 Sets target state of this connection directly via a pointer. More...
 
void set_target (AurynStateVector *ptr)
 Sets target state of this connection directly via a StateVector. More...
 
void set_receptor (AurynStateVector *ptr)
 Same as set_target. More...
 
void set_transmitter (AurynStateVector *ptr)
 Same as set_target. More...
 
void set_transmitter (TransmitterType transmitter)
 Sets target state of this connection for a given receptor as one of Auryn's default transmitter types. More...
 
void set_receptor (string state_name)
 Sets target state of this connection directly the name of a state vector. More...
 
void set_target (string state_name)
 Same as set_receptor. More...
 
void set_transmitter (string state_name)
 Same as set_receptor, but DEPRECATED. More...
 
void set_source (SpikingGroup *source)
 Sets source SpikingGroup of this connection. More...
 
SpikingGroupget_source ()
 Returns pointer to the presynaptic group. More...
 
void set_destination (NeuronGroup *source)
 Sets destination SpikingGroup of this connection. More...
 
NeuronGroupget_destination ()
 Returns pointer to the postsynaptic group. More...
 
virtual AurynWeight get (NeuronID i, NeuronID j)=0
 Get weight value i,j if it exists. Otherwise the value is undefined. More...
 
virtual AurynWeightget_ptr (NeuronID i, NeuronID j)=0
 Return pointer to weight element i,j if it exists, otherwise return NULL. More...
 
virtual AurynWeight get_data (NeuronID i)=0
 Return weight element as index in data array. More...
 
virtual void set (NeuronID i, NeuronID j, AurynWeight value)=0
 Set existing weight element i,j with value. More...
 
virtual AurynLong get_nonzero ()=0
 Return number of nonzero elements in this Connection. More...
 
virtual void finalize ()=0
 Finalize Connection after initialization to prepare for use in simulation. More...
 
virtual void propagate ()=0
 Propagate method to propagate spikes. Called by System run method. More...
 
virtual void evolve ()
 Evolve method to update internal connection state. Called by System run method. More...
 
void conditional_propagate ()
 DEPRECATED. (Such connections should not be registered in the first place) Calls propagate only if the postsynaptic NeuronGroup exists on the local rank. More...
 
Traceget_pre_trace (const AurynDouble tau)
 Returns a pointer to a presynaptic trace object. More...
 
Traceget_post_trace (const AurynDouble tau)
 Returns a pointer to a postsynaptic trace object. More...
 
Traceget_post_state_trace (const string state_name, const AurynDouble tau, const AurynDouble jump_size=0.0)
 Returns a pointer to a postsynaptic state trace object. More...
 
virtual void stats (AurynDouble &mean, AurynDouble &std, StateID zid=0)=0
 Computes mean synaptic weight and std dev of all weights in this connection. More...
 
virtual bool write_to_file (std::string filename)=0
 Implements save to file functionality. Also called in save_network_state from System class. More...
 
virtual bool load_from_file (std::string filename)=0
 Implements load from file functionality. Also called in save_network_state from System class. More...
 
void transmit (const NeuronID id, const AurynWeight amount)
 Default way to transmit a spike to a postsynaptic partner. More...
 
void targeted_transmit (SpikingGroup *target_group, AurynStateVector *target_state, const NeuronID id, const AurynWeight amount)
 Transmits a spike to a given target group and state. More...
 
void safe_transmit (NeuronID id, AurynWeight amount)
 Same as transmit but first checks if the target neuron exists and avoids segfaults that way (but it's also slower). More...
 
SpikeContainerget_pre_spikes ()
 Supplies pointer to SpikeContainer of all presynaptic spikes. More...
 
SpikeContainerget_post_spikes ()
 Returns pointer to SpikeContainer for postsynaptic spikes on this node. More...
 
void add_number_of_spike_attributes (int x)
 Set up spike delay to accomodate x additional spike attributes. More...
 
AurynFloat get_spike_attribute (const NeuronID i, const int attribute_id=0)
 Returns spike attribute belonging to the spike at position i in the get_spikes() SpikeContainer. More...
 

Public Attributes

SpikingGroupsrc
 Pointer to the source group of this connection. More...
 
NeuronGroupdst
 Pointer to the destination group of this connection. More...
 

Protected Member Functions

virtual void virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version)
 
virtual void virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version)
 
void init (TransmitterType transmitter=GLUT)
 

Protected Attributes

TransmitterType trans
 
AurynStateVectortarget_state_vector
 
AurynFloattarget
 A more direct reference on the first element of the target_state_vector. More...
 
NeuronID number_of_spike_attributes
 Number of spike attributes to expect with each spike transmitted through this connection. More...
 
NeuronID spike_attribute_offset
 Stores spike attribute offset in attribute array. More...
 

Friends

class boost::serialization::access
 

Detailed Description

The abstract base class for all Connection objects in Auryn.

Connections are designed to take up spikes from a source a group that can spike in general (decendants of SpikingGroup) and to convey them to a group that can integrate spikes such as the children of NeuronGroup.

For that reason, when constructing any decendant of Connection you generally will have to specify a source (SpikingGroup) and a destination (NeuronGroup).

Constructor & Destructor Documentation

◆ Connection() [1/3]

Connection::Connection ( )
31 {
32  init();
33 }
void init(TransmitterType transmitter=GLUT)
Definition: Connection.cpp:51
Here is the call graph for this function:

◆ Connection() [2/3]

Connection::Connection ( NeuronID  rows,
NeuronID  cols 
)
36 {
37  init();
38  set_size(rows,cols);
39 }
void init(TransmitterType transmitter=GLUT)
Definition: Connection.cpp:51
void set_size(NeuronID i, NeuronID j)
Definition: Connection.cpp:71
Here is the call graph for this function:

◆ Connection() [3/3]

Connection::Connection ( SpikingGroup source,
NeuronGroup destination,
TransmitterType  transmitter = GLUT,
std::string  name = "Connection" 
)
42 {
43  set_source(source);
44  set_destination(destination);
45  m_rows = src->get_size();
46  n_cols = dst->get_size();
47  init(transmitter);
48  set_name(name);
49 }
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
void set_destination(NeuronGroup *source)
Sets destination SpikingGroup of this connection.
Definition: Connection.cpp:198
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
void init(TransmitterType transmitter=GLUT)
Definition: Connection.cpp:51
NeuronID get_size()
Returns the size of the group.
Definition: SpikingGroup.cpp:304
void set_source(SpikingGroup *source)
Sets source SpikingGroup of this connection.
Definition: Connection.cpp:188
void set_name(std::string name)
Set name of connection.
Definition: Connection.cpp:82
Here is the call graph for this function:

◆ ~Connection()

Connection::~Connection ( )
virtual
79 {
80 }

Member Function Documentation

◆ add_number_of_spike_attributes()

void Connection::add_number_of_spike_attributes ( int  x)

Set up spike delay to accomodate x additional spike attributes.

Spike attribute numbers can only be increased. This function can only be run during initialization.

222 {
223  if ( x <= 0 ) {
225  }
226 
227  number_of_spike_attributes += x; // we remember how many attributes are due to this connection
229 }
NeuronID number_of_spike_attributes
Number of spike attributes to expect with each spike transmitted through this connection.
Definition: Connection.h:99
Definition: auryn_definitions.h:315
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
void inc_num_spike_attributes(int x)
Instructs SpikingGroup to increase the number of spike attributes by x.
Definition: SpikingGroup.cpp:906
Here is the call graph for this function:

◆ conditional_propagate()

void Connection::conditional_propagate ( )

DEPRECATED. (Such connections should not be registered in the first place) Calls propagate only if the postsynaptic NeuronGroup exists on the local rank.

209 {
210  if ( dst->evolve_locally() )
211  propagate();
212 }
virtual void propagate()=0
Propagate method to propagate spikes. Called by System run method.
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
Here is the call graph for this function:

◆ evolve()

void Connection::evolve ( )
virtual

◆ finalize()

virtual void auryn::Connection::finalize ( )
pure virtual

◆ get()

virtual AurynWeight auryn::Connection::get ( NeuronID  i,
NeuronID  j 
)
pure virtual

Get weight value i,j if it exists. Otherwise the value is undefined.

Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ get_data()

virtual AurynWeight auryn::Connection::get_data ( NeuronID  i)
pure virtual

Return weight element as index in data array.

Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ get_destination()

NeuronGroup * Connection::get_destination ( )

Returns pointer to the postsynaptic group.

204 {
205  return dst;
206 }
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111

◆ get_file_name()

std::string Connection::get_file_name ( )

Extracts the class name of the connection from the file name.

93 {
94  std::string filename (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__);
95  return filename;
96 }
std::string string
Standard library string type which is imported into Auryn namespace.
Definition: auryn_definitions.h:156

◆ get_log_name()

std::string Connection::get_log_name ( )

Returns a string which is the combination of file and connection name for logging.

99 {
100  std::stringstream oss;
101  oss << get_name() << " ("
102  << get_file_name() << "): ";
103  return oss.str();
104 }
std::string get_file_name()
Extracts the class name of the connection from the file name.
Definition: Connection.cpp:92
std::string get_name()
Returns name of connection.
Definition: Connection.cpp:87
Here is the call graph for this function:

◆ get_m_rows()

NeuronID Connection::get_m_rows ( )

Get number of rows (presynaptic) in connection.

Note that Matrices in Auryn have to be thought of as multiplied from the left. The number of rows thus corresponds to the maximum number of presynaptic cells.

179 {
180  return m_rows;
181 }

◆ get_n_cols()

NeuronID Connection::get_n_cols ( )

Get number of columns (postsynaptic) in connection.

Note that Matrices in Auryn have to be thought of as multiplied from the left. The number of columns thus corresponds to the maximum number of postsynaptic cells.

184 {
185  return n_cols;
186 }

◆ get_name()

std::string Connection::get_name ( )

Returns name of connection.

88 {
89  return connection_name;
90 }

◆ get_nonzero()

virtual AurynLong auryn::Connection::get_nonzero ( )
pure virtual

Return number of nonzero elements in this Connection.

Implemented in auryn::SparseConnection, auryn::IdentityConnection, auryn::FanOutConnection, and auryn::AllToAllConnection.

◆ get_post_spikes()

SpikeContainer * Connection::get_post_spikes ( )

Returns pointer to SpikeContainer for postsynaptic spikes on this node.

This corresponds to calling get_spikes_immediate() from the SpikingGroup. These spikes have been generated postsynaptically in the same timestep and have not been delayed yet. Equivalent to calling dst->get_spikes_immediate().

237 {
238  return dst->get_spikes_immediate();
239 }
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
SpikeContainer * get_spikes_immediate()
Returns pointer to SpikeContainer of spikes generated during the last evolve() step.
Definition: SpikingGroup.cpp:250
Here is the call graph for this function:

◆ get_post_state_trace()

Trace * Connection::get_post_state_trace ( const string  state_name,
const AurynDouble  tau,
const AurynDouble  jump_size = 0.0 
)

Returns a pointer to a postsynaptic state trace object.

271 {
272  return dst->get_post_state_trace(state_name, tau, jump_size);
273 }
Trace * get_post_state_trace(std::string state_name="mem", AurynFloat tau=10e-3, AurynFloat b=0.0)
Returns a post trace of a neuronal state variable e.g. the membrane potential with time constant tau...
Definition: SpikingGroup.cpp:457
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
Here is the call graph for this function:

◆ get_post_trace()

Trace * Connection::get_post_trace ( const AurynDouble  tau)

Returns a pointer to a postsynaptic trace object.

266 {
267  return dst->get_post_trace(tau);
268 }
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
Trace * get_post_trace(AurynFloat x)
Returns a post trace with time constant x.
Definition: SpikingGroup.cpp:390
Here is the call graph for this function:

◆ get_pre_spikes()

SpikeContainer * Connection::get_pre_spikes ( )

Supplies pointer to SpikeContainer of all presynaptic spikes.

This includes spikes from this group from all other nodes. This also means that these spikes have gone through the axonal dealy. Equivalent to calling src->get_spikes().

232 {
233  return src->get_spikes();
234 }
SpikeContainer * get_spikes()
Returns pointer to a spike container that contains spikes which arrive in this timestep from all neur...
Definition: SpikingGroup.cpp:245
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
Here is the call graph for this function:

◆ get_pre_trace()

Trace * Connection::get_pre_trace ( const AurynDouble  tau)

Returns a pointer to a presynaptic trace object.

261 {
262  return src->get_pre_trace(tau);
263 }
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
Trace * get_pre_trace(AurynFloat x)
Returns a pre trace with time constant x.
Definition: SpikingGroup.cpp:359
Here is the call graph for this function:

◆ get_ptr()

virtual AurynWeight* auryn::Connection::get_ptr ( NeuronID  i,
NeuronID  j 
)
pure virtual

Return pointer to weight element i,j if it exists, otherwise return NULL.

Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ get_source()

SpikingGroup * Connection::get_source ( )

Returns pointer to the presynaptic group.

194 {
195  return src ;
196 }
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108

◆ get_spike_attribute()

AurynFloat Connection::get_spike_attribute ( const NeuronID  i,
const int  attribute_id = 0 
)

Returns spike attribute belonging to the spike at position i in the get_spikes() SpikeContainer.

243 {
244  // We need to skip attributes by other Connection objects (spike_attribute_offset)
245  // and other attributes from this Connection. Note that if attribute_id is larger
246  // then number_of_spike_attributes the behavior will be undefined, but for performance
247  // reasons we do not check for this here.
248  NeuronID stackpos = spike_array_pos + (spike_attribute_offset+attribute_id)*src->get_spikes()->size();
249 
250  #ifdef DEBUG
251  std::cout << "stack pos " << stackpos
252  << " value: " << std::setprecision(5)
253  << src->get_attributes()->at(stackpos)
254  << std::endl;
255  #endif //DEBUG
256 
257  return src->get_attributes()->at(stackpos);
258 }
SpikeContainer * get_spikes()
Returns pointer to a spike container that contains spikes which arrive in this timestep from all neur...
Definition: SpikingGroup.cpp:245
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
NeuronID spike_attribute_offset
Stores spike attribute offset in attribute array.
Definition: Connection.h:102
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
AttributeContainer * get_attributes()
Returns pointer to Attributecontainer for usage in propagating Connection objects. Same as get_spikes_immediate(), however might be overwritten to contain Spikes that have been delayed.
Definition: SpikingGroup.cpp:255
Here is the call graph for this function:

◆ get_target_vector()

AurynStateVector * Connection::get_target_vector ( )

Returns target state vector if one is defined.

174 {
175  return target_state_vector;
176 }
AurynStateVector * target_state_vector
Definition: Connection.h:86

◆ get_transmitter()

TransmitterType Connection::get_transmitter ( )

Returns transmitter type.

This is one of Auryn default transmitter types. It essentially characterizes an array of a state vector to which this Connections weight will be added upon synaptic transmission.

107 {
108  return trans;
109 }
TransmitterType trans
Definition: Connection.h:84

◆ init()

void Connection::init ( TransmitterType  transmitter = GLUT)
protected
52 {
53  set_transmitter(transmitter);
54 
55  // set a default name based on the neuron group names
56  std::stringstream s;
57  s << src->get_name()
58  << " -> "
59  << dst->get_name();
60  set_name(s.str());
61 
62  // init default parameters
64 
65  // Here we store how many spike attributes have already been
66  // added to the stack due to other connections having the same
67  // source SpikingGroup.
69 }
NeuronID number_of_spike_attributes
Number of spike attributes to expect with each spike transmitted through this connection.
Definition: Connection.h:99
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
NeuronID spike_attribute_offset
Stores spike attribute offset in attribute array.
Definition: Connection.h:102
void set_transmitter(AurynStateVector *ptr)
Same as set_target.
int get_num_spike_attributes()
Definition: SpikingGroup.cpp:915
std::string get_name()
Retrieves the groups name.
Definition: SpikingGroup.cpp:512
void set_name(std::string name)
Set name of connection.
Definition: Connection.cpp:82
Here is the call graph for this function:

◆ load_from_file()

virtual bool auryn::Connection::load_from_file ( std::string  filename)
pure virtual

Implements load from file functionality. Also called in save_network_state from System class.

Implemented in auryn::SparseConnection, auryn::RateModulatedConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ propagate()

virtual void auryn::Connection::propagate ( )
pure virtual

◆ safe_transmit()

void Connection::safe_transmit ( NeuronID  id,
AurynWeight  amount 
)

Same as transmit but first checks if the target neuron exists and avoids segfaults that way (but it's also slower).

216 {
217  if ( dst->localrank(id) )
218  transmit( id, amount );
219 }
bool localrank(NeuronID i)
Checks if the global NeuronID i is integrated on this MPI rank.
Definition: SpikingGroup.cpp:531
void transmit(const NeuronID id, const AurynWeight amount)
Default way to transmit a spike to a postsynaptic partner.
Definition: Connection.h:294
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
Here is the call graph for this function:

◆ set()

virtual void auryn::Connection::set ( NeuronID  i,
NeuronID  j,
AurynWeight  value 
)
pure virtual

Set existing weight element i,j with value.

Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ set_destination()

void Connection::set_destination ( NeuronGroup source)

Sets destination SpikingGroup of this connection.

199 {
200  dst = destination;
201 }
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111

◆ set_name()

void Connection::set_name ( std::string  name)

Set name of connection.

The name will appear in error messages and save files

83 {
84  connection_name = name;
85 }

◆ set_receptor() [1/2]

void Connection::set_receptor ( AurynStateVector ptr)

Same as set_target.

153 {
154  set_target(ptr);
155 }
void set_target(AurynWeight *ptr)
Sets target state of this connection directly via a pointer.
Definition: Connection.cpp:137
Here is the call graph for this function:

◆ set_receptor() [2/2]

void Connection::set_receptor ( string  state_name)

Sets target state of this connection directly the name of a state vector.

158 {
159  set_receptor(dst->get_state_vector(state_name));
160 }
void set_receptor(AurynStateVector *ptr)
Same as set_target.
Definition: Connection.cpp:152
AurynStateVector * get_state_vector(std::string key)
Creates a new or returns an existing state vector by name.
Definition: SpikingGroup.cpp:781
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
Here is the call graph for this function:

◆ set_size()

void Connection::set_size ( NeuronID  i,
NeuronID  j 
)
72 {
73  m_rows = i;
74  n_cols = j;
75 }

◆ set_source()

void Connection::set_source ( SpikingGroup source)

Sets source SpikingGroup of this connection.

189 {
190  src = source;
191 }
SpikingGroup * src
Pointer to the source group of this connection.
Definition: Connection.h:108

◆ set_target() [1/3]

void Connection::set_target ( AurynWeight ptr)

Sets target state of this connection directly via a pointer.

138 {
139  target = ptr;
140 }
AurynFloat * target
A more direct reference on the first element of the target_state_vector.
Definition: Connection.h:93

◆ set_target() [2/3]

void Connection::set_target ( AurynStateVector ptr)

Sets target state of this connection directly via a StateVector.

143 {
144  // get_state_vector and other functions return the NULL
145  // vector, for instance, when the corresponding vector
146  // has zero size. We catch that first.
147  if ( ptr == NULL ) return;
148  target_state_vector = ptr;
149  set_target(ptr->data);
150 }
T * data
Pointer to the array housing the data.
Definition: AurynVector.h:154
AurynStateVector * target_state_vector
Definition: Connection.h:86
void set_target(AurynWeight *ptr)
Sets target state of this connection directly via a pointer.
Definition: Connection.cpp:137
Here is the call graph for this function:

◆ set_target() [3/3]

void Connection::set_target ( string  state_name)

Same as set_receptor.

163 {
164  set_receptor(state_name);
165 }
void set_receptor(AurynStateVector *ptr)
Same as set_target.
Definition: Connection.cpp:152
Here is the call graph for this function:

◆ set_transmitter() [1/3]

void auryn::Connection::set_transmitter ( AurynStateVector ptr)

Same as set_target.

◆ set_transmitter() [2/3]

void Connection::set_transmitter ( TransmitterType  transmitter)

Sets target state of this connection for a given receptor as one of Auryn's default transmitter types.

The most common transmitter types are GLUT and GABA. The postsynaptic NeuronGroup needs to make use of the g_ampa or g_gaba state vectors (AurynStateVector) for this to work.

112 {
113  trans = transmitter;
114  if ( dst->evolve_locally() ) {
115  switch ( transmitter ) {
116  case GABA:
118  break;
119  case MEM:
121  break;
122  case CURSYN:
123  set_target(dst->get_state_vector("g_cursyn"));
124  break;
125  case NMDA:
126  set_target(dst->get_state_vector("g_nmda"));
127  break;
128  case GLUT:
129  case AMPA:
130  default:
132  }
133  } else set_target((AurynWeight *)NULL);
134 }
Current based synapse. Adds the transmitted quantity directly to membrane voltage.
Definition: auryn_definitions.h:143
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
TransmitterType trans
Definition: Connection.h:84
virtual AurynStateVector * get_default_inh_target()
Returns default inh target input.
Definition: NeuronGroup.cpp:144
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
AurynStateVector * get_state_vector(std::string key)
Creates a new or returns an existing state vector by name.
Definition: SpikingGroup.cpp:781
Only targets NMDA.
Definition: auryn_definitions.h:142
virtual AurynStateVector * get_default_exc_target()
Returns default exc target input.
Definition: NeuronGroup.cpp:139
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
Current based synapse with dynamics.
Definition: auryn_definitions.h:144
Standard Gabaergic (inhibitory) transmission.
Definition: auryn_definitions.h:140
Only targets AMPA channels.
Definition: auryn_definitions.h:141
void set_target(AurynWeight *ptr)
Sets target state of this connection directly via a pointer.
Definition: Connection.cpp:137
Here is the call graph for this function:

◆ set_transmitter() [3/3]

void Connection::set_transmitter ( string  state_name)

Same as set_receptor, but DEPRECATED.

169 {
170  set_receptor(state_name);
171 }
void set_receptor(AurynStateVector *ptr)
Same as set_target.
Definition: Connection.cpp:152
Here is the call graph for this function:

◆ stats()

virtual void auryn::Connection::stats ( AurynDouble mean,
AurynDouble std,
StateID  zid = 0 
)
pure virtual

Computes mean synaptic weight and std dev of all weights in this connection.

Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

◆ targeted_transmit()

void auryn::Connection::targeted_transmit ( SpikingGroup target_group,
AurynStateVector target_state,
const NeuronID  id,
const AurynWeight  amount 
)
inline

Transmits a spike to a given target group and state.

The method exposes the transmit interface and should not be used unless you know exactly what you are doing.

289 {
290  const NeuronID localid = target_group->global2rank(id);
291  target_state->data[localid]+=amount;
292 }
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151

◆ transmit()

void auryn::Connection::transmit ( const NeuronID  id,
const AurynWeight  amount 
)
inline

Default way to transmit a spike to a postsynaptic partner.

The method adds a given amount to the respective element in the target/transmitter array of the postsynaptic neuron specifeid by id. This is a new approach which replaces tadd to old method, increments transmitter specific state variables in neuron id. It turned out much faster that way, because the transmit function is one of the most often called function in the simulation and it can be efficiently inlined by the compiler.

295 {
297 }
void targeted_transmit(SpikingGroup *target_group, AurynStateVector *target_state, const NeuronID id, const AurynWeight amount)
Transmits a spike to a given target group and state.
Definition: Connection.h:288
NeuronGroup * dst
Pointer to the destination group of this connection.
Definition: Connection.h:111
AurynStateVector * target_state_vector
Definition: Connection.h:86
Here is the call graph for this function:

◆ virtual_serialize() [1/2]

virtual void auryn::Connection::virtual_serialize ( boost::archive::binary_oarchive &  ar,
const unsigned int  version 
)
inlineprotectedvirtual

Serialization function for saving the Connection state. Implement in derived classes to save additional information.

Reimplemented in auryn::SparseConnection, and auryn::DelayConnection.

72  {
73  ar & m_rows & n_cols & connection_name;
74  }

◆ virtual_serialize() [2/2]

virtual void auryn::Connection::virtual_serialize ( boost::archive::binary_iarchive &  ar,
const unsigned int  version 
)
inlineprotectedvirtual

Serialization function for loading the Connection state. Implement in derived classes to save additional information.

Reimplemented in auryn::SparseConnection, and auryn::DelayConnection.

80  {
81  ar & m_rows & n_cols & connection_name;
82  }

◆ write_to_file()

virtual bool auryn::Connection::write_to_file ( std::string  filename)
pure virtual

Implements save to file functionality. Also called in save_network_state from System class.

Implemented in auryn::SparseConnection, auryn::RateModulatedConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ dst

NeuronGroup* auryn::Connection::dst

Pointer to the destination group of this connection.

◆ number_of_spike_attributes

NeuronID auryn::Connection::number_of_spike_attributes
protected

Number of spike attributes to expect with each spike transmitted through this connection.

Should only be set through methods called during init.

◆ spike_attribute_offset

NeuronID auryn::Connection::spike_attribute_offset
protected

Stores spike attribute offset in attribute array.

◆ src

SpikingGroup* auryn::Connection::src

Pointer to the source group of this connection.

◆ target

AurynFloat* auryn::Connection::target
protected

A more direct reference on the first element of the target_state_vector.

The logic of connection is that when the simulation starts *target points to the first element of an array with AurynWeight type which has the post_size of the target group. Each presynaptic spike will then trigger addition the values stored as weights in some weight matrix to that group.

◆ target_state_vector

AurynStateVector* auryn::Connection::target_state_vector
protected

◆ trans

TransmitterType auryn::Connection::trans
protected

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