~mwshinn/+junk/structure

« back to all changes in this revision

Viewing changes to CalciumLGNNeuron.h

  • Committer: Max Shinn
  • Date: 2013-07-23 18:10:00 UTC
  • Revision ID: trombonechamp@gmail.com-20130723181000-cxyyrd2i7ql27vfb
Complete potential synapse based model with casting bug fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef CALCIUM_LGN_NEURON_H
2
 
#define CALCIUM_LGN_NEURON_H
3
 
 
4
 
#include "ANNarchy.h"
5
 
 
6
 
 
7
 
// Subclass of annarNeuron: leaky integrator with positive transfer function
8
 
class CalciumLGNNeuron : public annarNeuron
9
 
{
10
 
    public:
11
 
 
12
 
        CalciumLGNNeuron(class annarPopulation* population, int rank):  annarNeuron(population, rank){
13
 
        
14
 
            tau_=10.0;
15
 
            ca_tau_=10;
16
 
            ca_=0;
17
 
        };
18
 
 
19
 
        virtual void step(){
20
 
        
21
 
            // Update the membrane potential
22
 
            //mp_+= (input_-mp_) * 1/tau_;
23
 
                mp_+= (sum("FF")-mp_) * 1/tau_;
24
 
            
25
 
            // Update the instantaneous firing rate
26
 
            rate_=(positive(mp_));
27
 
 
28
 
            // Update the calcium trace
29
 
            ca_+=(rate_-ca_) * 1/ca_tau_;
30
 
        }
31
 
 
32
 
    protected:
33
 
        FLOAT ca_tau_;
34
 
        @VARIABLE FLOAT ca_;
35
 
        //@VARIABLE FLOAT input_;
36
 
 
37
 
};
38
 
 
39
 
 
40
 
 
41
 
#endif
 
1
#ifndef CALCIUM_LGN_NEURON_H
 
2
#define CALCIUM_LGN_NEURON_H
 
3
 
 
4
#include "ANNarchy.h"
 
5
 
 
6
 
 
7
// Subclass of annarNeuron: leaky integrator with positive transfer function
 
8
class CalciumLGNNeuron : public annarNeuron
 
9
{
 
10
    public:
 
11
 
 
12
        CalciumLGNNeuron(class annarPopulation* population, int rank):  annarNeuron(population, rank){
 
13
        
 
14
            tau_=10.0;
 
15
            ca_tau_=10;
 
16
            ca_=0;
 
17
            mean_rate_=0; // Used for axon growth/retraction
 
18
            mean_rate_tau_=20000;
 
19
        };
 
20
 
 
21
        virtual void step(){
 
22
        
 
23
            // Update the membrane potential
 
24
            //mp_+= (input_-mp_) * 1/tau_;
 
25
                mp_+= (sum("FF")-mp_) * 1/tau_;
 
26
            
 
27
            // Update the instantaneous firing rate
 
28
            rate_=(positive(mp_));
 
29
 
 
30
            // Update mean firing rate
 
31
            mean_rate_ += (rate_-mean_rate_) *(1/mean_rate_tau_);
 
32
 
 
33
            // Update the calcium trace
 
34
            ca_+=(rate_-ca_) * 1/ca_tau_;
 
35
        }
 
36
 
 
37
    protected:
 
38
        FLOAT ca_tau_;
 
39
        @PARAMETER FLOAT mean_rate_tau_;
 
40
        @VARIABLE FLOAT ca_;
 
41
        @VARIABLE FLOAT mean_rate_;
 
42
        //@VARIABLE FLOAT input_;
 
43
 
 
44
};
 
45
 
 
46
 
 
47
 
 
48
#endif