Skip to content

Commit 23f24c7

Browse files
committed
add parameters to default.json
1 parent 116369e commit 23f24c7

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

crates/control/src/search_suggestor.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ impl SearchSuggestor {
9494
if let Some(some_suggested_search_index) = suggested_search_index {
9595
self.heatmap.has_decided_for_heatmap_tile = true;
9696
let max_heatmap_value = self.heatmap.map[some_suggested_search_index];
97-
self.heatmap.heat_change_threshold = max_heatmap_value * 0.8; // TODO: make parameter
97+
self.heatmap.heat_change_threshold = max_heatmap_value
98+
* context
99+
.search_suggestor_configuration
100+
.tile_target_heat_threshold_factor; // TODO: make parameter
98101
}
99102
self.heatmap.last_maximum_heatmap_position = suggested_search_index;
100103
} else {
@@ -191,7 +194,9 @@ impl SearchSuggestor {
191194
1.0,
192195
);
193196
if is_inside_sight && distancse_to_tile > 0.25 {
194-
*value *= 1.0 - 0.05 * relative_distance_to_tile;
197+
*value *= 1.0
198+
- context.search_suggestor_configuration.decay_distance_factor
199+
* relative_distance_to_tile;
195200
}
196201
});
197202
}

crates/types/src/parameters.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ pub struct SearchSuggestorParameters {
428428
pub own_ball_weight: f32,
429429
pub team_ball_weight: f32,
430430
pub rule_ball_weight: f32,
431+
pub decay_distance_factor: f32,
432+
pub tile_target_heat_threshold_factor: f32,
431433
}
432434

433435
#[derive(

etc/parameters/default.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,9 @@
16141614
"minimum_validity": 0.01,
16151615
"own_ball_weight": 1.0,
16161616
"team_ball_weight": 1.0,
1617-
"rule_ball_weight": 1.0
1617+
"rule_ball_weight": 1.0,
1618+
"decay_distance_factor": 0.05,
1619+
"tile_target_heat_threshold_factor": 0.5
16181620
},
16191621
"physical_constants": {
16201622
"gravity_acceleration": 9.81

0 commit comments

Comments
 (0)