⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spikeinput.cpp

📁 amygdata的神经网络算法源代码
💻 CPP
字号:
/***************************************************************************                          spikeinput.cpp  -  description                             -------------------    begin                : Wed Aug 8 2001    copyright            : (C) 2001 by Matt Grover    email                : mgrover@amygdala.org ***************************************************************************//*************************************************************************** *                                                                         * *   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.                                   * *                                                                         * ***************************************************************************/using namespace std;#include <stdexcept>#include "spikeinput.h"#include "network.h"#include "inputneuron.h"using namespace Amygdala;using namespace std;;SpikeInput::SpikeInput(): NeuronGroup(){    simStepSize = Network::GetNetworkRef()->TimeStepSize();}SpikeInput::SpikeInput(const string& name): NeuronGroup(name){    simStepSize = Network::GetNetworkRef()->TimeStepSize();}SpikeInput::~SpikeInput(){}void SpikeInput::ScheduleQueuedSpikes(){    unsigned int i;//    sort(inputSpike.begin(), inputSpike.end());    for (i=0; i<inputSpike.size(); i++) {        Network::GetNetworkRef()->ScheduleSpike(inputSpike[i].spikeTime,                            inputSpike[i].inNeuron);    }    inputSpike.clear();}void SpikeInput::AddNeuron(InputNeuron* iNeuron){    Neuron * nrn = static_cast <Neuron *> (iNeuron);    NeuronGroup::AddNeuron(nrn);}void SpikeInput::AddNeuron(Neuron* nrn){    InputNeuron * iNeuron = dynamic_cast<InputNeuron*>(nrn);    if(iNeuron == NULL) throw runtime_error("Cannot add neuron because it's no InputNeuron");    AddNeuron(dynamic_cast<InputNeuron*>(nrn));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -