ODESystemBasedSpikingNeuron.h

Go to the documentation of this file.
00001 //
00002 // C++ Interface: ODESystemBasedSpikingNeuron
00003 //
00004 // Description:
00005 //
00006 //
00007 // Author: Thomas Natschläger <tnatschl@lichtenberg>, (C) 2007
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 #ifndef ODESYSTEMBASEDSPIKINGNEURON_H
00013 #define ODESYSTEMBASEDSPIKINGNEURON_H
00014 
00015 #include "InputTargetTypes.h"
00016 #include "SpikeSender.h"
00017 #include "SimObject.h"
00018 #include "ODESystem.h"
00019 #include "ThreadSpecificRandomDistribution.h"
00020 
00024 class ODESystemBasedSpikingNeuron : public SimObject, public SingleOutputSpikeSender, public ConductanceInputTarget, public odeiv::ODESystem {
00025     public:
00026 
00027         ODESystemBasedSpikingNeuron( size_t dim );
00028 
00029         virtual ~ODESystemBasedSpikingNeuron();
00030 
00032         float Rm;
00033 
00035         float Cm;
00036 
00038         float Vresting;
00039 
00041         float Vthresh;
00042 
00044         float Vinit;
00045 
00047         double Em;
00048 
00050         float Trefract;
00051 
00053         float Inoise;
00054 
00056         float Iinject;
00057 
00058         virtual int init(InitializeInfo *ii);
00059 
00061         virtual int adjust( double dt );
00062 
00064         int reset( double dt, double *y0 );
00065 
00067         virtual int advance( AdvanceInfo const & );
00068 
00070         virtual void copySolverStateToFields() {
00071             Vm = solver->y(0);
00072         }
00073 
00075         virtual double getVm() {
00076             return solver->y(0);
00077         }
00078 
00079         //
00081 
00082 
00083         virtual double getManagedDelay() const {
00084             return 0;
00085         }
00086         virtual int nSpikeInputPorts() const {
00087             return 0;
00088         };
00089         virtual int nSpikeOutputPorts() const {
00090             return 1;
00091         };
00092         virtual int nAnalogInputPorts() const {
00093             return 0;
00094         };
00095         virtual int nAnalogOutputPorts() const {
00096             return this->dimension();
00097         };
00098 
00099         virtual PortType outputPortType( port_t o ) const {
00100             if ( o == 0 )
00101                 return spiking;
00102             else if ( o <= this->dimension() )
00103                 return analog;
00104             else
00105                 return undefined;
00106         };
00107 
00108         virtual PortType inputPortType( port_t i ) const {
00109             return undefined;
00110         };
00111 
00112         virtual double getAnalogOutput(analog_port_id_t port = 0) const {
00113             return solver->y(port-1);
00114         };
00115 
00117 
00118         //
00120 
00121 
00122         virtual void clearSynapticInput( void ) {
00123             Isyn = Gsyn = 0;
00124         };
00125 
00126         virtual void currentInput( double i) {
00127             Isyn += i;
00128         };
00129 
00130         virtual void conductanceInput( double g, double Erev ) {
00131             Gsyn += g;
00132             Isyn += ( g * Erev );
00133         };
00134 
00136 
00137     protected:
00138 
00140         double Vm;
00141 
00143         odeiv::Solver *solver;
00144 
00146         int nStepsInRefr;
00147 
00149         static ThreadSpecificRandomDistribution< NormalDistribution > noise;
00150 
00152         double Isyn;
00153 
00155         double Gsyn;
00156 
00157         // summation variables to be passed to the method derivates()
00158         double G0, I0;
00159 
00160 };
00161 
00162 #endif

Generated on Wed Jul 9 16:34:39 2008 for PCSIM by  doxygen 1.5.5