Offchain scaffolding.

This commit is contained in:
zjkree
2024-12-24 06:32:46 +01:00
parent 50288eb30c
commit ae908ee23d
14 changed files with 1824 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
use crate::compiler::ast::{Expr};
pub fn crossover(a: &Expr, b: &Expr) -> (Expr, Expr) {
// stub
(a.clone(), b.clone())
}
pub fn mutate(expr: &mut Expr) {
// stub
}
+13
View File
@@ -0,0 +1,13 @@
pub mod population;
pub mod genetic_ops;
// pub mod fitness;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_dummy() {
assert_eq!(2+2, 4);
}
}
+9
View File
@@ -0,0 +1,9 @@
#[derive(Debug, Clone)]
pub struct Individual {
pub fitness: f64,
// your Expr or bytecode or both
}
pub struct Population {
pub individuals: Vec<Individual>,
}