start on random instruction
Some checks failed
/ Test-Suite (push) Failing after 30s

This commit is contained in:
Rowan Torbitzky-Lane 2025-04-29 01:41:38 -05:00
parent d51035270d
commit f68e9577d6
2 changed files with 21 additions and 0 deletions

View File

@ -1,6 +1,23 @@
use crate::gp::args::ClosingType;
use crate::push::state::Gene;
use rand::Rng; use rand::Rng;
use rand::seq::IndexedRandom;
use rust_decimal::prelude::*; use rust_decimal::prelude::*;
pub fn random_instruction(
instructions: Vec<Gene>,
closing_type: ClosingType,
rng: &mut impl Rng,
) -> Gene {
match closing_type {
ClosingType::Specified => return instructions.choose(rng).unwrap().clone(),
ClosingType::Balanced => {
let
}
_ => todo!(),
}
}
pub fn gaussian_noise_factor(rng: &mut impl Rng) -> Decimal { pub fn gaussian_noise_factor(rng: &mut impl Rng) -> Decimal {
let u0f64: f64 = rng.random(); let u0f64: f64 = rng.random();
let u1f64: f64 = rng.random(); let u1f64: f64 = rng.random();

View File

@ -125,6 +125,10 @@ fn alternation(
} }
} }
fn uniform_addition(plushy: Vec<Gene>, instructions: Vec<Gene>, umad_rate: Decimal) {
let mut new_plushy: Vec<Gene> = vec![];
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;