public List<ColourChange> sampleConditionalMigrationEvents2(int parentColour,double parentHeight,int childColour,double childHeight,double[] m){
  List<ColourChange> colourChanges=new ArrayList<ColourChange>();
  if (parentHeight < childHeight) {
    throw new IllegalArgumentException("sampleConditionalMigrationEvents: parentHeight=" + parentHeight + " childHeight="+ childHeight+ ", not good.");
  }
  try {
    int currentColour=parentColour;
    double currentHeight=parentHeight;
    while (true) {
      ColourChange nextEvent=randomConditionalMigrationEvent(currentColour,currentHeight,childColour,childHeight,m);
      currentHeight=nextEvent.getTime();
      currentColour=nextEvent.getColourAbove();
      colourChanges.add(nextEvent);
    }
  }
 catch (  NoEventException nee) {
  }
  reverseColourChangeList(colourChanges,parentColour);
  return colourChanges;
}

public List < ColourChange > sampleConditionalMigrationEvents2 ( int parentColour , double parentHeight , int childColour , double childHeight , double [ ] m ) { List < ColourChange > colourChanges = new ArrayList < ColourChange > ( ) ; if ( parentHeight < childHeight ) { throw new IllegalArgumentException ( "sampleConditionalMigrationEvents: parentHeight=" + parentHeight + " childHeight=" + childHeight + ", not good." ) ; } try { int currentColour = parentColour ; double currentHeight = parentHeight ; while ( true ) { ColourChange nextEvent = randomConditionalMigrationEvent ( currentColour , currentHeight , childColour , childHeight , m ) ; currentHeight = nextEvent . getTime ( ) ; currentColour = nextEvent . getColourAbove ( ) ; colourChanges . add ( nextEvent ) ; } } catch ( NoEventException nee ) { } reverseColourChangeList ( colourChanges , parentColour ) ; return colourChanges ; }
samples migration events on a two - coloured branch , conditional on colours at both ends migration process is forwards in ( natural ) time , so we are going down the tree . returns a list of events , ordered forward in time ( i . e . colour refers to branch * below * the event ) *
