MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Synapse Class Reference

#include <Synapse.h>

+ Inheritance diagram for Synapse:
+ Collaboration diagram for Synapse:

Public Member Functions

void addSpike (const Eref &e, double time)
 
double getDelay () const
 
double getTopSpike (const Eref &e) const
 
double getWeight () const
 
void setDelay (double v)
 
void setHandler (SynHandlerBase *h)
 
void setWeight (double v)
 
 Synapse ()
 

Static Public Member Functions

static void addMsgCallback (const Eref &e, const string &finfoName, ObjId msg, unsigned int msgLookup)
 
static void dropMsgCallback (const Eref &e, const string &finfoName, ObjId msg, unsigned int msgLookup)
 
static const CinfoinitCinfo ()
 

Private Attributes

double delay_
 
SynHandlerBasehandler_
 
double weight_
 

Detailed Description

This is the base class for synapses. It is meant to be used as a FieldElement entry on a parent object, derived from the SynHandlerBase.

Definition at line 18 of file Synapse.h.

Constructor & Destructor Documentation

Synapse::Synapse ( )

Definition at line 72 of file Synapse.cpp.

73  : weight_( 1.0 ), delay_( 0.0 ), handler_( 0 )
74 {
75  ;
76 }
double delay_
Definition: Synapse.h:43
double weight_
Definition: Synapse.h:42
SynHandlerBase * handler_
Definition: Synapse.h:44

Member Function Documentation

void Synapse::addMsgCallback ( const Eref e,
const string &  finfoName,
ObjId  msg,
unsigned int  msgLookup 
)
static

Definition at line 126 of file Synapse.cpp.

References SynHandlerBase::addSynapse(), ObjId::data(), Neutral::parent(), and SetGet2< A1, A2 >::set().

129 {
130  if ( finfoName == "addSpike" ) {
131  ObjId pa = Neutral::parent( e );
132  SynHandlerBase* sh =
133  reinterpret_cast< SynHandlerBase* >( pa.data() );
134  unsigned int synapseNumber = sh->addSynapse();
136  msg, "fieldIndex", msgLookup, synapseNumber );
137  }
138 }
static ObjId parent(const Eref &e)
Definition: Neutral.cpp:701
char * data() const
Definition: ObjId.cpp:113
virtual unsigned int addSynapse()=0
Definition: ObjId.h:20
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365

+ Here is the call graph for this function:

void Synapse::addSpike ( const Eref e,
double  time 
)

Definition at line 104 of file Synapse.cpp.

References SynHandlerBase::addSpike(), Eref::dataIndex(), delay_, Eref::fieldIndex(), handler_, and weight_.

Referenced by initCinfo().

105 {
106  static bool report = false;
107  static unsigned int tgtDataIndex = 0;
108  // static unsigned int tgtFieldIndex = 0;
109  if ( report && e.dataIndex() == tgtDataIndex ) {
110  cout << " " << time << "," << e.fieldIndex();
111  }
112  handler_->addSpike( e.fieldIndex(), time + delay_, weight_ );
113 }
unsigned int dataIndex() const
Definition: Eref.h:50
unsigned int fieldIndex() const
Definition: Eref.h:61
double delay_
Definition: Synapse.h:43
virtual void addSpike(unsigned int index, double time, double weight)=0
double weight_
Definition: Synapse.h:42
SynHandlerBase * handler_
Definition: Synapse.h:44

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Synapse::dropMsgCallback ( const Eref e,
const string &  finfoName,
ObjId  msg,
unsigned int  msgLookup 
)
static

Definition at line 145 of file Synapse.cpp.

References ObjId::data(), SynHandlerBase::dropSynapse(), and Neutral::parent().

148 {
149  if ( finfoName == "addSpike" ) {
150  ObjId pa = Neutral::parent( e );
151  SynHandlerBase* sh =
152  reinterpret_cast< SynHandlerBase* >( pa.data() );
153  sh->dropSynapse( msgLookup );
154  }
155 }
static ObjId parent(const Eref &e)
Definition: Neutral.cpp:701
char * data() const
Definition: ObjId.cpp:113
Definition: ObjId.h:20
virtual void dropSynapse(unsigned int droppedSynNumber)=0

+ Here is the call graph for this function:

double Synapse::getDelay ( ) const

Definition at line 93 of file Synapse.cpp.

References delay_.

Referenced by initCinfo().

94 {
95  return delay_;
96 }
double delay_
Definition: Synapse.h:43

+ Here is the caller graph for this function:

double Synapse::getTopSpike ( const Eref e) const

Definition at line 115 of file Synapse.cpp.

References Eref::fieldIndex(), SynHandlerBase::getTopSpike(), and handler_.

Referenced by initCinfo().

116 {
117  return handler_->getTopSpike( e.fieldIndex() );
118 }
virtual double getTopSpike(unsigned int index) const =0
unsigned int fieldIndex() const
Definition: Eref.h:61
SynHandlerBase * handler_
Definition: Synapse.h:44

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Synapse::getWeight ( ) const

Definition at line 88 of file Synapse.cpp.

References weight_.

Referenced by initCinfo(), GraupnerBrunel2012CaPlasticitySynHandler::updateWeight(), GraupnerBrunel2012CaPlasticitySynHandler::vProcess(), and STDPSynHandler::vProcess().

89 {
90  return weight_;
91 }
double weight_
Definition: Synapse.h:42

+ Here is the caller graph for this function:

const Cinfo * Synapse::initCinfo ( )
static

Definition at line 15 of file Synapse.cpp.

References addSpike(), getDelay(), getTopSpike(), getWeight(), Neutral::initCinfo(), setDelay(), setWeight(), and synapseCinfo.

Referenced by STDPSynapse::initCinfo(), SimpleSynHandler::initCinfo(), SeqSynHandler::initCinfo(), GraupnerBrunel2012CaPlasticitySynHandler::initCinfo(), testSendSpike(), and testSparseMsg().

16 {
17  static ValueFinfo< Synapse, double > weight(
18  "weight",
19  "Synaptic weight",
22  );
23 
24  static ValueFinfo< Synapse, double > delay(
25  "delay",
26  "Axonal propagation delay to this synapse",
29  );
30  static ElementValueFinfo< Synapse, double > spikeTime(
31  "spikeTime",
32  "Value field interface to add spike (by assignment) and to "
33  "read the value of the spike on top of the queue.",
36  );
37 
38  static DestFinfo addSpike( "addSpike",
39  "Handles arriving spike messages, inserts into event queue.",
41 
42  static Finfo* synapseFinfos[] = {
43  &weight, // Field
44  &delay, // Field
45  &spikeTime, // ElementField
46  &addSpike, // DestFinfo
47  };
48 
49  static string doc[] =
50  {
51  "Name", "Synapse",
52  "Author", "Upi Bhalla",
53  "Description", "Synapse using ring buffer for events.",
54  };
55  static Dinfo< Synapse > dinfo;
56  static Cinfo synapseCinfo (
57  "Synapse",
59  synapseFinfos,
60  sizeof( synapseFinfos ) / sizeof ( Finfo* ),
61  &dinfo,
62  doc,
63  sizeof( doc ) / sizeof( string ),
64  true // This is a FieldElement.
65  );
66 
67  return &synapseCinfo;
68 }
static const Cinfo * synapseCinfo
Definition: Synapse.cpp:70
void setWeight(double v)
Definition: Synapse.cpp:78
Definition: Dinfo.h:60
Definition: EpFunc.h:64
double getWeight() const
Definition: Synapse.cpp:88
void addSpike(const Eref &e, double time)
Definition: Synapse.cpp:104
double getTopSpike(const Eref &e) const
Definition: Synapse.cpp:115
double getDelay() const
Definition: Synapse.cpp:93
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void setDelay(double v)
Definition: Synapse.cpp:83
Definition: Cinfo.h:18
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Synapse::setDelay ( double  v)

Definition at line 83 of file Synapse.cpp.

References delay_.

Referenced by initCinfo().

84 {
85  delay_ = v;
86 }
double delay_
Definition: Synapse.h:43

+ Here is the caller graph for this function:

void Synapse::setHandler ( SynHandlerBase h)

Definition at line 98 of file Synapse.cpp.

References handler_.

Referenced by STDPSynapse::setHandler().

99 {
100  handler_ = h;
101 }
SynHandlerBase * handler_
Definition: Synapse.h:44

+ Here is the caller graph for this function:

void Synapse::setWeight ( double  v)

Definition at line 78 of file Synapse.cpp.

References weight_.

Referenced by initCinfo(), GraupnerBrunel2012CaPlasticitySynHandler::updateWeight(), and STDPSynHandler::vProcess().

79 {
80  weight_ = v;
81 }
double weight_
Definition: Synapse.h:42

+ Here is the caller graph for this function:

Member Data Documentation

double Synapse::delay_
private

Definition at line 43 of file Synapse.h.

Referenced by addSpike(), getDelay(), and setDelay().

SynHandlerBase* Synapse::handler_
private

Definition at line 44 of file Synapse.h.

Referenced by addSpike(), getTopSpike(), and setHandler().

double Synapse::weight_
private

Definition at line 42 of file Synapse.h.

Referenced by addSpike(), getWeight(), and setWeight().


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