jebl.evolution.trees
Class TreeSimulator

java.lang.Object
  extended by jebl.evolution.trees.TreeSimulator

public class TreeSimulator
extends Object

This class provides the framework for (backwards-through-time) tree simulation. Basically, this takes a set of tips (optionally at different dates) and repeatedly coalesces them together until the MRCA is reached and the tree is returned. The time intervals between nodes are provided by the IntervalGenerator and an implementation of this is the CoalescentIntervalGenerator in the jebl.evolution.coalescent package.

Author:
Andrew Rambaut

Constructor Summary
TreeSimulator(IntervalGenerator intervalGenerator, Collection<Taxon> taxa, String heightAttributeName)
          A constructor for a given collection of taxa.
TreeSimulator(IntervalGenerator intervalGenerator, String taxonPrefix, double[] samplingTimes)
           
TreeSimulator(IntervalGenerator intervalGenerator, String taxonPrefix, int taxonCount)
          A constructor for a given number of taxa, all sampled at the same time
TreeSimulator(IntervalGenerator intervalGenerator, String taxonPrefix, int[] samplingCounts, double[] samplingTimes)
           
 
Method Summary
static void main(String[] args)
          A main() to test the tree simulation classes.
 Tree simulate()
           
 Tree simulate(boolean medianHeights)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeSimulator

public TreeSimulator(IntervalGenerator intervalGenerator,
                     String taxonPrefix,
                     int taxonCount)
A constructor for a given number of taxa, all sampled at the same time

Parameters:
intervalGenerator -
taxonCount -

TreeSimulator

public TreeSimulator(IntervalGenerator intervalGenerator,
                     String taxonPrefix,
                     double[] samplingTimes)

TreeSimulator

public TreeSimulator(IntervalGenerator intervalGenerator,
                     String taxonPrefix,
                     int[] samplingCounts,
                     double[] samplingTimes)

TreeSimulator

public TreeSimulator(IntervalGenerator intervalGenerator,
                     Collection<Taxon> taxa,
                     String heightAttributeName)
A constructor for a given collection of taxa. If the taxa have the attribute given by heightAttributeName then this will be used, otherwise a height of 0.0 will be assumed.

Parameters:
intervalGenerator -
taxa -
Method Detail

simulate

public Tree simulate()

simulate

public Tree simulate(boolean medianHeights)

main

public static void main(String[] args)
A main() to test the tree simulation classes. In this case the interval generator is a simple anonymous class that simply returns the uniform random deviate that it is passed.

Parameters:
args -