NEST main@caf0ae8
 
Loading...
Searching...
No Matches
ignore_and_spike_mechanism.h
Go to the documentation of this file.
1/*
2 * ignore_and_spike_mechanism.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
23#ifndef IGNORE_AND_SPIKE_MECHANISM_H
24#define IGNORE_AND_SPIKE_MECHANISM_H
25
26// nestkernel
27#include "nest_time.h"
28
29// libnestutil
30#include "dict_util.h"
31
32namespace nest
33{
40{
41public:
46
53
57 virtual ~IgnoreAndSpikeMechanism() = default;
58
65 inline bool
66 spike_event_is_due( bool emit_dynamic_spike )
67 {
69 {
71 const bool emit_forced_spike = steps_until_spike_ == 0;
72 if ( emit_forced_spike )
73 {
75 }
76 return emit_forced_spike;
77 }
78 else
79 {
80 return emit_dynamic_spike;
81 }
82 }
83
89 void get_status( Dictionary& d ) const;
90
96 void set_status( const Dictionary& d, Node* node );
97
98private:
102 void initialize_offset();
103
107 void initialize_interval();
108
111
113 double offset_;
114
116 double interval_;
117
120
123};
124
125} // namespace nest
126
127#endif // IGNORE_AND_SPIKE_MECHANISM_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Class implementing an ignore-and-fire mechanism for neuron models.
Definition ignore_and_spike_mechanism.h:40
virtual ~IgnoreAndSpikeMechanism()=default
Virtual destructor.
IgnoreAndSpikeMechanism()
Default constructor.
Definition ignore_and_spike_mechanism.cpp:35
bool spike_event_is_due(bool emit_dynamic_spike)
Updates spike schedule and returns whether a spike should be emitted.
Definition ignore_and_spike_mechanism.h:66
void initialize_interval()
Initialize variables dependent on interval.
Definition ignore_and_spike_mechanism.cpp:60
void get_status(Dictionary &d) const
Retrieves parameters and adds them to the status dictionary.
Definition ignore_and_spike_mechanism.cpp:66
double interval_
Interval between two consecutive spikes (ms).
Definition ignore_and_spike_mechanism.h:116
void set_status(const Dictionary &d, Node *node)
Sets and validates parameters from the status dictionary.
Definition ignore_and_spike_mechanism.cpp:74
bool ignore_and_spike_
If True, the neuron is forced to spike in set intervals.
Definition ignore_and_spike_mechanism.h:110
double offset_
Temporal offset of first spike (ms).
Definition ignore_and_spike_mechanism.h:113
long steps_until_spike_
Remaining steps until the next spike.
Definition ignore_and_spike_mechanism.h:122
long interval_steps_
Interval steps between two consecutive spikes.
Definition ignore_and_spike_mechanism.h:119
void initialize_offset()
Initialize variables dependent on offset.
Definition ignore_and_spike_mechanism.cpp:54
Base class for all NEST network objects.
Definition node.h:99
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33