📄 fastneuron.h
字号:
/*************************************************************************** fastneuron.h - description ------------------- copyright : (C) 2002, 2003 by Matt Grover email : mgrover@amygdala.org ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#ifndef FASTNEURON_H#define FASTNEURON_H#include <amygdala/spikingneuron.h>#include <amygdala/spikingneuronproperties.h>#include <amygdala/factory.h>namespace Amygdala {class FastNeuronProperties: public SpikingNeuronProperties {public: FastNeuronProperties(); FastNeuronProperties(bool initializePhysicalProps); FastNeuronProperties(const FastNeuronProperties& rhs); virtual ~FastNeuronProperties(); float GetMembraneConst() const { return memTimeConst; } void SetMembraneConst(float timeConst) { memTimeConst = timeConst; } virtual FastNeuronProperties* Copy() const;protected: float memTimeConst; // Membrane time constant (ms)};/** @class FastNeuron fastneuron.h amygdala/fastneuron.h * @brief FastNeuron implements a neuron model with a PSP that * has no rise time and an exponential decay. * * Both the inhibitory * and excitatory PSPs have the form \f[ U = exp\left(\frac{-t}{\tau_m}\right) \f] * Only the membrane time constant is used for this neuron, the synaptic time * constant is assumed to be 0 regardless of how it is set through the API. * @see Neuron, AlphaNeuron, BasicNeuron * @author Matt Grover */class FastNeuron : public SpikingNeuron {public: typedef NeuronFactory<FastNeuron,FastNeuronProperties> Factory; virtual ~FastNeuron(); virtual float GetMembranePtnl() const;protected:/** @param neuronId A unique, positive integer that is used * to identify the neuron. * @param neuronProps The properties that will be assigned to this neuron */ FastNeuron(AmIdInt neuronId, const FastNeuronProperties& neuronProps);/** set the properties of this neuron */ virtual void SetProperties(NeuronProperties* props) {SetProperties(dynamic_cast<FastNeuronProperties*>(props)); } void SetProperties(FastNeuronProperties* props) { if (!props) throw 1; } // Functions: /** Send a spike to this Neuron. * @param inTime Time of input (microseconds). * @see Neuron::SendSpike(), Network::SendDelayedSpikes(). */ virtual void ProcessInput(const AmTimeInt& inTime); private: /** Calculate the value of the PSP function * for a given time. * @param calcTime Relative time of input (time since start of * the curve. * @param pspElement Pointer to the table element that will * hold the calculated value. */ void PspKernel(float calcTime, float* pspElement); void InitLookup(); /* * Tables used to cache value of PSP function * for each time step (number of steps cached is specified by * pspLSize) */ float* pspLookup; unsigned int pspStepSize; unsigned int pspLSize; template<class neuron, class neuronProperties> friend class NeuronFactory;};namespace Factory { static FastNeuron::Factory MakeFastNeuron;}} // namespace Amygdala#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -