-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSettingHandler.h
More file actions
65 lines (50 loc) · 1.7 KB
/
Copy pathSettingHandler.h
File metadata and controls
65 lines (50 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Dispatcher.h
*
* Created on: Jun 17, 2016
* Author: kjaron
*/
#ifndef SRC_DISPATCHER_H_
#define SRC_DISPATCHER_H_
#include <vector>
#include <string>
#include <fstream>
#include "../include/SimulationSetting.h"
class SettingHandler{
public:
SettingHandler(std::string filename);
SimulationSetting getSimualtionSetting(int index) const;
int getNumberOfSimulations() const;
// testing
void checkParameters();
void fillDefault();
// printing functions
void printParameters() const;
void printWorld() const;
void printParameterCounts() const;
// void plotAsciiWorld();
private:
int parseSetting(std::ifstream& myfile);
int parseWorldDefinition(std::string& line);
void parameterSave(std::string& parameter, double value);
void parameterSave(std::string& parameter, std::vector<double>& value);
void updateNumberOfSimulations();
template<typename T>
int printVectorValue(unsigned int index, std::vector<T> val_vec) const;
char setParameterOfSetting(SimulationSetting& mySetting, std::string parameter, int index) const;
void adjustFileName(std::string& name, char par, int total, int refactorised_index) const;
// simulation parameters
std::vector<int> loci, selected_loci, chrom, deme, gen;
std::vector<double> sel, beta, lambda;
// capture output parameters
std::string file_name_patten, type_of_save;
std::vector<int> seed, delay, saves;
// world setting
int up_down_demes, left_right_demes, dimension, edges_per_deme;
std::string type_of_updown_edges, type_of_leftright_edges;
// internals
int number_of_simulations, replicates;
std::vector<std::string> parameters_in_order;
std::vector<int> parameters_numbers;
};
#endif /* SRC_DISPATCHER_H_ */