fern_sim_eojin 0.1.0

Fern simulation, from the cellular level up.
Documentation
// //! Simulate the growth of ferns, from the level of
// //! individual cells on up.
//
// #![warn(rust_2018_idioms)]
// #![allow(elided_lifetimes_in_paths)]
//
// pub mod plant_structures;
// pub mod simulation;
// pub mod spores;
//
// pub use plant_structures::Fern;
// pub use simulation::Terrarium;
//
// pub mod net;
// pub use net::connect;

pub struct Fern {
    pub size: f64,
    pub growth_rate: f64
}

impl Fern {
    pub fn grow(&mut self) {
        self.size *= 1.0 + self.growth_rate;
    }
}

pub fn run_simulation(fern: &mut Fern, days: usize) {
    for _ in 0 .. days {
        fern.grow();
    }
}

// fn main() {
//     let mut fern = Fern {
//         size: 1.0,
//         growth_rate: 0.001
//     };
//     run_simulation(&mut fern, 1000);
//     println!("final fern size: {}", fern.size);
// }