@Override public Instances defineDataFormat() throws Exception {
  int i;
  int j;
  ArrayList<Attribute> atts;
  ArrayList<String> clsValues;
  Random rand;
  m_Random=new Random(getSeed());
  rand=getRandom();
  setNumExamplesAct(getNumExamples());
  m_centroids=new double[getNumCentroids()][getNumAttributes()];
  m_centroidClasses=new int[getNumCentroids()];
  m_centroidWeights=new double[getNumCentroids()];
  m_centroidStdDevs=new double[getNumCentroids()];
  for (i=0; i < getNumCentroids(); i++) {
    for (j=0; j < getNumAttributes(); j++) {
      m_centroids[i][j]=rand.nextDouble();
    }
    m_centroidClasses[i]=rand.nextInt(getNumClasses());
    m_centroidWeights[i]=rand.nextDouble();
    m_centroidStdDevs[i]=rand.nextDouble();
  }
  atts=new ArrayList<Attribute>();
  for (i=0; i < getNumAttributes(); i++) {
    atts.add(new Attribute("a" + i));
  }
  clsValues=new ArrayList<String>();
  for (i=0; i < getNumClasses(); i++) {
    clsValues.add("c" + i);
  }
  atts.add(new Attribute("class",clsValues));
  m_DatasetFormat=new Instances(getRelationNameToUse(),atts,0);
  return m_DatasetFormat;
}

@ Override public Instances defineDataFormat ( ) throws Exception { int i ; int j ; ArrayList < Attribute > atts ; ArrayList < String > clsValues ; Random rand ; m_Random = new Random ( getSeed ( ) ) ; rand = getRandom ( ) ; setNumExamplesAct ( getNumExamples ( ) ) ; m_centroids = new double [ getNumCentroids ( ) ] [ getNumAttributes ( ) ] ; m_centroidClasses = new int [ getNumCentroids ( ) ] ; m_centroidWeights = new double [ getNumCentroids ( ) ] ; m_centroidStdDevs = new double [ getNumCentroids ( ) ] ; for ( i = 0 ; i < getNumCentroids ( ) ; i ++ ) { for ( j = 0 ; j < getNumAttributes ( ) ; j ++ ) { m_centroids [ i ] [ j ] = rand . nextDouble ( ) ; } m_centroidClasses [ i ] = rand . nextInt ( getNumClasses ( ) ) ; m_centroidWeights [ i ] = rand . nextDouble ( ) ; m_centroidStdDevs [ i ] = rand . nextDouble ( ) ; } atts = new ArrayList < Attribute > ( ) ; for ( i = 0 ; i < getNumAttributes ( ) ; i ++ ) { atts . add ( new Attribute ( "a" + i ) ) ; } clsValues = new ArrayList < String > ( ) ; for ( i = 0 ; i < getNumClasses ( ) ; i ++ ) { clsValues . add ( "c" + i ) ; } atts . add ( new Attribute ( "class" , clsValues ) ) ; m_DatasetFormat = new Instances ( getRelationNameToUse ( ) , atts , 0 ) ; return m_DatasetFormat ; }
initializes the format for the dataset produced . must be called before the generateexample or generateexamples methods are used . re - initializes the random number generator with the given seed .
