@@ -5,9 +5,48 @@ use crate::segment::Segment;
55/// Simplification of simulated data happens
66/// via [``crate::simplify_from_edge_buffer()``].
77///
8+ /// # Overview
9+ ///
10+ /// The typical tree sequence recording workflow
11+ /// goes like this. When a new node is "born",
12+ /// we:
13+ ///
14+ /// 1. Add a new node to the node table. This
15+ /// new node is a "child".
16+ /// 2. Add edges to the edge table representing
17+ /// the genomic intervals passed on from
18+ /// various parents to this child node.
19+ ///
20+ /// We repeat `1` and `2` for a while, then
21+ /// we [``sort the tables``](crate::TableCollection::sort_tables_for_simplification).
22+ /// After sorting, we [``simplify``](crate::simplify_tables()) the tables.
23+ ///
24+ /// We can avoid the sorting step using this type.
25+ /// To start, we record the list of currently-alive nodes
26+ /// [``here``](crate::SamplesInfo::edge_buffer_founder_nodes).
27+ ///
28+ /// Then, we use `parent` ID values as the
29+ /// `head` values for linked lists stored in a
30+ /// [``NestedForwardList``](crate::nested_forward_list::NestedForwardList).
31+ ///
32+ /// By its very nature, offspring are generated by birth order.
33+ /// Further, a well-behaved forward simulation is capable of calculating
34+ /// edges from left-to-right along a genome. Thus, we can
35+ /// [``extend``](crate::nested_forward_list::NestedForwardList::extend)
36+ /// the data for each chain with [``Segment``] instances representing
37+ /// transmission events. The segment's [``node``](Segment::node) field represents
38+ /// the child.
39+ ///
40+ /// After recording for a while, we call
41+ /// [``simplify_from_edge_buffer``](crate::simplify_from_edge_buffer()) to simplify
42+ /// the tables. After simplification, the client code must re-populate
43+ /// [``the list``](crate::SamplesInfo::edge_buffer_founder_nodes) of alive nodes.
44+ /// Once that is done, we can keep recording, etc..
45+ ///
846/// # Example
947///
1048/// For a full example of use in simulation,
1149/// see the source code for
12- /// [``crate::wright_fisher::neutral_wf()``].
50+ /// [``wright_fisher::neutral_wf``](crate::wright_fisher::neutral_wf)
51+ ///
1352pub type EdgeBuffer = NestedForwardList < Segment > ;
0 commit comments