Nano v1.0.0
Simulating Natural Selection
statistics_store.h
Go to the documentation of this file.
1#pragma once
2// clang-format off
3#include "pch_dal.h"
4#include "simulation_data.h"
5// clang-format on
6
8
9namespace ss::dal
10{
12{
13 private:
14 static std::string getFolderPath();
15
16 public:
17 static std::vector<std::string> getStatisticsNames();
18
19 static void saveStatisticTo(const std::string &fileName, const std::vector<ss::types::Cycle> &cycles);
20
21 static void saveStatisticTo(const std::vector<ss::types::Cycle> &cycles);
22
23 static std::vector<ss::types::Cycle> getStatisticFrom(const std::string &fileName);
24};
25} // namespace ss::dal
26
27namespace ss::types
28{
29void to_json(json &j, const ss::types::Trait &trait);
30
31void from_json(const json &j, ss::types::Trait &trait);
32
33void to_json(json &j, const ss::types::Cycle &cycle);
34
35void from_json(const json &j, ss::types::Cycle &cycle);
36} // namespace ss::types
Definition: statistics_store.h:12
static std::vector< ss::types::Cycle > getStatisticFrom(const std::string &fileName)
Getter a statistic data function.
Definition: statistics_store.cpp:102
static void saveStatisticTo(const std::string &fileName, const std::vector< ss::types::Cycle > &cycles)
Save generation data into a .json file.
Definition: statistics_store.cpp:72
static std::string getFolderPath()
Get the appropriate folder path for current directory.
Definition: statistics_store.cpp:31
static std::vector< std::string > getStatisticsNames()
Getter files names' function.
Definition: statistics_store.cpp:50
Definition: statistics_store.h:10
Definition: statistics_store.h:28
void from_json(const json &j, ss::types::Trait &trait)
Definition: statistics_store.cpp:11
void to_json(json &j, const ss::types::Trait &trait)
Definition: statistics_store.cpp:6
nlohmann::json json
Definition: statistics_store.h:7
A struct holding the data for a cycle.
Definition: simulation_data.h:46
A struct holding the data for a trait.
Definition: simulation_data.h:26