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

#include <SynChan.h>

+ Inheritance diagram for SynChan:
+ Collaboration diagram for SynChan:

Public Member Functions

void activation (double val)
 
double calcGk ()
 Update alpha function terms for synaptic channel. More...
 
bool getNormalizeWeights () const
 
double getTau1 () const
 
double getTau2 () const
 
void normalizeGbar ()
 
void setNormalizeWeights (bool value)
 
void setTau1 (double tau1)
 
void setTau2 (double tau2)
 
 SynChan ()
 
void vProcess (const Eref &e, ProcPtr p)
 
void vReinit (const Eref &e, ProcPtr p)
 
void vSetGbar (const Eref &e, double Gbar)
 
 ~SynChan ()
 
- Public Member Functions inherited from ChanCommon
 ChanCommon ()
 
double getGbar () const
 Utility function to acces Gbar. More...
 
double getModulation () const
 
double getVm () const
 Utility function to access Vm. More...
 
void sendProcessMsgs (const Eref &e, const ProcPtr info)
 
void sendReinitMsgs (const Eref &e, const ProcPtr info)
 
void updateIk ()
 
double vGetEk (const Eref &e) const
 
double vGetGbar (const Eref &e) const
 
double vGetGk (const Eref &e) const
 
double vGetIk (const Eref &e) const
 
double vGetModulation (const Eref &e) const
 
void vHandleVm (double Vm)
 
void vSetEk (const Eref &e, double Ek)
 
void vSetGk (const Eref &e, double Gk)
 
void vSetIk (const Eref &e, double Ic)
 
void vSetModulation (const Eref &e, double modulation)
 
 ~ChanCommon ()
 
- Public Member Functions inherited from ChanBase
 ChanBase ()
 
double getEk (const Eref &e) const
 
double getGbar (const Eref &e) const
 
double getGk (const Eref &e) const
 
double getIk (const Eref &e) const
 
double getModulation (const Eref &e) const
 
void handleVm (double Vm)
 
void process (const Eref &e, const ProcPtr info)
 
void reinit (const Eref &e, const ProcPtr info)
 
void setEk (const Eref &e, double Ek)
 
void setGbar (const Eref &e, double Gbar)
 
void setGk (const Eref &e, double Gk)
 
void setIk (const Eref &e, double Ic)
 
void setModulation (const Eref &e, double modulation)
 
 ~ChanBase ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from ChanCommon
static const CinfoinitCinfo ()
 Specify the Class Info static variable for initialization. More...
 
- Static Public Member Functions inherited from ChanBase
static SrcFinfo2< double,
double > * 
channelOut ()
 
static SrcFinfo1< double > * IkOut ()
 
static const CinfoinitCinfo ()
 Specify the Class Info static variable for initialization. More...
 
static SrcFinfo1< double > * permeability ()
 

Protected Attributes

double activation_
 
double dt_
 
double norm_
 
int normalizeWeights_
 
double tau1_
 
double tau2_
 
double X_
 
double xconst1_
 
double xconst2_
 
double Y_
 
double yconst1_
 
double yconst2_
 
- Protected Attributes inherited from ChanCommon
double Vm_
 Vm_ is input variable from compartment, used for most rates. More...
 

Detailed Description

Definition at line 13 of file SynChan.h.

Constructor & Destructor Documentation

SynChan::SynChan ( )

Definition at line 95 of file SynChan.cpp.

96  :
97  tau1_( 1.0e-3 ), tau2_( 1.0e-3 ),
98  normalizeWeights_( 0 ),
99  xconst1_(0.0),
100  yconst1_(1.0),
101  xconst2_(1.0),
102  yconst2_(0.0),
103  norm_(1.0),
104  activation_(0.0),
105  X_(0.0),
106  Y_(0.0),
107  dt_( 25.0e-6 )
108 { ; }
double tau2_
Definition: SynChan.h:75
double Y_
Definition: SynChan.h:84
double tau1_
Definition: SynChan.h:74
double yconst1_
Definition: SynChan.h:78
double activation_
Definition: SynChan.h:82
int normalizeWeights_
Definition: SynChan.h:76
double dt_
Definition: SynChan.h:85
double xconst1_
Definition: SynChan.h:77
double yconst2_
Definition: SynChan.h:80
double X_
Definition: SynChan.h:83
double xconst2_
Definition: SynChan.h:79
double norm_
Definition: SynChan.h:81
SynChan::~SynChan ( )

Definition at line 110 of file SynChan.cpp.

111 {;}

Member Function Documentation

void SynChan::activation ( double  val)

Definition at line 253 of file SynChan.cpp.

References activation_.

Referenced by initCinfo().

254 {
255  activation_ += val;
256 }
double activation_
Definition: SynChan.h:82

+ Here is the caller graph for this function:

double SynChan::calcGk ( )

Update alpha function terms for synaptic channel.

Utility function used to do the alpha function calculations for Gk. Separated out for convenience so that derived classes can use.

Definition at line 200 of file SynChan.cpp.

References activation_, ChanCommon::getModulation(), norm_, X_, xconst1_, xconst2_, Y_, yconst1_, and yconst2_.

Referenced by vProcess(), and NMDAChan::vProcess().

201 {
202  /*
203  X_ = getModulation() * activation_ * xconst1_ + X_ * xconst2_;
204  Y_ = X_ * yconst1_ + Y_ * yconst2_;
205  activation_ = 0.0;
206  return Y_ * norm_;
207  */
209  Y_ = X_ * yconst1_ + Y_ * yconst2_;
210  activation_ = 0.0;
211  return Y_ * norm_ * getModulation();
212 }
double Y_
Definition: SynChan.h:84
double yconst1_
Definition: SynChan.h:78
double activation_
Definition: SynChan.h:82
double xconst1_
Definition: SynChan.h:77
double yconst2_
Definition: SynChan.h:80
double X_
Definition: SynChan.h:83
double getModulation() const
Definition: ChanCommon.cpp:54
double xconst2_
Definition: SynChan.h:79
double norm_
Definition: SynChan.h:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SynChan::getNormalizeWeights ( ) const

Definition at line 166 of file SynChan.cpp.

References normalizeWeights_.

Referenced by initCinfo().

167 {
168  return normalizeWeights_;
169 }
int normalizeWeights_
Definition: SynChan.h:76

+ Here is the caller graph for this function:

double SynChan::getTau1 ( ) const

Definition at line 134 of file SynChan.cpp.

References tau1_.

Referenced by initCinfo().

135 {
136  return tau1_;
137 }
double tau1_
Definition: SynChan.h:74

+ Here is the caller graph for this function:

double SynChan::getTau2 ( ) const

Definition at line 156 of file SynChan.cpp.

References tau2_.

Referenced by initCinfo().

157 {
158  return tau2_;
159 }
double tau2_
Definition: SynChan.h:75

+ Here is the caller graph for this function:

const Cinfo * SynChan::initCinfo ( )
static

Override base class function for spike handling

Definition at line 20 of file SynChan.cpp.

References activation(), getNormalizeWeights(), getTau1(), getTau2(), ChanBase::initCinfo(), setNormalizeWeights(), setTau1(), and setTau2().

Referenced by NMDAChan::initCinfo().

21 {
23  // Shared message definitions
25 
27 // Field definitions
29  static ValueFinfo< SynChan, double > tau1( "tau1",
30  "Decay time constant for the synaptic conductance, tau1 >= tau2.",
33  );
34  static ValueFinfo< SynChan, double > tau2( "tau2",
35  "Rise time constant for the synaptic conductance, tau1 >= tau2.",
38  );
39  static ValueFinfo< SynChan, bool > normalizeWeights(
40  "normalizeWeights",
41  "Flag. If true, the overall conductance is normalized by the "
42  "number of individual synapses in this SynChan object.",
45  );
46 
48  // MsgDest definitions
50  static DestFinfo activation( "activation",
51  "Sometimes we want to continuously activate the channel",
53  );
54 
55  static Finfo* SynChanFinfos[] =
56  {
57  &tau1, // Value
58  &tau2, // Value
59  &normalizeWeights, // Value
60  &activation, // Dest
61  };
62 
63  static string doc[] =
64  {
65  "Name", "SynChan",
66  "Author", "Upinder S. Bhalla, 2007, 2014, NCBS",
67  "Description", "SynChan: Synaptic channel incorporating "
68  " weight and delay. Does not handle actual arrival of synaptic "
69  " events, that is done by one of the derived classes of "
70  "SynHandlerBase.\n"
71  "In use, the SynChan sits on the compartment connected to it by "
72  "the **channel** message. One or more of the SynHandler "
73  "objects connects to the SynChan through the **activation** "
74  "message. The SynHandlers each manage multiple synapses, and "
75  "the handlers can be fixed weight or have a learning rule. "
76  };
77 
78  static Dinfo< SynChan > dinfo;
79 
80  static Cinfo SynChanCinfo(
81  "SynChan",
83  SynChanFinfos,
84  sizeof( SynChanFinfos )/sizeof(Finfo *),
85  &dinfo,
86  doc,
87  sizeof( doc )/sizeof( string )
88  );
89 
90  return &SynChanCinfo;
91 }
Definition: Dinfo.h:60
void setTau2(double tau2)
Definition: SynChan.cpp:139
double getTau1() const
Definition: SynChan.cpp:134
void activation(double val)
Definition: SynChan.cpp:253
bool getNormalizeWeights() const
Definition: SynChan.cpp:166
void setNormalizeWeights(bool value)
Definition: SynChan.cpp:161
void setTau1(double tau1)
Definition: SynChan.cpp:123
Definition: OpFunc.h:27
double getTau2() const
Definition: SynChan.cpp:156
Definition: Cinfo.h:18
static const Cinfo * initCinfo()
Specify the Class Info static variable for initialization.
Definition: ChanBase.cpp:36
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SynChan::normalizeGbar ( )

Definition at line 171 of file SynChan.cpp.

References doubleEq(), ChanCommon::getGbar(), moose::log(), norm_, SynE(), tau1_, and tau2_.

Referenced by setTau1(), setTau2(), vReinit(), and vSetGbar().

172 {
173  if ( doubleEq( tau2_, 0.0 ) ) {
174  // norm_ = 1.0;
176  } else {
177  if ( doubleEq( tau1_, tau2_ ) ) {
179  } else {
180  double tpeak = tau1_ * tau2_ * log( tau1_ / tau2_ ) /
181  ( tau1_ - tau2_ );
182  norm_ = ChanCommon::getGbar() * ( tau1_ - tau2_ ) /
183  ( tau1_ * tau2_ * (
184  exp( -tpeak / tau1_ ) - exp( -tpeak / tau2_ )
185  ));
186  }
187  }
188  /*
189  * Can't handle at this time. Simple but tedious to implement.
190  if ( normalizeWeights_ && getNumSynapses() > 0 )
191  norm_ /= static_cast< double >( getNumSynapses() );
192  */
193 }
double tau2_
Definition: SynChan.h:75
double tau1_
Definition: SynChan.h:74
void log(string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
Log to console (and to a log-file)
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16
const double & SynE()
Definition: SynChan.cpp:15
double getGbar() const
Utility function to acces Gbar.
Definition: ChanCommon.cpp:129
double norm_
Definition: SynChan.h:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SynChan::setNormalizeWeights ( bool  value)

Definition at line 161 of file SynChan.cpp.

References normalizeWeights_, and value.

Referenced by initCinfo().

162 {
164 }
uint32_t value
Definition: moosemodule.h:42
int normalizeWeights_
Definition: SynChan.h:76

+ Here is the caller graph for this function:

void SynChan::setTau1 ( double  tau1)

Definition at line 123 of file SynChan.cpp.

References dt_, normalizeGbar(), tau1_, xconst1_, and xconst2_.

Referenced by initCinfo().

124 {
125  tau1_ = tau1;
126  // Aditya added
127  // required if changing tau1 during a simulation
128  // (eg. Marder pyloric networks).
129  xconst1_ = tau1_ * ( 1.0 - exp( -dt_ / tau1_ ) );
130  xconst2_ = exp( -dt_ / tau1_ );
131  normalizeGbar();
132 }
double tau1_
Definition: SynChan.h:74
void normalizeGbar()
Definition: SynChan.cpp:171
double dt_
Definition: SynChan.h:85
double xconst1_
Definition: SynChan.h:77
double xconst2_
Definition: SynChan.h:79

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SynChan::setTau2 ( double  tau2)

Definition at line 139 of file SynChan.cpp.

References doubleEq(), dt_, normalizeGbar(), tau2_, yconst1_, and yconst2_.

Referenced by initCinfo().

140 {
141  tau2_ = tau2;
142  // Aditya added
143  // required if changing tau1 during a simulation
144  // (eg. Marder pyloric networks).
145  if ( doubleEq( tau2_, 0.0 ) ) {
146  yconst1_ = 1.0;
147  yconst2_ = 0.0;
148  } else {
149  yconst1_ = tau2_ * ( 1.0 - exp( -dt_ / tau2_ ) );
150  yconst2_ = exp( -dt_ / tau2_ );
151  }
152  normalizeGbar();
153 
154 }
double tau2_
Definition: SynChan.h:75
double yconst1_
Definition: SynChan.h:78
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16
void normalizeGbar()
Definition: SynChan.cpp:171
double dt_
Definition: SynChan.h:85
double yconst2_
Definition: SynChan.h:80

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SynChan::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

Implements ChanBase.

Definition at line 214 of file SynChan.cpp.

References calcGk(), ChanCommon::sendProcessMsgs(), ChanBase::setGk(), and ChanCommon::updateIk().

215 {
216  // http://www.genesis-sim.org/GENESIS/Hyperdoc/Manual-26.html#synchan
217  // For a spike event, activation = weight / dt
218  // is sent from SynHandler-s for one dt
219  // For continuous activation in a graded synapse,
220  // send activation for continous dt-s.
221  setGk( e, calcGk() );
222  updateIk();
223  sendProcessMsgs( e, info ); // Sends out messages for channel.
224 }
void updateIk()
Definition: ChanCommon.cpp:119
void setGk(const Eref &e, double Gk)
Definition: ChanBase.cpp:216
double calcGk()
Update alpha function terms for synaptic channel.
Definition: SynChan.cpp:200
void sendProcessMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:100

+ Here is the call graph for this function:

void SynChan::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

Implements ChanBase.

Definition at line 229 of file SynChan.cpp.

References activation_, doubleEq(), ProcInfo::dt, dt_, normalizeGbar(), ChanCommon::sendReinitMsgs(), ChanBase::setGk(), ChanBase::setIk(), tau1_, tau2_, X_, xconst1_, xconst2_, Y_, yconst1_, and yconst2_.

Referenced by NMDAChan::vReinit().

230 {
231  dt_ = info->dt;
232  activation_ = 0.0;
233  ChanBase::setGk( e, 0.0 );
234  ChanBase::setIk( e, 0.0 );
235  X_ = 0.0;
236  Y_ = 0.0;
237  // These below statements are also called when setting tau1 and tau2
238  // (required when changing tau1 and tau2 during a simulation).
239  xconst1_ = tau1_ * ( 1.0 - exp( -dt_ / tau1_ ) );
240  xconst2_ = exp( -dt_ / tau1_ );
241 
242  if ( doubleEq( tau2_, 0.0 ) ) {
243  yconst1_ = 1.0;
244  yconst2_ = 0.0;
245  } else {
246  yconst1_ = tau2_ * ( 1.0 - exp( -dt_ / tau2_ ) );
247  yconst2_ = exp( -dt_ / tau2_ );
248  }
249  normalizeGbar();
250  sendReinitMsgs(e, info);
251 }
void setIk(const Eref &e, double Ic)
Definition: ChanBase.cpp:225
double tau2_
Definition: SynChan.h:75
double Y_
Definition: SynChan.h:84
double tau1_
Definition: SynChan.h:74
double yconst1_
Definition: SynChan.h:78
void setGk(const Eref &e, double Gk)
Definition: ChanBase.cpp:216
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16
double activation_
Definition: SynChan.h:82
void normalizeGbar()
Definition: SynChan.cpp:171
double dt_
Definition: SynChan.h:85
double xconst1_
Definition: SynChan.h:77
void sendReinitMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:111
double yconst2_
Definition: SynChan.h:80
double X_
Definition: SynChan.h:83
double xconst2_
Definition: SynChan.h:79

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SynChan::vSetGbar ( const Eref e,
double  Gbar 
)
virtual

Reimplemented from ChanCommon.

Definition at line 117 of file SynChan.cpp.

References normalizeGbar(), and ChanCommon::vSetGbar().

118 {
119  ChanCommon::vSetGbar( e, Gbar );
120  normalizeGbar();
121 }
void normalizeGbar()
Definition: SynChan.cpp:171
void vSetGbar(const Eref &e, double Gbar)
Definition: ChanCommon.cpp:34

+ Here is the call graph for this function:

Member Data Documentation

double SynChan::activation_
protected

Definition at line 82 of file SynChan.h.

Referenced by activation(), calcGk(), and vReinit().

double SynChan::dt_
protected

Definition at line 85 of file SynChan.h.

Referenced by setTau1(), setTau2(), and vReinit().

double SynChan::norm_
protected

Definition at line 81 of file SynChan.h.

Referenced by calcGk(), and normalizeGbar().

int SynChan::normalizeWeights_
protected

Definition at line 76 of file SynChan.h.

Referenced by getNormalizeWeights(), and setNormalizeWeights().

double SynChan::tau1_
protected

Definition at line 74 of file SynChan.h.

Referenced by getTau1(), normalizeGbar(), setTau1(), and vReinit().

double SynChan::tau2_
protected

Definition at line 75 of file SynChan.h.

Referenced by getTau2(), normalizeGbar(), setTau2(), and vReinit().

double SynChan::X_
protected

Definition at line 83 of file SynChan.h.

Referenced by calcGk(), and vReinit().

double SynChan::xconst1_
protected

Definition at line 77 of file SynChan.h.

Referenced by calcGk(), setTau1(), and vReinit().

double SynChan::xconst2_
protected

Definition at line 79 of file SynChan.h.

Referenced by calcGk(), setTau1(), and vReinit().

double SynChan::Y_
protected

Definition at line 84 of file SynChan.h.

Referenced by calcGk(), and vReinit().

double SynChan::yconst1_
protected

Definition at line 78 of file SynChan.h.

Referenced by calcGk(), setTau2(), and vReinit().

double SynChan::yconst2_
protected

Definition at line 80 of file SynChan.h.

Referenced by calcGk(), setTau2(), and vReinit().


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