NEST main@caf0ae8
 
Loading...
Searching...
No Matches
flush_event_mechanism.h
Go to the documentation of this file.
1/*
2 * flush_event_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 FLUSH_EVENT_MECHANISM_H
24#define FLUSH_EVENT_MECHANISM_H
25
26// nestkernel
27#include "nest_time.h"
28
29// libnestutil
30#include "dict_util.h"
31
32namespace nest
33{
43{
44public:
49
56
60 virtual ~FlushEventMechanism() = default;
61
67 void
68 set_last_event_time( const long last_event_time )
69 {
70 last_event_time_ = last_event_time;
71 }
72
78 long
80 {
81 return last_event_time_;
82 }
83
87 void pre_run_hook();
88
95 inline bool
96 flush_event_is_due( const long current_time ) const
97 {
98 return last_event_time_ > 0 and ( current_time - last_event_time_ >= flush_event_send_interval_steps_ );
99 }
100
106 void get_status( Dictionary& d ) const;
107
114 void set_status( const Dictionary& d, Node* node, const bool check_eprop_constraint = false );
115
116protected:
119
122
125};
126
127} // namespace nest
128
129#endif // FLUSH_EVENT_MECHANISM_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Class implementing a flush event mechanism for neuron models.
Definition flush_event_mechanism.h:43
void set_status(const Dictionary &d, Node *node, const bool check_eprop_constraint=false)
Sets and validates parameters from the status dictionary.
Definition flush_event_mechanism.cpp:62
void set_last_event_time(const long last_event_time)
Sets the time the neuron last sent an event (spike or flush event).
Definition flush_event_mechanism.h:68
void get_status(Dictionary &d) const
Retrieves parameters and adds them to the status dictionary.
Definition flush_event_mechanism.cpp:56
void pre_run_hook()
Re-calculates dependent parameters.
Definition flush_event_mechanism.cpp:50
virtual ~FlushEventMechanism()=default
Destructor.
double flush_event_send_interval_
Interval since previous event after which a flush event is sent (ms).
Definition flush_event_mechanism.h:118
FlushEventMechanism()
Default constructor.
Definition flush_event_mechanism.cpp:35
long flush_event_send_interval_steps_
Interval since previous event after which a flush event is sent (steps).
Definition flush_event_mechanism.h:121
long last_event_time_
Time of last spike or flush event (steps).
Definition flush_event_mechanism.h:124
bool flush_event_is_due(const long current_time) const
Checks if a flush event is due at the current time.
Definition flush_event_mechanism.h:96
long get_last_event_time() const
Gets the last time the neuron sent an event (spike or flush event).
Definition flush_event_mechanism.h:79
Base class for all NEST network objects.
Definition node.h:99
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33