diff options
author | André Nusser <anusser@mpi-inf.mpg.de> | 2021-02-13 12:35:45 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-07-22 11:21:59 +0200 |
commit | 39e841af517c0c82a54702eeafb7651e03260601 (patch) | |
tree | 0a44c81ed4e87f0d6d422f3d967d39144dbc4f3f /src | |
parent | 6732ac4278bae1bf5bfeb9d4ca9e0fdfa1aaf369 (diff) |
Add position parameter of sample selection to settings.
Diffstat (limited to 'src')
-rw-r--r-- | src/sample_selection.cc | 6 | ||||
-rw-r--r-- | src/settings.h | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/sample_selection.cc b/src/sample_selection.cc index eb023c5..eb13e55 100644 --- a/src/sample_selection.cc +++ b/src/sample_selection.cc @@ -69,16 +69,16 @@ const Sample* SampleSelection::get(level_t level, float position, std::size_t po float pos_opt{0.f}; float value_opt{std::numeric_limits<float>::max()}; // the following three values are mostly for debugging - float random_opt = 0.; float close_opt = 0.; - float diverse_opt = 0.; float closepos_opt = 0.; + float random_opt = 0.; + float diverse_opt = 0.; // Note the magic values in front of the settings factors. const float f_close = 4.*settings.sample_selection_f_close.load(); + const float f_position = 1000.*settings.sample_selection_f_position.load(); // FIXME: huge factor for now const float f_diverse = (1./2.)*settings.sample_selection_f_diverse.load(); const float f_random = (1./3.)*settings.sample_selection_f_random.load(); - const float f_position = 1000.; // FIXME: get from settings float power_range = powerlist.getMaxPower() - powerlist.getMinPower(); // If all power values are the same then power_range is invalid but we want diff --git a/src/settings.h b/src/settings.h index fb93d79..a423ae3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -77,12 +77,14 @@ struct Settings static float constexpr velocity_modifier_weight_default = 0.25f; static float constexpr velocity_stddev_default = .45f; static float constexpr sample_selection_f_close_default = .85f; + static float constexpr sample_selection_f_position_default = 1.f; static float constexpr sample_selection_f_diverse_default = .16f; static float constexpr sample_selection_f_random_default = .07f; Atomic<float> velocity_modifier_falloff{velocity_modifier_falloff_default}; Atomic<float> velocity_modifier_weight{velocity_modifier_weight_default}; Atomic<float> velocity_stddev{velocity_stddev_default}; Atomic<float> sample_selection_f_close{sample_selection_f_close_default}; + Atomic<float> sample_selection_f_position{sample_selection_f_position_default}; Atomic<float> sample_selection_f_diverse{sample_selection_f_diverse_default}; Atomic<float> sample_selection_f_random{sample_selection_f_random_default}; @@ -201,6 +203,7 @@ struct SettingsGetter SettingRef<float> velocity_modifier_weight; SettingRef<float> velocity_stddev; SettingRef<float> sample_selection_f_close; + SettingRef<float> sample_selection_f_position; SettingRef<float> sample_selection_f_diverse; SettingRef<float> sample_selection_f_random; @@ -276,6 +279,7 @@ struct SettingsGetter , velocity_modifier_weight{settings.velocity_modifier_weight} , velocity_stddev{settings.velocity_stddev} , sample_selection_f_close{settings.sample_selection_f_close} + , sample_selection_f_position{settings.sample_selection_f_position} , sample_selection_f_diverse{settings.sample_selection_f_diverse} , sample_selection_f_random{settings.sample_selection_f_random} , sample_selection_retry_count(settings.sample_selection_retry_count) @@ -346,6 +350,7 @@ public: Notifier<float> velocity_modifier_weight; Notifier<float> velocity_stddev; Notifier<float> sample_selection_f_close; + Notifier<float> sample_selection_f_position; Notifier<float> sample_selection_f_diverse; Notifier<float> sample_selection_f_random; Notifier<std::size_t> sample_selection_retry_count; @@ -425,6 +430,7 @@ public: EVAL(velocity_modifier_weight); EVAL(velocity_stddev); EVAL(sample_selection_f_close); + EVAL(sample_selection_f_position); EVAL(sample_selection_f_diverse); EVAL(sample_selection_f_random); EVAL(sample_selection_retry_count); |