generated from PlexSheep/rs-base
automatic cargo CI changes
This commit is contained in:
parent
a3e348ba91
commit
2bb6bf4fc0
|
@ -31,7 +31,12 @@ impl<WL: WordList> Game<WL> {
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// This function will return an error if .
|
/// This function will return an error if .
|
||||||
pub(crate) fn build(length: usize, precompute: bool, max_steps: usize, wlist: WL) -> anyhow::Result<Self> {
|
pub(crate) fn build(
|
||||||
|
length: usize,
|
||||||
|
precompute: bool,
|
||||||
|
max_steps: usize,
|
||||||
|
wlist: WL,
|
||||||
|
) -> anyhow::Result<Self> {
|
||||||
let solution = wlist.rand_solution();
|
let solution = wlist.rand_solution();
|
||||||
let mut game = Game {
|
let mut game = Game {
|
||||||
length,
|
length,
|
||||||
|
@ -39,7 +44,7 @@ impl<WL: WordList> Game<WL> {
|
||||||
max_steps,
|
max_steps,
|
||||||
step: 0,
|
step: 0,
|
||||||
solution,
|
solution,
|
||||||
wordlist: wlist
|
wordlist: wlist,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(game)
|
Ok(game)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use rand::{seq::IteratorRandom};
|
use rand::seq::IteratorRandom;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ops::RangeBounds;
|
use std::ops::RangeBounds;
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl WordMap {
|
||||||
let len = self.len();
|
let len = self.len();
|
||||||
let mut c: f64 = l_under_sigmoid * (0.5 + self.n_common() as f64 / len as f64);
|
let mut c: f64 = l_under_sigmoid * (0.5 + self.n_common() as f64 / len as f64);
|
||||||
c *= 1e-7;
|
c *= 1e-7;
|
||||||
debug!(threshold=c);
|
debug!(threshold = c);
|
||||||
c
|
c
|
||||||
}
|
}
|
||||||
pub fn inner(&self) -> &HashMap<Word, Frequency> {
|
pub fn inner(&self) -> &HashMap<Word, Frequency> {
|
||||||
|
|
Loading…
Reference in New Issue