NEST main@caf0ae8
 
Loading...
Searching...
No Matches
urbanczik_archiving_node_impl.h
Go to the documentation of this file.
1/*
2 * urbanczik_archiving_node_impl.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
24
25// Includes from nestkernel:
26#include "kernel_manager.h"
27
28
29namespace nest
30{
31
32// member functions for UrbanczikArchivingNode
33template < class urbanczik_parameters >
38
39template < class urbanczik_parameters >
44
45template < class urbanczik_parameters >
46void
51
52template < class urbanczik_parameters >
53void
58
59template < class urbanczik_parameters >
60void
62 double t2,
63 std::deque< histentry_extended >::iterator* start,
64 std::deque< histentry_extended >::iterator* finish,
65 int comp )
66{
67 *finish = urbanczik_history_[ comp - 1 ].end();
68 if ( urbanczik_history_[ comp - 1 ].empty() )
69 {
70 *start = *finish;
71 return;
72 }
73 else
74 {
75 std::deque< histentry_extended >::iterator runner = urbanczik_history_[ comp - 1 ].begin();
76 // To have a well defined discretization of the integral, we make sure
77 // that we exclude the entry at t1 but include the one at t2 by subtracting
78 // a small number so that runner->t_ is never equal to t1 or t2.
79 while ( ( runner != urbanczik_history_[ comp - 1 ].end() ) and runner->t_ - 1.0e-6 < t1 )
80 {
81 ++runner;
82 }
83 *start = runner;
84 while ( ( runner != urbanczik_history_[ comp - 1 ].end() ) and runner->t_ - 1.0e-6 < t2 )
85 {
86 ( runner->access_counter_ )++;
87 ++runner;
88 }
89 *finish = runner;
90 }
91}
92
93template < class urbanczik_parameters >
94void
96 double V_W,
97 int n_spikes,
98 int comp )
99{
100 const double t_ms = t_sp.get_ms();
101
102 const double g_D = urbanczik_params->g_conn[ urbanczik_parameters::SOMA ];
103 const double g_L = urbanczik_params->g_L[ urbanczik_parameters::SOMA ];
104 const double E_L = urbanczik_params->E_L[ urbanczik_parameters::SOMA ];
105 const double V_W_star = ( ( E_L * g_L + V_W * g_D ) / ( g_D + g_L ) );
106
107 if ( n_incoming_ )
108 {
109 // prune all entries from history which are no longer needed
110 // except the penultimate one. we might still need it.
111 while ( urbanczik_history_[ comp - 1 ].size() > 1 )
112 {
113 if ( urbanczik_history_[ comp - 1 ].front().access_counter_ >= n_incoming_ )
114 {
115 urbanczik_history_[ comp - 1 ].pop_front();
116 }
117 else
118 {
119 break;
120 }
121 }
122
123 double dPI = ( n_spikes - urbanczik_params->phi( V_W_star ) * Time::get_resolution().get_ms() )
124 * urbanczik_params->h( V_W_star );
125 urbanczik_history_[ comp - 1 ].push_back( histentry_extended( t_ms, dPI, 0 ) );
126 }
127}
128
129} // of namespace nest
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
A node which archives spike history for the purposes of spike-timing dependent plasticity (STDP)
Definition archiving_node.h:49
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:220
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:236
Definition nest_time.h:135
static Time get_resolution()
Definition nest_time.h:325
double get_ms() const
Definition nest_time.h:490
An archiving node which additionally archives parameters and buffers needed for the Urbanczik-Senn pl...
Definition urbanczik_archiving_node.h:46
UrbanczikArchivingNode()
Definition urbanczik_archiving_node_impl.h:34
void get_urbanczik_history(double t1, double t2, std::deque< histentry_extended >::iterator *start, std::deque< histentry_extended >::iterator *finish, int comp) override
Sets pointer start (finish) to the first (last) entry in urbanczik_history_[comp] whose time argument...
Definition urbanczik_archiving_node_impl.h:61
void write_urbanczik_history(Time const &t_sp, double V_W, int n_spikes, int comp)
Writes the history for compartment comp into the buffers.
Definition urbanczik_archiving_node_impl.h:95
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition urbanczik_archiving_node_impl.h:47
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition urbanczik_archiving_node_impl.h:54
Class to represent a single entry in the spiking history of the ClopathArchivingNode or the Urbanczik...
Definition histentry.h:54
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33