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

Provides all to all connectivity. More...

#include <AllToAllConnection.h>

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

Public Member Functions

 AllToAllConnection ()
 
 AllToAllConnection (SpikingGroup *source, NeuronGroup *destination, AurynWeight weight=1.0, TransmitterType transmitter=GLUT, string name="Default AllToAllConnection")
 
virtual ~AllToAllConnection ()
 
virtual AurynWeight get (NeuronID i, NeuronID j)
 Get weight value i,j if it exists. Otherwise the value is undefined. More...
 
virtual AurynWeightget_ptr (NeuronID i, NeuronID j)
 Return pointer to weight element i,j if it exists, otherwise return NULL. More...
 
virtual AurynWeight get_data (NeuronID i)
 Return weight element as index in data array. More...
 
virtual AurynLong get_nonzero ()
 Return number of nonzero elements in this Connection. More...
 
virtual void set_data (NeuronID i, AurynWeight value)
 
virtual void set (NeuronID i, NeuronID j, AurynWeight value)
 Set existing weight element i,j with value. More...
 
void finalize ()
 Finalize Connection after initialization to prepare for use in simulation. More...
 
virtual void propagate ()
 Propagate method to propagate spikes. Called by System run method. More...
 
virtual void stats (AurynDouble &mean, AurynDouble &std, StateID zid=0)
 Return stats for connection. More...
 
virtual bool write_to_file (string filename)
 Implements save to file functionality. Also called in save_network_state from System class. More...
 
virtual bool load_from_file (string filename)
 Implements load from file functionality. Also called in save_network_state from System class. More...
 
std::vector< neuron_pairget_block (NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col)
 Returns a vector of ConnectionsID of a block specified by the arguments. More...
 
- Public Member Functions inherited from auryn::Connection
 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 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...
 
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...
 

Protected Member Functions

void free ()
 
- Protected Member Functions inherited from auryn::Connection
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)
 

Additional Inherited Members

- Public Attributes inherited from auryn::Connection
SpikingGroupsrc
 Pointer to the source group of this connection. More...
 
NeuronGroupdst
 Pointer to the destination group of this connection. More...
 
- Protected Attributes inherited from auryn::Connection
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...
 

Detailed Description

Provides all to all connectivity.

Constructor & Destructor Documentation

◆ AllToAllConnection() [1/2]

auryn::AllToAllConnection::AllToAllConnection ( )

◆ AllToAllConnection() [2/2]

AllToAllConnection::AllToAllConnection ( SpikingGroup source,
NeuronGroup destination,
AurynWeight  weight = 1.0,
TransmitterType  transmitter = GLUT,
std::string  name = "Default AllToAllConnection" 
)
36 : Connection(source,destination,transmitter,name)
37 {
38  init(weight);
39 }
Connection()
Definition: Connection.cpp:30

◆ ~AllToAllConnection()

AllToAllConnection::~AllToAllConnection ( )
virtual
43 {
44  free();
45 }
void free()
Definition: AllToAllConnection.cpp:55
Here is the call graph for this function:

Member Function Documentation

◆ finalize()

void AllToAllConnection::finalize ( )
virtual

Finalize Connection after initialization to prepare for use in simulation.

Implements auryn::Connection.

60 {
61 }

◆ free()

void AllToAllConnection::free ( )
protected
56 {
57 }

◆ get()

AurynWeight AllToAllConnection::get ( NeuronID  i,
NeuronID  j 
)
virtual

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

Implements auryn::Connection.

83 {
84  return connection_weight;
85 }

◆ get_block()

std::vector< neuron_pair > AllToAllConnection::get_block ( NeuronID  lo_row,
NeuronID  lo_col,
NeuronID  hi_row,
NeuronID  hi_col 
)

Returns a vector of ConnectionsID of a block specified by the arguments.

120 {
121  std::vector<neuron_pair> clist;
122  for ( NeuronID i = lo_row ; i < hi_row ; ++i ) {
123  for ( NeuronID j = lo_col ; j < hi_col ; ++j ) {
124  if ( i == j ) {
125  neuron_pair a;
126  a.i = i;
127  a.j = j;
128  clist.push_back( a );
129  }
130  }
131  }
132  return clist;
133 }
Struct that defines a pair of neurons in SparseConnection.
Definition: auryn_definitions.h:167
NeuronID i
Definition: auryn_definitions.h:168
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
NeuronID j
Definition: auryn_definitions.h:168

◆ get_data()

AurynWeight AllToAllConnection::get_data ( NeuronID  i)
virtual

Return weight element as index in data array.

Implements auryn::Connection.

73 {
74  return 0;
75 }

◆ get_nonzero()

AurynLong AllToAllConnection::get_nonzero ( )
virtual

Return number of nonzero elements in this Connection.

Implements auryn::Connection.

114 {
115  return 1;
116 }

◆ get_ptr()

AurynWeight * AllToAllConnection::get_ptr ( NeuronID  i,
NeuronID  j 
)
virtual

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

Implements auryn::Connection.

88 {
89  return &connection_weight;
90 }

◆ load_from_file()

bool AllToAllConnection::load_from_file ( string  filename)
virtual

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

Implements auryn::Connection.

109 {
110  return true; // TODO fake but what else ?
111 }

◆ propagate()

void AllToAllConnection::propagate ( )
virtual

Propagate method to propagate spikes. Called by System run method.

Implements auryn::Connection.

64 {
65  SpikeContainer::const_iterator spikes_end = src->get_spikes()->end();
66  for (SpikeContainer::const_iterator spike = src->get_spikes()->begin() ;
67  spike != spikes_end ; ++spike ) {
68  target_state_vector->add( connection_weight );
69  }
70 }
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
void add(const float c)
Definition: AurynVector.cpp:180
AurynStateVector * target_state_vector
Definition: Connection.h:86
Here is the call graph for this function:

◆ set()

void AllToAllConnection::set ( NeuronID  i,
NeuronID  j,
AurynWeight  value 
)
virtual

Set existing weight element i,j with value.

Implements auryn::Connection.

93 {
94  connection_weight = value;
95 }

◆ set_data()

void AllToAllConnection::set_data ( NeuronID  i,
AurynWeight  value 
)
virtual
78 {
79  connection_weight = value;
80 }

◆ stats()

void AllToAllConnection::stats ( AurynDouble mean,
AurynDouble std,
StateID  zid = 0 
)
virtual

Return stats for connection.

Note that AllToAllConnection does not support complex matrix states yet

Implements auryn::Connection.

98 {
99  mean = connection_weight;
100  std = 0;
101 }
STL namespace.

◆ write_to_file()

bool AllToAllConnection::write_to_file ( string  filename)
virtual

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

Implements auryn::Connection.

104 {
105  return true; // TODO fake but what else ?
106 }

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