Nano v1.0.0
Simulating Natural Selection
ss::bll::statistics::StatisticsManager Class Reference

#include <statistics_manager.h>

Static Public Member Functions

static std::vector< std::string > getStatisticsNames ()
 Getter files names' function. More...
 
static void saveStatistic (const std::string &fileName, const std::vector< ss::types::Cycle > &cycles)
 Save generation data into a .json file. More...
 
static void saveStatistic (const std::vector< ss::types::Cycle > &cycles)
 Save generation data into a .json file. More...
 
static std::vector< ss::types::CyclegetStatisticFrom (const std::string &fileName)
 Getter a statistic data function. More...
 

Member Function Documentation

◆ getStatisticFrom()

std::vector< ss::types::Cycle > ss::bll::statistics::StatisticsManager::getStatisticFrom ( const std::string &  fileName)
static

Getter a statistic data function.

The function gets the generation data from saved in the .json file.

Parameters
fileNameThe file which holds needed generation data.
Returns
An array of cycles which is a generation.

◆ getStatisticsNames()

std::vector< std::string > ss::bll::statistics::StatisticsManager::getStatisticsNames ( )
static

Getter files names' function.

The function searches for a file with a .json extension and gets its name.

Returns
An array of names

◆ saveStatistic() [1/2]

void ss::bll::statistics::StatisticsManager::saveStatistic ( const std::string &  fileName,
const std::vector< ss::types::Cycle > &  cycles 
)
static

Save generation data into a .json file.

The functions saves a generation data into a .json file using a user chosen name as a name of the file.

Parameters
fileNameA file name which the data will be saved into.
cyclesA generation data.

◆ saveStatistic() [2/2]

void ss::bll::statistics::StatisticsManager::saveStatistic ( const std::vector< ss::types::Cycle > &  cycles)
static

Save generation data into a .json file.

The functions saves a generation data into a .json file using a timestamp as a name of the file.

Parameters
cyclesA generation data.

The documentation for this class was generated from the following files: