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);
00013
00014 class SpikingSynapse;
00015
00016 #define NEED_TO_ACTIVATE \
00017 \
00018 \
00019 \
00020 register bool activate = (steps2cutoff == 0); \
00021 \
00022 steps2cutoff = (int)(PSR_MULTIPLE_TAU*tau/DT+0.5); \
00023 return activate;
00024
00026
00033 class SpikingSynapse : public Synapse {
00034 public:
00035
00036
00037 SpikingSynapse(void);
00038
00039
00040 virtual ~SpikingSynapse(void);
00041
00042
00043 virtual int advance(void);
00044
00045
00046 virtual void reset(void);
00047
00048
00049 virtual int updateInternal(void);
00050
00051
00054
00063
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