public void shuffle(Random rnd){
  int numberOfInstance=size();
  for (int i=0; i < numberOfInstance; i++) {
    int j=i + rnd.nextInt(numberOfInstance - i);
    IInstance tmpIns=instanceList.get(i);
    instanceList.set(i,instanceList.get(j));
    instanceList.set(j,tmpIns);
    IStructure tmpStructure=goldStructureList.get(i);
    goldStructureList.set(i,goldStructureList.get(j));
    goldStructureList.set(j,tmpStructure);
    if (instanceWeightList != null) {
      Float tmp_weight=instanceWeightList.get(i);
      instanceWeightList.set(i,instanceWeightList.get(j));
      instanceWeightList.set(j,tmp_weight);
    }
  }
}

public void shuffle ( Random rnd ) { int numberOfInstance = size ( ) ; for ( int i = 0 ; i < numberOfInstance ; i ++ ) { int j = i + rnd . nextInt ( numberOfInstance - i ) ; IInstance tmpIns = instanceList . get ( i ) ; instanceList . set ( i , instanceList . get ( j ) ) ; instanceList . set ( j , tmpIns ) ; IStructure tmpStructure = goldStructureList . get ( i ) ; goldStructureList . set ( i , goldStructureList . get ( j ) ) ; goldStructureList . set ( j , tmpStructure ) ; if ( instanceWeightList != null ) { Float tmp_weight = instanceWeightList . get ( i ) ; instanceWeightList . set ( i , instanceWeightList . get ( j ) ) ; instanceWeightList . set ( j , tmp_weight ) ; } } }
a helper function that shuffles the order of the examples in this problem .
