📄 mpspikeinput.cpp
字号:
/*************************************************************************** mpspikeinput.cpp - description ------------------- begin : Sun Dec 23 2001 copyright : (C) 2001 by Rudiger Koch email : rudiger_koch@yahoo.com ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#include "mpspikeinput.h"#include "mpnetwork.h"#include "neuron.h"#include "instance.h"MpSpikeInput::MpSpikeInput(Network *NN) : SpikeInput(NN){ pthread_mutex_init(&spikes_mutex, NULL); spikes = new vector<Synapse* >; spikes_rest = new vector<Synapse* >; NN->SetSpikeInput(this); NN->StreamingInput(true);}MpSpikeInput::~MpSpikeInput(){}void MpSpikeInput::ReadInputBuffer(){ vector<Synapse* > *tmpSpikes = spikes_rest; pthread_mutex_lock(&spikes_mutex); spikes_rest = spikes; spikes = tmpSpikes; pthread_mutex_unlock(&spikes_mutex); net->ScheduleSpikeDelay(*spikes_rest); spikes_rest->clear();}void MpSpikeInput::queueSpike(Synapse *synapse){ pthread_mutex_lock(&spikes_mutex); spikes->push_back(synapse); pthread_mutex_unlock(&spikes_mutex);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -