PixCells
This project is a Cellular Potts Model (CPM) simulator. It was developped during a Master's degree in Physics as a master project.
Loading...
Searching...
No Matches
Config.hpp
Go to the documentation of this file.
1
6#ifndef CONFIG_HPP
7#define CONFIG_HPP
8
9#include <fstream>
10#include <sstream>
11#include <string>
12#include <vector>
13#include <stdexcept>
14#include <iostream>
15
16class Config {
17public:
18 int LENGTH_BOX; // Length of the box
19 int SAFETY_DISTANCE; // Safety distance between the border of the box and the cells created
20 int NUMBER_OF_MCS; // Number of Monte Carlo Steps
21 int NUMBER_OF_STEPS; // Number of steps to do during simulation : calculated in constructor
22 int NUMBER_OF_SAVINGS; // Number of savings
23 std::vector<float> NB_CELLS; // Number of cells
24 std::vector<float> TARGET_SURFACE_CELL; // Target surface of the cells
25 std::vector<float> TARGET_LENGTH_CELL; // Target length of the cells
26 float KT; // Temperature
27 std::vector<std::vector<float>> J; // Interaction matrix
28 std::vector<float> LAMBDA_SURFACE; // Lambda surface
29 std::vector<float> LAMBDA_LENGTH;// Lambda length
30 std::vector<float> LAMBDA_CHEMOTAXIS; // Lambda chemotaxis
31 int WINDOW_SIZE; // Window size
32
33 float DT; // Time step
34 float DX;// X step
35 float D; // Diffusion coefficient
36 float BOUNDARY_CONDITION; // Boundary condition
37 float ETA0;// Eta0
38 float GAMMA0; // Gamma0
39
40 std::vector<bool> HAMILTONIAN; // Hamiltonian : booleans for each part of the hamiltonian (interation, surface, length, chemotaxis, connectivity)
41
42 Config(const std::string& file_path);
43
44 void loadConfig(const std::string& file_path);
45
46 void printConfig();
47
48private:
49 void parseKeyValue(const std::string& key, const std::string& value);
50
51 std::vector<std::vector<float>> parse2DArray(const std::string& value);
52
53 std::vector<float> parse1DArray(const std::string& value);
54
55 std::vector<bool> parseBoolArray(const std::string& value);
56
57 void trim(std::string& str);
58};
59
60#endif // CONFIG_HPP
Definition Config.hpp:16
void printConfig()
Print the configuration.
Definition Config.cpp:139
void loadConfig(const std::string &file_path)
Load the configuration from a file.
Definition Config.cpp:25