aboutsummaryrefslogtreecommitdiff
path: root/srchr/src/config.rs
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2022-09-30 11:07:54 +0200
committertslil clingman <tslil@posteo.de>2022-10-01 01:24:11 +0200
commit60ef0eb8accb31d2dbbf25bee898a59a62cc43f9 (patch)
tree9d519007a86329548b8cd9ef50d7519391d75f11 /srchr/src/config.rs
parenta0a87a49e7fc865bbbab8e83919450c8a991524c (diff)
Big overhaul, corrected sfb, added dsfb, lengthened corpus
Diffstat (limited to 'srchr/src/config.rs')
-rw-r--r--srchr/src/config.rs60
1 files changed, 37 insertions, 23 deletions
diff --git a/srchr/src/config.rs b/srchr/src/config.rs
index 161922c..2633a71 100644
--- a/srchr/src/config.rs
+++ b/srchr/src/config.rs
@@ -1,38 +1,52 @@
-// With the below parameters and the supplied corpus searches seem to converge on the following
+// With the below parameters and the supplied corpus searches seem to converge on a few layouts, with one of the better ones being
-// J , H G Q B C O U '
-// S A N T V F D E I R
-// X . L M K P W / Y Z
-//
+// V L O M Q P F U H ,
+// S R A T K Y C E N I
+// Z X / D J G W ' B .
// Percent per key:
-// 0.1 1.8 6.0 1.9 0.1 1.5 2.3 7.4 2.8 1.0
-// 6.0 7.7 6.6 8.6 0.9 2.1 4.3 11.9 6.6 5.5
-// 0.1 1.2 4.0 2.6 0.8 1.6 2.3 0.2 2.0 0.1
+// 0.92 3.96 7.42 2.57 0.10 1.62 2.10 2.77 5.94 1.78
+// 6.03 5.56 7.74 8.60 0.77 1.99 2.35 11.90 6.62 6.68
+// 0.06 0.15 0.14 4.25 0.15 1.93 2.27 1.00 1.50 1.14
//
-// Finger usage: 6.29%, 10.70%, 16.56%, 14.88%, 14.05%, 19.47%, 11.45%, 6.60%
-// Hand usage: 48.43% vs 51.57%
-// Same finger bigrams: 0.000%, 0.029%, 0.092%, 0.032%, 0.042%, 0.096%, 0.113%, 0.031%
-// Total sfb: 0.43% (43414)
+// Finger usage: 7.02%, 9.66%, 15.30%, 16.44%, 12.25%, 15.67%, 14.06%, 9.61%
+// Hand usage: 48.42% vs 51.58%
+// SFB distribution : 0.001%, 0.087%, 0.089%, 0.047%, 0.104%, 0.197%, 0.044%, 0.024%
+// DSFB distribution: 0.147%, 0.431%, 0.615%, 0.999%, 0.208%, 0.997%, 1.102%, 0.408%
+// Total sfb: 0.594% (49972)
+// Total dsfb: 4.906% (412768)
-// Search parameters
-pub const CORPUS_FILE_NAME: &str = "corpus.txt";
+// -----------------------------------------------------------------------------
+// Tweak
+// -----------------------------------------------------------------------------
+// Input parameters
+pub const CORPUS_FILE_NAME: &str = "corpus.txt";
pub const STARTING_LAYOUT_STRING: &str = "
-Q W E R T Y U I O P
-A S D F G H J K L '
-Z X C V B N M , . /
+A B C D E F G H I J
+K L M N O P Q R S T
+U V W X Y Z . , / '
";
+// Tournament parameters
pub const NUM_CONTESTANTS: usize = 256;
-pub const NUM_PERSIST: usize = 16;
+pub const NUM_PERSIST: usize = 8;
+pub const MAX_NUM_TRANSPOSITIONS: usize = 12;
-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
+// Fitness parameters
+pub const DESIRED_INDEX_USAGE_PERCENT: f32 = 0.12;
+pub const STANDARD_DSFB_WEIGHT: f32 = 1.0 / 32.0;
+pub fn index_usage_fitness(total_count: u32, index_count: u32) -> f32 {
+ let index_perc = index_count as f32 / total_count as f32;
+ if index_perc < DESIRED_INDEX_USAGE_PERCENT {
+ DESIRED_INDEX_USAGE_PERCENT - index_perc
+ } else {
+ 0.0
+ }
}
-// Do not change, code makes assumptions about these
+// -----------------------------------------------------------------------------
+// Do not change the following, the code makes assumptions about these
+// -----------------------------------------------------------------------------
pub const NUM_KEYS: usize = 30;
pub const ROW_LENGTH: usize = 10;