Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

spikingsynapse.h

Go to the documentation of this file.
00001 
00005 #ifndef _SPIKINGSYNAPSE_H_
00006 #define _SPIKINGSYNAPSE_H_
00007 
00008 #include "synapse.h"
00009 
00010 class SpikingSynapse;
00011 
00012 typedef int (SpikingSynapse:: *pSpikeHandler)(void); // pointer of spike handler routine
00013 
00014 class SpikingSynapse;
00015 
00016 #define NEED_TO_ACTIVATE \
00017   /* since psr = psr*decay in the same time step we undo this first */ \
00018   /* psr /= decay; */ \
00019   /* do we need to activate this synapse? */ \
00020   register bool activate = (steps2cutoff == 0); \
00021   /* now calc the new cutoff point */ \
00022   steps2cutoff = (int)(PSR_MULTIPLE_TAU*tau/DT+0.5); \
00023   return activate; 
00024 
00026 
00033 class SpikingSynapse : public Synapse {
00034  public:
00035 
00036   // The default constructor
00037   SpikingSynapse(void);
00038 
00039   // The destructor
00040   virtual ~SpikingSynapse(void);
00041 
00042   // Advance the state of the Synapse
00043   virtual int advance(void);
00044 
00045   // Reset to initial condition.
00046   virtual void reset(void);
00047 
00048   // Update internal variables
00049   virtual int updateInternal(void);
00050 
00051 
00054 
00063   // float p;
00064 
00066 
00068   float tau;
00069 
00070   inline bool checkForActivation(void);
00071 
00073 
00079   virtual int preSpikeHit(void) { return checkForActivation(); };
00080 
00082   virtual int addIncoming(Advancable *a);
00083 
00085   virtual int addOutgoing(Advancable *a);
00086 
00087  protected:
00088 
00089   int steps2cutoff;
00090   
00092 
00094   double decay;
00095 
00096 };
00097 
00098 #endif