forked from omega13a/stargen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.h
More file actions
100 lines (83 loc) · 3.59 KB
/
Copy pathConfig.h
File metadata and controls
100 lines (83 loc) · 3.59 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef CONFIG_H
#define CONFIG_H
#include <string>
/**
* @brief Configuration class to hold all simulation configuration parameters
*
* This class replaces the global configuration variables previously scattered
* throughout stargen.h and other files. It provides a centralized, thread-safe
* way to manage simulation configuration.
*/
class Config {
public:
// Verbosity and debugging
int verbose_level = 0;
int decimals = 0;
// Star configuration
long double stellar_mass = 0.0; // Fraction of Sun's mass
long double stellar_luminosity = 0.0; // Fraction of Sun's luminosity
long double stellar_temperature = 0.0; // Temperature of star in Kelvin
std::string stellar_type = ""; // Spectral type of star
// Age constraints
long double min_age = 0.0; // Minimum stellar age (years)
long double max_age = 6.0E9; // Maximum stellar age (years)
long double max_age_backup = 6.0E9; // Backup value for max age
// Companion star configuration (for binary systems)
bool is_circumbinary = false;
long double companion_mass = 0.0;
long double companion_luminosity = 0.0;
long double companion_temperature = 0.0;
long double companion_eccentricity = 0.0;
long double companion_distance = 0.0;
std::string companion_spectral_type = "";
// Accretion parameters
long double dust_density_ratio = 0.0; // Dust density coefficient
long double eccentricity_coeff = 0.077; // Dole's eccentricity coefficient
long double inner_planet_factor = 0.3; // Inner dust boundary factor
// Simulation options
bool do_gases = false; // Calculate atmospheric gases
bool do_moons = false; // Generate moons
bool do_migration = false; // Allow planet migration
bool use_known_planets = false; // Use known planets as seeds
bool only_generate_known = false; // Only generate known planets
bool use_solar_system = false; // Use Solar System masses/orbits
bool reuse_solar_system = false; // Reuse Solar System varying Earth
// Filtering options
bool filter_habitable = false; // Only save habitable systems
bool filter_earthlike = false; // Only save earthlike systems
bool filter_multi_habitable = false; // Only save multi-habitable systems
bool filter_jovian_habitable = false; // Only save Jovian-habitable systems
bool filter_potentially_habitable = false;// Only save potentially habitable
// Distance constraints
long double max_distance = 0.0; // Maximum distance constraint
// Random seed
long random_seed = 0;
int seed_increment = 1;
int system_count = 1;
int num_threads = 1; // Number of threads for parallel generation (1 = sequential)
// Flags (bitfield for backward compatibility)
int flags = 0;
// Output configuration
int output_format = 0; // ffHTML, ffTEXT, etc.
int graphic_format = 0; // gfGIF, gfSVG
std::string output_path = "html";
std::string url_path = "";
std::string filename = "";
bool use_stdout = false;
Config() = default;
// Helper methods
bool isVerbose(int level = 0x0001) const {
return (verbose_level & level) != 0;
}
void setFlag(int flag, bool value) {
if (value) {
flags |= flag;
} else {
flags &= ~flag;
}
}
bool hasFlag(int flag) const {
return (flags & flag) != 0;
}
};
#endif // CONFIG_H