MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
STDPSynHandler.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2013 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _STDP_SYN_HANDLER_H
11 #define _STDP_SYN_HANDLER_H
12 
13 /*
14 class PreSynEvent: public SynEvent
15 {
16  public:
17  PreSynEvent()
18  : SynEvent(), // call the parent constructor with default args
19  // by default calls without args, so no need really
20  synIndex( 0 )
21  {}
22 
23  PreSynEvent( unsigned int i, double t, double w )
24  : SynEvent(t,w),// call the parent constructor with given args
25  synIndex( i )
26  {;}
27 
28  unsigned int synIndex;
29 };
30 
31 class PostSynEvent
32 {
33  public:
34  PostSynEvent()
35  : time( 0.0 )
36  {;}
37 
38  PostSynEvent( double t )
39  : time( t )
40  {;}
41 
42  double time;
43 };
44 
45 struct ComparePostSynEvent
46 {
47  bool operator()(const PostSynEvent& lhs, const PostSynEvent& rhs) const
48  {
49  // Note that this is backwards. We want the smallest timestamp
50  // on the top of the events priority_queue.
51  return lhs.time > rhs.time;
52  }
53 };
54 */
55 
62 {
63  public:
66  STDPSynHandler& operator=( const STDPSynHandler& other );
67 
69  // Inherited virtual functions from SynHandlerBase
71  void vSetNumSynapses( unsigned int num );
72  unsigned int vGetNumSynapses() const;
73  STDPSynapse* vGetSynapse( unsigned int i );
74  void vProcess( const Eref& e, ProcPtr p );
75  void vReinit( const Eref& e, ProcPtr p );
77  unsigned int addSynapse();
78  void dropSynapse( unsigned int droppedSynNumber );
79  void addSpike( unsigned int index, double time, double weight );
80  double getTopSpike( unsigned int index ) const;
82  void addPostSpike( const Eref& e, double time );
83 
84  void setAPlus0( double v );
85  double getAPlus0() const;
86  void setTauPlus( double v );
87  double getTauPlus() const;
88  // note: APlus is in STDPSynapse as
89  // it is different for each presynaptic neuron
90  // connected to this 'aggregate-synapse'
91 
92  void setAMinus( double v );
93  double getAMinus() const;
94  void setTauMinus( double v );
95  double getTauMinus() const;
96  void setAMinus0( double v );
97  double getAMinus0() const;
98 
99  void setWeightMax( double v );
100  double getWeightMax() const;
101  void setWeightMin( double v );
102  double getWeightMin() const;
103 
104  static const Cinfo* initCinfo();
105  private:
106  vector< STDPSynapse > synapses_;
107  priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_;
108  priority_queue< PostSynEvent, vector< PostSynEvent >, ComparePostSynEvent > postEvents_;
109  double aMinus_;
110  double aMinus0_;
111  double tauMinus_;
112  double aPlus0_;
113  double tauPlus_;
114  double weightMax_;
115  double weightMin_;
116 };
117 
118 #endif // _STDP_SYN_HANDLER_H
unsigned int vGetNumSynapses() const
STDPSynapse * vGetSynapse(unsigned int i)
priority_queue< PostSynEvent, vector< PostSynEvent >, ComparePostSynEvent > postEvents_
void vReinit(const Eref &e, ProcPtr p)
void setWeightMin(double v)
double getWeightMin() const
double getTauPlus() const
void setTauMinus(double v)
void vProcess(const Eref &e, ProcPtr p)
double getTopSpike(unsigned int index) const
void addSpike(unsigned int index, double time, double weight)
void dropSynapse(unsigned int droppedSynNumber)
void setTauPlus(double v)
vector< STDPSynapse > synapses_
void setAPlus0(double v)
void setAMinus0(double v)
void setWeightMax(double v)
double getTauMinus() const
priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_
Definition: Eref.h:26
void vSetNumSynapses(unsigned int num)
void setAMinus(double v)
double getAMinus0() const
double getAPlus0() const
unsigned int addSynapse()
Adds a new synapse, returns its index.
double getAMinus() const
static const Cinfo * initCinfo()
STDPSynHandler & operator=(const STDPSynHandler &other)
double getWeightMax() const
Definition: Cinfo.h:18
void addPostSpike(const Eref &e, double time)