Instance newInst = new Instance(model.numAttributes()); newInst.setDataset(model);
Instance newInst = null;
  public Instance getAsInstance(Instances model, Random random)     throws Exception {    Instance newInst = new Instance(model.numAttributes());    newInst.setDataset(model);    for (int i = 0, j = 0; i < model.numAttributes(); i++) {      if (model.attribute(i).isNumeric()) {	if (j >= m_Elements.length)	  throw new Exception("Datatypes are not compatible."); 	newInst.setValue(i, m_Elements[j++]);      }      if (model.attribute(i).isNominal()) {        int newVal = (int) 	  (random.nextDouble() * (double) (model.attribute(i).numValues()));	if (newVal == (int) model.attribute(i).numValues())          newVal -= 1;	newInst.setValue(i, newVal);      }    }    return newInst;  }