STDistributedIncomingSpikeScheduler.cpp

Go to the documentation of this file.
00001 #include "STDistributedIncomingSpikeScheduler.h"
00002 
00003 #include <iostream>
00004 
00005 using std::cerr;
00006 using std::endl;
00007 
00008 STDistributedIncomingSpikeScheduler::STDistributedIncomingSpikeScheduler(
00009     MPIInputBufferVector &inputBuffers,
00010     GlobalSingleTargetDelayMap &globalDelayMap,
00011     PropagatedSpikeBuffer &spikeBuffer,
00012     int cycleSteps) :
00013         spikeBuf(spikeBuffer), mpiInBuffers(inputBuffers), delayMap(globalDelayMap),
00014         _cycleSteps(cycleSteps)
00015 {}
00016 
00017 STDistributedIncomingSpikeScheduler::~STDistributedIncomingSpikeScheduler()
00018 {}
00019 
00020 void STDistributedIncomingSpikeScheduler::processMPIInputSpikeBuffers()
00021 {
00022     MPIInputSpikeBuffer<>::const_iterator it;
00023 
00024     for (unsigned int i = 0 ; i < mpiInBuffers.size() ; i++) {
00025         if (mpiInBuffers[i].getContentType() != MPIMessageSpec::contentAnalog)
00026             if (mpiInBuffers[i].spikeBuf().hasNewContent())
00027                 for (it = mpiInBuffers[i].spikeBuf().begin() ; it != mpiInBuffers[i].spikeBuf().end(); ++it) {
00028                     //cerr << "spike glengine=" << it->engine << " oid=" << it->oid << endl;
00029                     GlobalSingleTargetDelayMap::const_iterator delay_it;
00030                     if (delayMap.hasDelays(it->engine,it->oid))
00031                         for (delay_it = delayMap.beginDelays(it->engine, it->oid);
00032                                 delay_it != delayMap.endDelays(it->engine, it->oid) ; ++delay_it) {
00033                             spikeBuf.scheduleSpikeTargetGroup(delay_it->second, delay_it->first + it->timestamp - _cycleSteps, 1.0 );
00034                         }
00035                 }
00036     }
00037 }
00038 

Generated on Wed Jul 9 16:34:38 2008 for PCSIM by  doxygen 1.5.5