23 #ifndef RECORDING_DEVICE_H
24 #define RECORDING_DEVICE_H
283 template <
typename ValueT>
284 void print_value(
const ValueT&,
bool endrecord =
true);
318 template <
typename DataT>
476 template <
typename ValueT>
481 std::cout << value <<
'\t';
488 B_.
fs_ << value <<
'\t';
494 template <
typename DataT>
507 #endif // RECORDING_DEVICE_H
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
bool to_accumulator_
true if data is to be accumulated; exclusive to all other to_*
Definition: recording_device.h:387
bool to_accumulator() const
Definition: recording_device.h:324
Buffers_ B_
Definition: recording_device.h:444
Definition: lockptrdatum.h:40
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
Definition: recording_device.h:221
std::string label_
a user-defined label for symbolic device names.
Definition: recording_device.h:401
void get(DictionaryDatum &, const Parameters_ &) const
Store current values in dictionary.
Definition: recording_device.cpp:214
bool to_screen_
true if recorder writes its output to stdout
Definition: recording_device.h:385
void init_state(const RecordingDevice &)
Definition: recording_device.cpp:325
void flush_stream_()
Flush output stream (not std::cout).
std::string filename_
the filename, if recording to a file (read-only)
Definition: recording_device.h:403
virtual void get_status(DictionaryDatum &) const
Definition: device.h:206
const Name offset("offset")
Miscellaneous parameters.
Definition: nest_names.h:211
long fbuffer_size_old_
the buffer size to use when writing to file (old)
Definition: recording_device.h:399
std::vector< double_t > event_times_ms_
List of event times in ms.
Definition: recording_device.h:426
Encapsulates information which is sent between Nodes.
Definition: event.h:73
const Node & node_
node to which device instance belongs
Definition: recording_device.h:440
void get(const RecordingDevice &, DictionaryDatum &) const
Store current values in dictionary.
Definition: recording_device.cpp:80
bool close_after_simulate_
if true, finalize() shall close the stream
Definition: recording_device.h:404
delay get_steps() const
Definition: nest_time.h:395
void print_time_(std::ostream &, const Time &, double offset)
Print the time-stamp according to the recorder's flags.
Definition: recording_device.cpp:555
Definition: recording_device.h:377
const Name element_type("element_type")
Node type.
Definition: nest_names.h:117
virtual void init_state(const Device &)
Reset dynamic state to that of model.
Definition: device.h:105
void clear_data_()
Clear data in internal structure, and call clear_data_hook().
void init_parameters(const RecordingDevice &)
Definition: recording_device.cpp:317
bool to_memory() const
Definition: recording_device.h:323
bool precise_times_
true if time is computed including offset
Definition: recording_device.h:389
virtual ~RecordingDevice()
Definition: recording_device.h:240
Buffers_ V_
Definition: recording_device.h:445
bool to_file_
true if recorder writes its output to a file
Definition: recording_device.h:384
void clear_events()
clear all data
Definition: recording_device.cpp:625
bool is_active(Time const &T) const
Indicate if recording device is active.
Definition: recording_device.h:450
const Name recorder("recorder")
Node type.
Definition: nest_names.h:245
void set(const DictionaryDatum &)
Get values from dictionary.
Definition: recording_device.cpp:279
bool withtime_
true if time of event is to be printed, default
Definition: recording_device.h:391
Mode
Device mode.
Definition: recording_device.h:221
Base class for all recording devices.
Definition: recording_device.h:214
std::vector< long > event_senders_
List of event sender ids.
Definition: recording_device.h:425
Definition: recording_device.h:221
Class implementing common interface and properties common for all devices.
Definition: device.h:94
std::vector< double_t > event_weights_
List of event weights.
Definition: recording_device.h:429
Definition: nest_time.h:130
void set_precise(bool use_precise, long precision)
Definition: recording_device.h:468
void print_id_(std::ostream &, index)
Print a node's global ID and/or address, according to the recorder's flags.
Definition: recording_device.cpp:549
std::ofstream fs_
the file to write the recorded data to
Definition: recording_device.h:378
bool to_file() const
Definition: recording_device.h:322
const std::string build_filename_() const
Build filename from parts.
Definition: recording_device.cpp:602
void record_event(const Event &, bool endrecord=true)
Record common information for one event.
Definition: recording_device.cpp:511
size_t events_
Event counter.
Definition: recording_device.h:424
bool withgid_
true if element GID is to be printed, default
Definition: recording_device.h:390
const Name precision("precision")
Recorder parameter.
Definition: nest_names.h:230
void print_value(const ValueT &, bool endrecord=true)
Print single item of type ValueT.
Definition: recording_device.h:477
void set_status(const DictionaryDatum &)
Set properties of recording device.
Definition: recording_device.cpp:483
std::vector< double_t > event_times_offsets_
List of event time offsets.
Definition: recording_device.h:428
virtual void init_parameters(const Device &)
Reset parameters to those of model; also resets state.
Definition: device.cpp:107
void calibrate()
Ensure streams are open for writing.
Definition: recording_device.cpp:344
Definition: recording_device.h:383
bool scientific_
use scientific format if true, else fixed
Definition: recording_device.h:395
long_t get_t_max_() const
Return upper limit in steps.
Definition: device.h:246
Parameters_ P_
Definition: recording_device.h:442
bool flush_records_
if true, flush stream after each output
Definition: recording_device.h:406
RecordingDevice(const Node &, Mode, const std::string &, bool, bool, bool=false)
Create recording device information.
Definition: recording_device.cpp:295
Definition: recording_device.h:423
long_t get_t_min_() const
Return lower limit in steps.
Definition: device.h:240
Definition: namedatum.h:90
std::vector< long > event_times_steps_
List of event times in steps.
Definition: recording_device.h:427
bool binary_
true if to write files in binary mode instead of ASCII
Definition: recording_device.h:397
Default types used by the NEST kernel.
bool withweight_
true if weight of event is to be printed
Definition: recording_device.h:392
void store_data_(index, const Time &, double, double)
Store data in internal structure.
Definition: recording_device.cpp:579
void init_buffers()
Close file stream.
Definition: recording_device.cpp:331
void set(const RecordingDevice &, const Buffers_ &, const DictionaryDatum &)
Set values from dicitonary.
Definition: recording_device.cpp:128
void finalize()
Flush output stream if requested.
Definition: recording_device.cpp:456
Base class for all NEST network objects.
Definition: node.h:96
Parameters_(const std::string &, bool, bool, bool)
Set default parameter values.
Definition: recording_device.cpp:44
bool time_in_steps_
true if time is printed in steps, not ms.
Definition: recording_device.h:388
bool flush_after_simulate_
if true, finalize() shall flush the stream
Definition: recording_device.h:405
bool close_on_reset_
if true, close stream in init_buffers()
Definition: recording_device.h:407
void get_status(DictionaryDatum &) const
Definition: recording_device.h:458
State_ S_
Definition: recording_device.h:443
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
long precision_
precision of doubles written to file
Definition: recording_device.h:394
std::string file_ext_
the file name extension to use, without .
Definition: recording_device.h:402
const Mode mode_
operating mode, depends on owning node
Definition: recording_device.h:441
bool to_screen() const
Definition: recording_device.h:321
Definition: recording_device.h:221
long fbuffer_size_
the buffer size to use when writing to file
Definition: recording_device.h:398
State_()
Sets default parameter values.
Definition: recording_device.cpp:68
bool to_memory_
true if data should be recorded in memory, default
Definition: recording_device.h:386
void print_weight_(std::ostream &, double)
Print the weight of an event.
Definition: recording_device.cpp:572