Skip to content

leafCountEndCondition

Tim Vaughan edited this page Jul 11, 2013 · 5 revisions

The <leafCountEndCondition> element(s) can be used to terminate an InheritanceTrajectory or a member of an InheritanceEnsemble when a particular number of leaf (terminal) nodes has been generated. The element has the following form:

    <leafCountEndCondition spec='LeafCountEndCondition'
                           nLeaves="INTEGER"
                           includeExtant="BOOLEAN"
                           isRejection="BOOLEAN" />

The nLeaves attribute specifies the number of terminal nodes at which the simulation will stop.

If the optional includeExtant attribute is "true" (default "false"), the number compared to nLeaves will include the number of extant lineages, ensuring the resulting graph has exactly that many leaves following truncation of these lineages. The default value is "false" because more often it is the number of leaves produced as a result of stochastic events which one needs to condition on. In this case, it is probably desirable to include a LineageFilter post-processor to remove non-reaction leaves.

The optional isRejection attribute (default "false") determines what happens when the condition is met. By default, the simulation terminates and the results generated up until that point are written to disk. If "true", this attribute instead causes the simulation to be restarted.