File tree Expand file tree Collapse file tree 12 files changed +69
-27
lines changed
Expand file tree Collapse file tree 12 files changed +69
-27
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " fern_sim"
33version = " 0.1.0"
4+ edition = " 2018"
45authors = [" You <you@example.com>" ]
56license = " MIT"
67homepage = " https://fernsim.example.com/"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11//! Simulate the growth of ferns, from the level of
22//! individual cells on up.
33
4- pub mod cells;
4+ #![ warn( rust_2018_idioms) ]
5+ #![ allow( elided_lifetimes_in_paths) ]
6+
57pub mod plant_structures;
68pub mod simulation;
79pub mod spores;
Original file line number Diff line number Diff line change 22//! Simulation of individual leaves (for the formation of leaves, see `stem`).
33
44pub struct Leaf {
5- x : bool
5+ pub x : bool
66}
Original file line number Diff line number Diff line change @@ -43,3 +43,17 @@ impl Fern {
4343 self . stems . iter ( ) . all ( |s| !s. furled )
4444 }
4545}
46+
47+ /// Create and return a [`VascularPath`] which represents the path of
48+ /// nutrients from the given [`Root`][r] to the given [`Leaf`](leaves::Leaf).
49+ ///
50+ /// [r]: roots::Root
51+ pub fn trace_path ( leaf : & leaves:: Leaf , root : & roots:: Root ) -> VascularPath {
52+ VascularPath { from : leaf. x , to : root. x }
53+ }
54+
55+ #[ doc( alias = "route" ) ]
56+ pub struct VascularPath {
57+ pub from : bool ,
58+ pub to : bool ,
59+ }
Original file line number Diff line number Diff line change 11#![ allow( dead_code) ]
22
33pub struct Root {
4- x : bool
4+ pub x : bool
55}
66
77pub type RootSet = Vec < Root > ;
Original file line number Diff line number Diff line change 33//! the feathery leaf structure that's the most immediately recognizable
44//! property of ferns.
55
6+ // in plant_structures/stems.rs
7+ pub mod xylem;
8+ pub mod phloem;
9+
610pub struct Stem {
711 pub furled : bool
812}
Original file line number Diff line number Diff line change 1+ //! Structures for distributing the products of photosynthesis.
2+
3+ /// Tissue for translocating sucrose and other photosynthesis products.
4+ pub struct Phloem {
5+ pub flow_rate : f32 ,
6+ }
Original file line number Diff line number Diff line change 1+ //! Structures for bringing nutrients from roots up to other parts of the plant.
2+
3+ /// Vascular tissue for transporting water and nutrients from the roots.
4+ pub struct Xylem {
5+ pub flow_rate : f32 ,
6+ }
Original file line number Diff line number Diff line change 44
55use std:: fs:: File ;
66use std:: time:: Duration ;
7- use plant_structures:: { Fern , FernType } ;
7+ use crate :: plant_structures:: { Fern , FernType } ;
88
99/// The simulated universe.
1010pub struct Terrarium {
You can’t perform that action at this time.
0 commit comments