00001 #ifndef SQUAREPULSESPIKERESPONSE_H_ 00002 #define SQUAREPULSESPIKERESPONSE_H_ 00003 00004 #include "FiniteSpikeResponse.h" 00005 00006 #ifndef SWIG 00007 00008 #include <queue> 00009 using std::queue; 00010 00011 #include <iostream> 00012 using std::cerr; 00013 using std::endl; 00014 00015 #endif 00016 00017 class SquarePulseSpikeResponse : public FiniteSpikeResponse 00018 { 00019 SIMOBJECT ( SquarePulseSpikeResponse, AdvancePhase::SpikeDriven ) 00020 00021 public: 00022 SquarePulseSpikeResponse( 00023 const float A = 0.1, 00024 const float tau = 5e-4 00025 ): FiniteSpikeResponse(), A(A), tau(tau) 00026 { /* NOOP */ }; 00027 00028 virtual ~SquarePulseSpikeResponse() 00029 { /* NOOP */ }; 00030 00032 float A; 00033 00035 float tau; 00036 00037 // Reset to initial condition. 00038 virtual int reset( double dt ); 00039 00040 virtual int advance(AdvanceInfo const & ai); 00041 00042 virtual int spikeHit( spikeport_t port, SpikeEvent const& spike ); 00043 00045 virtual int psrLength(double dt) const; 00046 00047 private: 00048 queue<double> pulseEndings; 00049 queue<float> pulseWeights; 00050 }; 00051 00052 00053 #endif /*SquarePULSESPIKERESPONSE_H_*/