From c4e7a97fd7efecdb85f362f04434ea8470a1927f Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Tue, 27 Sep 2022 23:06:16 +0200 Subject: Better pre-layout -> layout --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 041730d..4294484 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -mod config; mod corpus; mod layout; @@ -15,13 +14,10 @@ use std::time::Instant; const NUM_CONTESTANTS: usize = 128; const NUM_PERSIST: usize = 8; -// TODO: Layout is really pre-layout, have something that takes a layout and -// re-orders columns to balance hands, and keys per column (block really -// consider index fingers) to balance rows. - // TODO: command line arguments to start at a given layout string, maybe read // from file? Might as well make num_contestants and survive_threshold -// configurable, and number of swaps when generating new layout +// configurable, and number of swaps when generating new layout, and index +// finger threshold. struct Tournament<'a> { rngs: Vec, @@ -98,10 +94,10 @@ fn main() { let improvement = tournament.run_round(); if let Some(prelayout) = improvement { - let layout = Layout::from_prelayout(&prelayout); + let layout = Layout::from_prelayout(&prelayout, &corpus); let evl = corpus.evaluate_layout(&layout); println!(""); - println!("================================================================================\nLayout:\n{}", + println!("================================================================================\n\n{}", layout ); -- cgit v1.3.1