|
17 | 17 | #include <string> |
18 | 18 | #include <vector> |
19 | 19 | #include <set> |
| 20 | +#include <unordered_map> |
20 | 21 |
|
21 | 22 | #define REPORT_MAX_NAME_LEN 256 |
22 | 23 | #define REPORT_MAX_FILEPATH_LEN 4096 |
23 | 24 |
|
24 | 25 | namespace coreneuron { |
| 26 | + |
| 27 | +struct SummationReport { |
| 28 | + // Contains the values of the summation with index == segment_id |
| 29 | + std::vector<double> summation_ = {}; |
| 30 | + // Map containing the pointers of the currents and its scaling factor for every segment_id |
| 31 | + std::unordered_map<int, std::vector<std::pair<double*, int>>> currents_; |
| 32 | +}; |
| 33 | + |
| 34 | +struct SummationReportMapping { |
| 35 | + // Map containing an SummationReport object per report |
| 36 | + std::unordered_map<std::string, SummationReport> summation_reports_; |
| 37 | +}; |
| 38 | + |
25 | 39 | // name of the variable in mod file that is used to indicate which synapse |
26 | 40 | // is enabled or disable for reporting |
27 | 41 | #define SELECTED_VAR_MOD_NAME "selected_for_report" |
28 | 42 |
|
29 | 43 | /// name of the variable in mod file used for setting synapse id |
30 | 44 | #define SYNAPSE_ID_MOD_NAME "synapseID" |
31 | 45 |
|
| 46 | +/* |
| 47 | + * Defines the type of target, as per the following syntax: |
| 48 | + * 0=Compartment, 1=Cell/Soma, Section { 2=Axon, 3=Dendrite, 4=Apical } |
| 49 | + * The "Comp" variations are compartment-based (all segments, not middle only) |
| 50 | + */ |
| 51 | +enum class TargetType { |
| 52 | + Compartment = 0, |
| 53 | + Soma = 1, |
| 54 | + Axon = 2, |
| 55 | + Dendrite = 3, |
| 56 | + Apical = 4, |
| 57 | + AxonComp = 5, |
| 58 | + DendriteComp = 6, |
| 59 | + ApicalComp = 7, |
| 60 | +}; |
| 61 | + |
32 | 62 | // enumerate that defines the type of target report requested |
33 | | -enum ReportType { SomaReport, CompartmentReport, SynapseReport, IMembraneReport, SectionReport }; |
| 63 | +enum ReportType { |
| 64 | + SomaReport, |
| 65 | + CompartmentReport, |
| 66 | + SynapseReport, |
| 67 | + IMembraneReport, |
| 68 | + SectionReport, |
| 69 | + SummationReport |
| 70 | +}; |
34 | 71 |
|
35 | 72 | // enumerate that defines the section type for a Section report |
36 | 73 | enum SectionType { Axon, Dendrite, Apical }; |
37 | 74 |
|
38 | 75 | struct ReportConfiguration { |
39 | | - std::string name; // name of the report |
40 | | - std::string output_path; // full path of the report |
41 | | - std::string target_name; // target of the report |
42 | | - std::string mech_name; // mechanism name |
43 | | - std::string var_name; // variable name |
44 | | - std::string unit; // unit of the report |
45 | | - std::string format; // format of the report (Bin, hdf5, SONATA) |
46 | | - std::string type_str; // type of report string |
47 | | - std::string population_name; // population name of the report |
48 | | - ReportType type; // type of the report |
49 | | - SectionType section_type; // type of section report |
50 | | - bool section_all_compartments; // flag for section report (all values) |
51 | | - int mech_id; // mechanism |
52 | | - double report_dt; // reporting timestep |
53 | | - double start; // start time of report |
54 | | - double stop; // stop time of report |
55 | | - int num_gids; // total number of gids |
56 | | - int buffer_size; // hint on buffer size used for this report |
57 | | - std::set<int> target; // list of gids for this report |
| 76 | + std::string name; // name of the report |
| 77 | + std::string output_path; // full path of the report |
| 78 | + std::string target_name; // target of the report |
| 79 | + std::vector<std::string> mech_names; // mechanism names |
| 80 | + std::vector<std::string> var_names; // variable names |
| 81 | + std::vector<int> mech_ids; // mechanisms |
| 82 | + std::string unit; // unit of the report |
| 83 | + std::string format; // format of the report (Bin, hdf5, SONATA) |
| 84 | + std::string type_str; // type of report string |
| 85 | + std::string population_name; // population name of the report |
| 86 | + TargetType target_type; // type of the target |
| 87 | + ReportType type; // type of the report |
| 88 | + SectionType section_type; // type of section report |
| 89 | + bool section_all_compartments; // flag for section report (all values) |
| 90 | + double report_dt; // reporting timestep |
| 91 | + double start; // start time of report |
| 92 | + double stop; // stop time of report |
| 93 | + int num_gids; // total number of gids |
| 94 | + int buffer_size; // hint on buffer size used for this report |
| 95 | + std::set<int> target; // list of gids for this report |
58 | 96 | }; |
59 | 97 |
|
60 | 98 | void setup_report_engine(double dt_report, double mindelay); |
|
0 commit comments