-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement config file functionality.
- Loading branch information
1 parent
2222137
commit 3adba3a
Showing
9 changed files
with
373 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
global: | ||
nParticles: 1000 | ||
mass: | ||
dist: constant | ||
val: 100000000 | ||
x: | ||
dist: uniform | ||
min: 0 | ||
max: 4 | ||
y: | ||
dist: uniform | ||
min: -2 | ||
max: 4 | ||
z: | ||
dist: uniform | ||
min: 1 | ||
max: 10 | ||
vx: | ||
dist: uniform | ||
min: 0 | ||
max: 4 | ||
vy: | ||
dist: normal | ||
mu: -2 | ||
sigma: 4 | ||
vz: | ||
dist: uniform | ||
min: -10 | ||
max: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
#include <vector> | ||
#include <random> | ||
|
||
// Assuming you have the random device and generator declared somewhere | ||
extern std::random_device rd; | ||
extern std::mt19937 GENERATOR; | ||
|
||
// Distribution template used to sample from random distributions | ||
template <typename Distribution> | ||
std::vector<double> sampleFromDistribution(size_t n, Distribution& distribution) { | ||
// Generate samples | ||
std::vector<double> samples(n); | ||
for (size_t i = 0; i < n; ++i) { | ||
samples[i] = distribution(GENERATOR); | ||
} | ||
return samples; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "../include/statistics.h" | ||
|
||
std::random_device rd; | ||
std::mt19937 GENERATOR(rd()); |
Oops, something went wrong.