Package weka.core

Examples of weka.core.SerializedObject


   * @exception Exception if something goes wrong
   */
  public void setFlow(Vector v) throws Exception {
    //    Vector beansCopy = null, connectionsCopy = null;
    clearLayout();
    SerializedObject so = new SerializedObject(v);
    Vector copy = (Vector)so.getObject();
   
    Vector beans = (Vector)copy.elementAt(0);
    Vector connections = (Vector)copy.elementAt(1);
   
    // reset environment variables
View Full Code Here


    Vector connections = BeanConnection.getConnections();
    detachFromLayout(beans);
    v.add(beans);
    v.add(connections);

    SerializedObject so = new SerializedObject(v);
    Vector copy = (Vector)so.getObject();

    //    tempWrite(beans, connections);
   
    integrateFlow(beans, connections);
    return copy;
View Full Code Here

    if (model == null) {
      throw new Exception("No model evaluator set");
    }
    ASEvaluation [] evaluators = new ASEvaluation [num];
    SerializedObject so = new SerializedObject(model);
    for(int i = 0; i < evaluators.length; i++) {
      evaluators[i] = (ASEvaluation) so.getObject();
    }
    return evaluators;
  }
View Full Code Here

    if (model == null)
      throw new Exception("No model search scheme set");
     
    ASSearch[] result = new ASSearch[num];
    SerializedObject so = new SerializedObject(model);
    for (int i = 0; i < result.length; i++)
      result[i] = (ASSearch) so.getObject();

    return result;
  }
View Full Code Here

      numExps = getRunUpper() - getRunLower() + 1;
    }
    m_subExperiments = new Experiment[numExps];
    m_subExpComplete = new int[numExps];
    // create copy of base experiment
    SerializedObject so = new SerializedObject(m_baseExperiment);

    if (getSplitByDataSet()) {
      for (int i = 0; i < m_baseExperiment.getDatasets().size(); i++) {
  m_subExperiments[i] = (Experiment)so.getObject();
  // one for each data set
  DefaultListModel temp = new DefaultListModel();
  temp.addElement(m_baseExperiment.getDatasets().elementAt(i));
  m_subExperiments[i].setDatasets(temp);
  m_subExpQueue.push(new Integer(i));
      }
    } else {
      for (int i = getRunLower(); i <= getRunUpper(); i++) {
  m_subExperiments[i-getRunLower()] = (Experiment)so.getObject();
  // one run for each sub experiment
  m_subExperiments[i-getRunLower()].setRunLower(i);
  m_subExperiments[i-getRunLower()].setRunUpper(i);
 
  m_subExpQueue.push(new Integer(i-getRunLower()));
View Full Code Here

                int num) throws Exception {
     if (model == null) {
      throw new Exception("No model clusterer set");
    }
    DensityBasedClusterer [] clusterers = new DensityBasedClusterer [num];
    SerializedObject so = new SerializedObject(model);
    for(int i = 0; i < clusterers.length; i++) {
      clusterers[i] = (DensityBasedClusterer) so.getObject();
    }
    return clusterers;
  }
View Full Code Here

   * @return a deep copy of the classifier
   * @exception Exception if an error occurs
   */
  public static Classifier makeCopy( Classifier model ) throws Exception {

    return (Classifier) new SerializedObject( model ).getObject();
  }
View Full Code Here

    if( model == null ) {
      throw new Exception( "No model classifier set" );
    }
    Classifier[] classifiers = new Classifier[num];
    SerializedObject so = new SerializedObject( model );
    for( int i = 0; i < classifiers.length; i++ ) {
      classifiers[i] = (Classifier) so.getObject();
    }
    return classifiers;
  }
View Full Code Here

   * @param source the object to copy
   * @return a copy of the source object
   * @exception Exception if the copy fails
   */
  public Object makeCopy(Object source) throws Exception {
    SerializedObject so = new SerializedObject(source);
    Object result = so.getObject();
    return result;
  }
View Full Code Here

   * @param kernel   the kernel to copy
   * @return     a deep copy of the kernel
   * @throws Exception   if an error occurs
   */
  public static Kernel makeCopy(Kernel kernel) throws Exception {
    return (Kernel) new SerializedObject(kernel).getObject();
  }
View Full Code Here

TOP

Related Classes of weka.core.SerializedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.