aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2022-09-30 00:28:02 +0200
committertslil clingman <tslil@posteo.de>2022-09-30 00:28:34 +0200
commita0a87a49e7fc865bbbab8e83919450c8a991524c (patch)
tree93039c2e6d67504dded7832fe9bd9f358ce92d27
parent3ec781f4684c7d24d9c1205d6fa71c6d44318568 (diff)
parameterise transpositions
-rw-r--r--srchr/src/config.rs5
-rw-r--r--srchr/src/layout.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/srchr/src/config.rs b/srchr/src/config.rs
index c67a888..161922c 100644
--- a/srchr/src/config.rs
+++ b/srchr/src/config.rs
@@ -23,9 +23,10 @@ A S D F G H J K L '
Z X C V B N M , . /
";
-pub const NUM_CONTESTANTS: usize = 128;
-pub const NUM_PERSIST: usize = 8;
+pub const NUM_CONTESTANTS: usize = 256;
+pub const NUM_PERSIST: usize = 16;
+pub const MAX_NUM_TRANSPOSITIONS: usize = 8;
pub const DESIRED_INDEX_USAGE_PERCENT: f32 = 0.15;
pub const fn index_usage_fitness(index_threshold: u32, index_count: u32) -> u32 {
(index_threshold as i64 - index_count as i64).abs() as u32 / 64
diff --git a/srchr/src/layout.rs b/srchr/src/layout.rs
index 68b0341..0f89b9d 100644
--- a/srchr/src/layout.rs
+++ b/srchr/src/layout.rs
@@ -23,7 +23,7 @@ impl Prelayout {
let mut standard_columns = pl.standard_columns.clone();
let mut index_columns = pl.index_columns.clone();
- let mut count = rng.gen_range(1..NUM_KEYS);
+ let mut count = rng.gen_range(1..=MAX_NUM_TRANSPOSITIONS);
while count > 0 {
let source_index: bool = rng.gen();
let target_index: bool = rng.gen();