-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnngt_module.cpp
120 lines (107 loc) · 4.39 KB
/
nngt_module.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* nngt_module.cpp
*
* This file is part of NEST.
*
* Copyright (C) 2004 The NEST Initiative
*
* NEST 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.
*
* NEST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NEST. If not, see <http://www.gnu.org/licenses/>.
*
*/
// include necessary NEST headers
#include "config.h"
#include "network.h"
#include "model.h"
#include "dynamicloader.h"
#include "genericmodel.h"
#include "booldatum.h"
#include "integerdatum.h"
#include "tokenarray.h"
#include "exceptions.h"
#include "sliexceptions.h"
#include "nestmodule.h"
#include "connector_model_impl.h"
#include "target_identifier.h"
// include headers with your own stuff
#include "nngt_module.h"
#include "aeif/aeif_cond_alpha_mod.h"
#include "aeif/aeif_psc_alpha.h"
#include "aeif/aeif_psc_exp.h"
#include "gp_aeif/gp_aeif_cond_alpha.h"
#include "gp_aeif/gp_aeif_cond_exp.h"
#include "gp_aeif/gp_aeif_psc_alpha.h"
#include "gp_aeif/gp_aeif_psc_exp.h"
#include "ps_aeif/ps_aeif_cond_alpha.h"
#include "ps_aeif/ps_aeif_cond_exp.h"
#include "ps_aeif/ps_aeif_psc_alpha.h"
#include "ps_aeif/ps_aeif_psc_exp.h"
#include "ps_iaf/ps_iaf_cond_alpha.h"
#include "ps_iaf/ps_iaf_psc_alpha.h"
// -- Interface to dynamic module loader ---------------------------------------
/*
* The dynamic module loader must be able to find your module.
* You make the module known to the loader by defining an instance of your
* module class in global scope. This instance must have the name
*
* <modulename>_LTX_mod
*
* The dynamicloader can then load modulename and search for symbol "mod" in it.
*/
mynest::NngtModule nngt_module_LTX_mod;
// -- DynModule functions ------------------------------------------------------
mynest::NngtModule::NngtModule()
{
#ifdef LINKED_MODULE
// register this module at the dynamic loader
// this is needed to allow for linking in this module at compile time
// all registered modules will be initialized by the main app's dynamic loader
nest::DynamicLoaderModule::registerLinkedModule( this );
#endif
}
mynest::NngtModule::~NngtModule()
{
}
const std::string
mynest::NngtModule::name( void ) const
{
return std::string( "NNGT module" ); // Return name of the module
}
const std::string
mynest::NngtModule::commandstring( void ) const
{
// Instruct the interpreter to load nngt_module-init.sli
return std::string( "(nngt_module-init) run" );
}
//-------------------------------------------------------------------------------------
void
mynest::NngtModule::init( SLIInterpreter* i )
{
/* Register a neuron or device model.
Give node type as template argument and the name as second argument.
The first argument is always a reference to the network.
*/
nest::register_model< aeif_cond_alpha_mod >( nest::NestModule::get_network(), "aeif_cond_alpha_mod" );
nest::register_model< aeif_psc_alpha >( nest::NestModule::get_network(), "aeif_psc_alpha" );
nest::register_model< aeif_psc_exp >( nest::NestModule::get_network(), "aeif_psc_exp" );
nest::register_model< gp_aeif_cond_alpha >( nest::NestModule::get_network(), "gp_aeif_cond_alpha" );
nest::register_model< gp_aeif_cond_exp >( nest::NestModule::get_network(), "gp_aeif_cond_exp" );
nest::register_model< gp_aeif_psc_alpha >( nest::NestModule::get_network(), "gp_aeif_psc_alpha" );
nest::register_model< gp_aeif_psc_exp >( nest::NestModule::get_network(), "gp_aeif_psc_exp" );
nest::register_model< ps_aeif_cond_alpha >( nest::NestModule::get_network(), "ps_aeif_cond_alpha" );
nest::register_model< ps_aeif_cond_exp >( nest::NestModule::get_network(), "ps_aeif_cond_exp" );
nest::register_model< ps_aeif_psc_alpha >( nest::NestModule::get_network(), "ps_aeif_psc_alpha" );
nest::register_model< ps_aeif_psc_exp >( nest::NestModule::get_network(), "ps_aeif_psc_exp" );
nest::register_model< ps_iaf_cond_alpha >( nest::NestModule::get_network(), "ps_iaf_cond_alpha" );
nest::register_model< ps_iaf_psc_alpha >( nest::NestModule::get_network(), "ps_iaf_psc_alpha" );
} // NngtModule::init()