protected void processInstance(Instance instance){
  if (m_currentInst < m_SampleSize) {
    m_subSample[m_currentInst]=(Instance)instance.copy();
  }
 else {
    double r=m_random.nextDouble();
    if (r < ((double)m_SampleSize / (double)m_currentInst)) {
      r=m_random.nextDouble();
      int replace=(int)(m_SampleSize * r);
      m_subSample[replace]=(Instance)instance.copy();
    }
  }
  m_currentInst++;
}

protected void processInstance ( Instance instance ) { if ( m_currentInst < m_SampleSize ) { m_subSample [ m_currentInst ] = ( Instance ) instance . copy ( ) ; } else { double r = m_random . nextDouble ( ) ; if ( r < ( ( double ) m_SampleSize / ( double ) m_currentInst ) ) { r = m_random . nextDouble ( ) ; int replace = ( int ) ( m_SampleSize * r ) ; m_subSample [ replace ] = ( Instance ) instance . copy ( ) ; } } m_currentInst ++ ; }
decides whether the current instance gets retained in the reservoir .
