protected int numberOfAttributes(int total,double fraction){
  int k=(int)Math.round((fraction < 1.0) ? total * fraction : fraction);
  if (k > total)   k=total;
  if (k < 1)   k=1;
  return k;
}

protected int numberOfAttributes ( int total , double fraction ) { int k = ( int ) Math . round ( ( fraction < 1.0 ) ? total * fraction : fraction ) ; if ( k > total ) k = total ; if ( k < 1 ) k = 1 ; return k ; }
calculates the number of attributes
