10 #include "../basecode/header.h"
22 "Name",
"GraupnerBrunel2012CaPlasticitySynHandler",
23 "Author",
"Aditya Gilra",
25 "The GraupnerBrunel2012CaPlasticitySynHandler handles synapses"
26 "with Ca-based plasticity as per Higgins et al. 2014 and Graupner and Brunel 2012."
28 " Here, Ca ('chemical Ca') is updated only at each pre-spike, pre-spike+delayD and post-spike!"
29 " So it is inaccurate to use it for say Ca-dependent K channels in the electrical compartment,"
30 " for which you use are advised to use the CaPool i.e. 'electrical Ca'."
32 " Ca here is post-synaptic 'chemical Ca' common for all synapses in this SynHandler,"
33 " so weights of all pre-synapses connected to this SynHandler get updated"
34 " at each pre-spike, pre-spike+delayD and post-spike!"
35 " So if all pre-synaptic weights start out the same, they remain the same!!"
36 " If you want to consider each pre-synapse independently,"
37 " have independent SynHandlers for each synapse."
38 " If these SynHandlers are in the same electrical compartment,"
39 " you're essentially assuming these are on different spines,"
40 " with their own 'chemical Ca' which won't match the"
41 " 'electrical Ca' of the compartment (=dendrite)."
42 " If you put each SynHandler with a single synapse"
43 " in its own electrical compartment (=spine),"
44 " only then can you have an 'electrical Ca'"
45 " corresponding to the 'chemical Ca'."
46 "Three priority queues are used to manage pre, post, and pre+delayD spikes."
51 "Ca is a post-synaptic decaying variable as a proxy for Ca concentration"
52 "and receives an impulse whenever a pre- or post- spike occurs."
53 "Caution: Ca is updated via an event-based rule, so it is only updated and valid"
54 "when a pre- or post- spike has occured, or at time delayD after a pre-spike."
55 "Do not use it to control a Ca dependent current, etc."
56 "See notes in the class Description: all pre-synapses get updated via the same post-synaptic Ca.",
63 "CaInit is the initial value for Ca",
70 "tauCa is the time constant for decay of Ca",
77 "tauSyn is the time constant for synaptic weight evolution equation",
84 "CaPre is added to Ca on every pre-spike",
91 "CaPost is added to Ca on every post-spike",
98 "Time delay D after pre-spike, when Ca is increased by Capre."
99 " delayD represents NMDA rise time.",
106 "gammaP is the potentiation factor for synaptic weight increase if Ca>thetaP",
113 "gammaD is the depression factor for synaptic weight decrease if Ca>thetaD",
120 "Potentiation threshold for Ca"
121 "User must ensure thetaP>thetaD, else simulation results will be wrong.",
128 "Depression threshold for Ca"
129 "User must ensure thetaP>thetaD, else simulation results will be wrong.",
136 "If true, the synapse is bistable as in GraupnerBrunel2012 paper."
137 "The effect of potential on the weight update is usually ignorable"
138 " if Ca is above thetaP and thetaD most of the time.",
145 "If true, turn noise on as per noiseSD",
152 "Standard deviation of noise added to Ca",
159 "An upper bound on the weight",
166 "A lower bound on the weight",
173 "Scale all pre-synaptic weights by weightScale before adding to activation (default 1.0)"
174 "In the terminology of the paper Higgins et al 2012, weight is synaptic efficacy,"
175 "while weightScale*weight is what finally is added to activation variable.",
182 "Handles arriving spike messages from post-synaptic neuron, inserts into postEvent queue.",
188 "Sets up field Elements for synapse",
195 static Finfo* GraupnerBrunel2012CaPlasticitySynHandlerFinfos[] =
220 "GraupnerBrunel2012CaPlasticitySynHandler",
222 GraupnerBrunel2012CaPlasticitySynHandlerFinfos,
223 sizeof( GraupnerBrunel2012CaPlasticitySynHandlerFinfos ) /
sizeof (
Finfo* ),
226 sizeof( doc ) /
sizeof(
string )
283 for ( vector< Synapse >::iterator
285 i->setHandler(
this );
300 unsigned int prevSize =
synapses_.size();
302 for (
unsigned int i = prevSize; i < v; ++i )
316 cout <<
"Warning: GraupnerBrunel2012CaPlasticitySynHandler::getSynapse: index: " << i <<
317 " is out of range: " <<
synapses_.size() << endl;
322 unsigned int index,
double time,
double weight )
330 unsigned int index )
const
349 lastCaUpdateTime_ = currTime;
385 wUp.
tD = deltaT - wUp.
tP;
394 wUp.
t0 = deltaT - wUp.
tP - wUp.
tD;
408 sqrt( ( 1.0-exp(-2*gPgD*wUp.
tP/
tauSyn_) ) / gPgD );
444 if (wFacPtr->
tP > 0.0)
446 newWeight = wFacPtr->
A + wFacPtr->
B*newWeight + wFacPtr->
C;
449 if (wFacPtr->
tD > 0.0)
451 newWeight = wFacPtr->
D*newWeight + wFacPtr->
E;
460 double chi0 = pow((newWeight-0.5),2.0) / (newWeight*(newWeight-1));
461 double weightDeviation = 0.5*sqrt( 1.0 + 1.0/(chi0*exp(wFacPtr->
t0/2.0/
tauSyn_)-1.0) );
464 newWeight = 0.5 - weightDeviation;
468 newWeight = 0.5 + weightDeviation;
483 double activation = 0.0;
485 bool CaFactorsUpdated =
false;
498 unsigned int synIndex = currEvent.
synIndex;
528 if (!CaFactorsUpdated)
532 CaFactorsUpdated =
true;
537 if ( activation != 0.0 )
546 if (!CaFactorsUpdated)
550 CaFactorsUpdated =
true;
562 if (!CaFactorsUpdated)
566 CaFactorsUpdated =
true;
576 if (CaFactorsUpdated)
579 for (
unsigned int i=0; i<
synapses_.size(); i++)
605 unsigned int newSynIndex =
synapses_.size();
607 synapses_[newSynIndex].setHandler(
this );
void vProcess(const Eref &e, ProcPtr p)
GraupnerBrunel2012CaPlasticitySynHandler & operator=(const GraupnerBrunel2012CaPlasticitySynHandler &other)
void setWeightScale(double v)
void setNumSynapses(unsigned int num)
void addSpike(unsigned int index, double time, double weight)
moose::MOOSE_RNG_DEFAULT_ENGINE rng_
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
unsigned int getNumSynapses() const
void vReinit(const Eref &e, ProcPtr p)
void dropSynapse(unsigned int droppedSynNumber)
void log(string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
Log to console (and to a log-file)
static const Cinfo * GraupnerBrunel2012CaPlasticitySynHandlerCinfo
static const Cinfo * initCinfo()
void updateWeight(Synapse *synPtr, weightFactors *wFacPtr)
Synapse * getSynapse(unsigned int i)
GraupnerBrunel2012CaPlasticitySynHandler()
priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > delayDPreEvents_
moose::MOOSE_RANDOM_DEVICE rd_
static const Cinfo * initCinfo()
void setWeightMax(double v)
void vSetNumSynapses(unsigned int num)
priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_
void setNoiseSD(double v)
vector< Synapse > synapses_
moose::MOOSE_NORMAL_DISTRIBUTION< double > dist_
Synapse * vGetSynapse(unsigned int i)
bool rangeWarning(const string &field, double value)
void setWeightMin(double v)
double getTopSpike(unsigned int index) const
static SrcFinfo1< double > * activationOut()
weightFactors updateCaWeightFactors(double currTime)
unsigned int vGetNumSynapses() const
priority_queue< PostSynEvent, vector< PostSynEvent >, ComparePostSynEvent > postEvents_
static const Cinfo * initCinfo()
void addPostSpike(const Eref &e, double time)
double getWeightMax() const
~GraupnerBrunel2012CaPlasticitySynHandler()
unsigned int addSynapse()
Adds a new synapse, returns its index.
static const Cinfo * synHandlerCinfo
double getWeightMin() const
double getWeightScale() const
double getNoiseSD() const