?? factory.cpp
字號:
/*************************************************************************** factory.cpp - description ------------------- copyright : (C) 2004 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. * * * ***************************************************************************/
#include "amygdala/factory.h"
#include "amygdala/flatlayer.h"
#include "amygdala/feedforwardlayer.h"
#include "amygdala/lsmtopology.h"
#include "amygdala/fastneuron.h"
#include "amygdala/alphaneuron.h"
#include "amygdala/basicneuron.h"#include "amygdala/inputneuron.h"
#include "amygdala/scheduledspikeinput.h"
#include "amygdala/basicspikeoutput.h"
#include "amygdala/statictrainer.h"
#include "amygdala/pdeltatrainer.h"
using namespace Amygdala;
using namespace std;
FactoryRegistry FactoryBase::registry;
FactoryRegistry::FactoryRegistry()
{
AddFactory("FlatLayer", new TopologyFactory <FlatLayer> ());
AddFactory("FeedForwardLayer", new TopologyFactory <FeedForwardLayer> ());
AddFactory("LSMTopology", new TopologyFactory <LSMTopology> ());
AddFactory("LSMTopology::Output", new TopologyFactory <LSMTopology::Output> ());
AddFactory("LSMTopology::Input", new TopologyFactory <LSMTopology::Input> ());
AddFactory("FastNeuron", new NeuronFactory <FastNeuron, FastNeuronProperties> ()); AddFactory("AlphaNeuron", new NeuronFactory <AlphaNeuron, AlphaNeuronProperties> ()); AddFactory("BasicNeuron", new NeuronFactory <BasicNeuron, BasicNeuronProperties> ()); AddFactory("InputNeuron", new NeuronFactory <InputNeuron, InputNeuronProperties> ());
AddFactory("ScheduledSpikeInput", new SpikeInputFactory <ScheduledSpikeInput> ());
AddFactory("BasicSpikeOutput", new SpikeOutputFactory <BasicSpikeOutput> ());
AddFactory("StaticHebbianTrainer", new TrainerFactory <StaticHebbianTrainer, StaticHebbianTrainerProperties> ());
AddFactory("PDeltaTrainer", new TrainerFactory <PDeltaTrainer, PDeltaTrainerProperties> ());
}
FactoryBase* FactoryRegistry::GetFactory(std::string className)
{
FactoryBase* f = 0;
f = factories[className];
if (!f) {
return 0;
} else { return f; }
}
void FactoryRegistry::AddFactory(std::string className, FactoryBase* factory)
{
if (!factories[className]) {
factories[className] = factory;
}}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -