23#ifndef IAF_COND_ALPHA_MC_H
24#define IAF_COND_ALPHA_MC_H
35#include <gsl/gsl_errno.h>
36#include <gsl/gsl_matrix.h>
37#include <gsl/gsl_odeiv.h>
58extern "C" int iaf_cond_alpha_mc_dynamics(
double,
const double*,
double*,
void* );
169void register_iaf_cond_alpha_mc(
const std::string& name );
171class iaf_cond_alpha_mc :
public ArchivingNode
178 iaf_cond_alpha_mc(
const iaf_cond_alpha_mc& );
179 ~iaf_cond_alpha_mc()
override;
187 using Node::handles_test_event;
189 size_t send_test_event( Node&,
size_t, synindex,
bool )
override;
191 void handle( SpikeEvent& )
override;
192 void handle( CurrentEvent& )
override;
193 void handle( DataLoggingRequest& )
override;
195 size_t handles_test_event( SpikeEvent&,
size_t )
override;
196 size_t handles_test_event( CurrentEvent&,
size_t )
override;
197 size_t handles_test_event( DataLoggingRequest&,
size_t )
override;
199 void get_status(
Dictionary& )
const override;
200 void set_status(
const Dictionary& )
override;
203 void init_buffers_()
override;
204 void pre_run_hook()
override;
205 void update( Time
const&,
const long,
const long )
override;
223 static const size_t MIN_SPIKE_RECEPTOR = 1;
228 enum SpikeSynapseTypes
230 SOMA_EXC = MIN_SPIKE_RECEPTOR,
239 static const size_t NUM_SPIKE_RECEPTORS = SUP_SPIKE_RECEPTOR - MIN_SPIKE_RECEPTOR;
246 static const size_t MIN_CURR_RECEPTOR = SUP_SPIKE_RECEPTOR;
251 enum CurrentSynapseTypes
253 I_SOMA = MIN_CURR_RECEPTOR,
259 static const size_t NUM_CURR_RECEPTORS = SUP_CURR_RECEPTOR - MIN_CURR_RECEPTOR;
263 friend int iaf_cond_alpha_mc_dynamics(
double,
const double*,
double*,
void* );
265 friend class RecordablesMap< iaf_cond_alpha_mc >;
266 friend class UniversalDataLogger< iaf_cond_alpha_mc >;
294 double g_conn[ NCOMP - 1 ];
298 double E_ex[ NCOMP ];
299 double E_in[ NCOMP ];
302 double tau_synE[ NCOMP ];
304 double tau_synI[ NCOMP ];
309 Parameters_(
const Parameters_& );
310 Parameters_& operator=(
const Parameters_& );
346 double y_[ STATE_VEC_SIZE ];
349 State_(
const Parameters_& );
350 State_(
const State_& );
352 State_& operator=(
const State_& );
355 void set(
const Dictionary&,
const Parameters_&, Node* );
365 idx(
size_t comp, StateVecElems_ elem )
367 return comp * STATE_VEC_COMPS + elem;
379 Buffers_( iaf_cond_alpha_mc& );
381 Buffers_(
const Buffers_&, iaf_cond_alpha_mc& );
384 UniversalDataLogger< iaf_cond_alpha_mc > logger_;
389 std::vector< RingBuffer > spikes_;
390 std::vector< RingBuffer > currents_;
394 gsl_odeiv_control* c_;
395 gsl_odeiv_evolve* e_;
396 gsl_odeiv_system sys_;
402 double IntegrationStep_;
411 double I_stim_[ NCOMP ];
422 double PSConInit_E_[ NCOMP ];
425 double PSConInit_I_[ NCOMP ];
427 int RefractoryCounts_;
436 template < State_::StateVecElems_ elem, Compartments_ comp >
440 return S_.y_[ S_.idx( comp, elem ) ];
447 return Time::get_resolution().get_ms() * S_.r_;
458 static std::vector< std::string > comp_names_;
463 static RecordablesMap< iaf_cond_alpha_mc > recordablesMap_;
467iaf_cond_alpha_mc::send_test_event( Node& target,
size_t receptor_type,
synindex,
bool )
470 e.set_sender( *
this );
471 return target.handles_test_event( e, receptor_type );
475iaf_cond_alpha_mc::handles_test_event( SpikeEvent&,
size_t receptor_type )
477 if ( receptor_type < MIN_SPIKE_RECEPTOR or receptor_type >= SUP_SPIKE_RECEPTOR )
479 if ( receptor_type >= SUP_CURR_RECEPTOR )
481 throw UnknownReceptorType( receptor_type, get_name() );
485 throw IncompatibleReceptorType( receptor_type, get_name(),
"SpikeEvent" );
492iaf_cond_alpha_mc::handles_test_event( CurrentEvent&,
size_t receptor_type )
494 if ( receptor_type < MIN_CURR_RECEPTOR or receptor_type >= SUP_CURR_RECEPTOR )
496 if ( receptor_type < MIN_CURR_RECEPTOR )
498 throw IncompatibleReceptorType( receptor_type, get_name(),
"CurrentEvent" );
502 throw UnknownReceptorType( receptor_type, get_name() );
509iaf_cond_alpha_mc::handles_test_event( DataLoggingRequest& dlr,
size_t receptor_type )
511 if ( receptor_type != 0 )
513 if ( receptor_type >= SUP_CURR_RECEPTOR )
515 throw UnknownReceptorType( receptor_type, get_name() );
519 throw IncompatibleReceptorType( receptor_type, get_name(),
"DataLoggingRequest" );
522 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
526iaf_cond_alpha_mc::get_status(
Dictionary& d )
const
556iaf_cond_alpha_mc::set_status(
const Dictionary& d )
558 Parameters_ ptmp = P_;
561 stmp.set( d, ptmp,
this );
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
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
const std::string t_ref("t_ref")
const std::string E_L("E_L")
const std::string I_e("I_e")
const std::string V_reset("V_reset")
const std::string recordables("recordables")
const std::string C_m("C_m")
const std::string V_th("V_th")
const std::string receptor_types("receptor_types")
const std::string proximal_curr("proximal_curr")
const std::string receptor_type("receptor_type")
const std::string E_in("E_in")
const std::string soma_exc("soma_exc")
const std::string distal_inh("distal_inh")
const std::string target("target")
const std::string distal_curr("distal_curr")
const std::string proximal_inh("proximal_inh")
const std::string soma_curr("soma_curr")
const std::string distal_exc("distal_exc")
const std::string E_ex("E_ex")
const std::string proximal_exc("proximal_exc")
const std::string soma_inh("soma_inh")
const std::string g_L("g_L")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
constexpr auto to_underlying(E e) noexcept
Cast enum value to underlying integer type.
Definition nest_types.h:182
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
const double e
Definition numerics.cpp:32