00001 #ifndef POISSONINPUTNEURON_H_ 00002 #define POISSONINPUTNEURON_H_ 00003 00004 #include "SimObject.h" 00005 #include "SpikeSender.h" 00006 #include "ThreadSpecificRandomDistribution.h" 00007 00008 #include <algorithm> 00009 00010 00011 class PoissonInputNeuron : public SimObject, public SingleOutputSpikeSender 00012 { 00013 SIMOBJECT( PoissonInputNeuron, AdvancePhase::One ) 00014 00015 public: 00016 explicit PoissonInputNeuron(); 00017 00018 explicit PoissonInputNeuron(double rate, double duration, double Tstart = 0, double Trefract = 0); 00019 00020 virtual ~PoissonInputNeuron(); 00021 00022 virtual int reset( double dt ); 00023 00024 virtual int advance(AdvanceInfo const &); 00025 00026 virtual double getManagedDelay() const { return 0; } 00027 virtual int nSpikeInputPorts() const { return 0; }; 00028 virtual int nSpikeOutputPorts() const { return 1; }; 00029 virtual int nAnalogInputPorts() const { return 0; }; 00030 virtual int nAnalogOutputPorts() const { return 0; }; 00031 00032 virtual PortType outputPortType(port_t o) const 00033 { 00034 if( o==0) return spiking; else return undefined; 00035 }; 00036 00037 virtual PortType inputPortType(port_t i) const 00038 { 00039 return undefined; 00040 }; 00041 00043 double rate; 00044 00046 double Tstart; 00047 00049 double duration; 00050 00052 double Trefract; 00053 00054 00055 protected: 00056 bool active; 00057 00058 double nextSpikeTime; // in seconds 00059 00060 double endTime; // in seconds 00061 00062 00063 00064 protected: 00065 static ThreadSpecificRandomDistribution< ExponentialDistribution > isi_gen; 00066 }; 00067 00068 #endif /*POISSONINPUTNEURON_H_*/