00001 #ifndef MULTITHREADSPIKESCHEDULER_H_ 00002 #define MULTITHREADSPIKESCHEDULER_H_ 00003 00004 #include "MTSpikeRoutingTables.h" 00005 #include "MTPropagatedSpikeBuffers.h" 00006 #include "SimParameter.h" 00007 #include "SingleThreadSpikeScheduler.h" 00008 #include <iostream> 00009 00010 using std::cout; 00011 using std::endl; 00012 00014 00021 class MultiThreadSpikeScheduler : public SpikeScheduler 00022 { 00023 00024 public: 00026 00035 MultiThreadSpikeScheduler(int numThreads, 00036 MTSpikeRoutingTables &tables, 00037 vector<PropagatedSpikeBuffer*> &stBuffers, 00038 SimParameter &sp); 00039 00040 virtual ~MultiThreadSpikeScheduler(); 00041 00043 /* 00044 * It is invoked by the SingleThreadSimEngine when some advancing spiking object generates a spike. 00045 * 00046 * \param senderid Identifier of the sim object that emits the spike. 00047 * 00048 * \param time The exact moment in time (from the start of the simulation) in secs when the spike occured. 00049 * 00050 * \param engine engineid of the local engine where sender object belongs. 00051 */ 00052 virtual void scheduleSpike(local_objectid_t senderid, float offsetFraction, engineid_t engine = 0); 00053 00055 00064 virtual void deliverSpikes(SpikeReceiverList &listActiveSynapses, 00065 engineid_t engine, double simTime, int stepOffset = 0 ); 00066 00067 00068 00070 virtual void reset(); 00071 00073 00079 virtual void advance(engineid_t engine = 0); 00080 00082 00085 virtual void nextCycle(); 00086 00087 protected: 00089 int _numThreads; 00090 00092 vector<SingleThreadSpikeScheduler> STschedulers; 00093 00095 MTSpikeRoutingTables &rtables ; 00096 00098 NodeLocalMultiTargetDelayMap &mTDelayMap; 00099 00101 SpikeTargetGroupPool &tgtGrpPool ; 00102 00104 SimParameter &_simParam ; 00105 00107 vector<PropagatedSpikeBuffer*> &STbuffers; 00108 00110 MTPropagatedSpikeBuffers mTSpikeBuffers; 00111 00113 int * engineSteps; 00114 00115 00117 int nCycleSteps ; 00118 00119 }; 00120 00121 #endif /*MULTITHREADSPIKESCHEDULER_H_*/