Package tables

Examples of tables.Dim


    CSVList pol_SPACING = new CSVList(this.parameters.getValueOfParameter(Statics.pol_SPACING));
    CSVList rib_SPEED = new CSVList(this.parameters.getValueOfParameter(Statics.rib_SPEED));
    CSVList rib_SPACING = new CSVList(this.parameters.getValueOfParameter(Statics.rib_SPACING));
   
    this.paramTable = new DimTable();
    this.paramTable.add(new Dim(Statics.k_TRANSCRIPTION, k_TRANSCRIPTION));
    this.paramTable.add(new Dim(Statics.ratio_TRANSCRIPTION_2_REPLICATION, ratio_TRANSCRIPTION_2_REPLICATION));
    this.paramTable.add(new Dim(Statics.ratio_GENOME_2_ANTIGENOME, ratio_GENOME_2_ANTIGENOME));
    this.paramTable.add(new Dim(Statics.stoich_ERROR, stoich_ERROR));
    this.paramTable.add(new Dim(Statics.k_POL_FORMATION, k_POL_FORMATION));
    this.paramTable.add(new Dim(Statics.k_CONDENSATION, k_CONDENSATION));
    this.paramTable.add(new Dim(Statics.k_DETECTION, k_DETECTION));
    this.paramTable.add(new Dim(Statics.pol_SPEED, pol_SPEED));
    this.paramTable.add(new Dim(Statics.pol_SPACING, pol_SPACING));
    this.paramTable.add(new Dim(Statics.rib_SPEED, rib_SPEED));
    this.paramTable.add(new Dim(Statics.rib_SPACING, rib_SPACING));
   
    for (DimensionMap params : this.paramTable.getMapIterator())
    {
      // Create the VSVModel to simulate and set the parameters
      VSVModel model = new VSVModel();
View Full Code Here


  private void createDimTable()
  {
    this.dimTable = new DimTable();
    for (int i = 0; i < this.structure.numAttributes() - 1; i++)
    {
      Dim newDim = new Dim(this.structure.attribute(i));
      this.dimTable.add(newDim);
    }
  }
View Full Code Here

    int displayPercentage = -1, currentPercentage = 0;
    try
    {
      // Set up the writers
      JEXStatics.statusBar.setStatusText("Creating ARFF Writers: 0%");
      Dim splitDim = reader.dimTable.getDimWithName(splitDimName);
      TreeMap<String,JEXTableWriter> writers = new TreeMap<String,JEXTableWriter>();
      double count = 0;
      double total = splitDim.size();
      displayPercentage = 0;
      for (String newDim : splitDim.dimValues)
      {
        DimTable subTable = reader.dimTable.getSubTable(new DimensionMap(splitDimName + "=" + newDim));
        JEXTableWriter writer = new JEXTableWriter(tableName, fileExtension);
        writer.writeHeader(subTable, reader.isNumeric());
        writers.put(newDim, writer);
       
        count++;
        currentPercentage = (int) (100.0 * count / total);
        if(currentPercentage != displayPercentage)
        {
          displayPercentage = currentPercentage;
          JEXStatics.statusBar.setStatusText("Preparing ARFF Files: " + displayPercentage + "%");
        }
      }
     
      // Write each datapoint to a file
      JEXStatics.statusBar.setStatusText("Splitting ARFFs: 0%");
      Instance instance;
      Pair<DimensionMap,E> pair;
      count = 0;
      total = reader.dimTable.mapCount();
      displayPercentage = 0;
      while ((instance = reader.loader.m_ArffReader.readInstance(reader.structure)) != null)
      {
        if(canceler.isCanceled())
        {
          // Exit gracefully
          for (String splitDimValue : splitDim.dimValues)
          {
            JEXTableWriter writer = writers.get(splitDimValue);
            writer.close();
          }
          return null;
        }
        pair = reader.getPair(instance);
        DimensionMap map = pair.p1;
        JEXTableWriter theWriter = writers.get(map.get(splitDimName));
        theWriter.writeData(map, pair.p2);
       
        count++;
        currentPercentage = (int) (100.0 * count / total);
        if(currentPercentage != displayPercentage)
        {
          displayPercentage = currentPercentage;
          JEXStatics.statusBar.setStatusText("Splitting ARFF: " + displayPercentage + "%");
        }
      }
     
      // Close the writers and return the filePaths
      TreeMap<DimensionMap,String> filePaths = new TreeMap<DimensionMap,String>();
      JEXStatics.statusBar.setStatusText("Defragging ARFFs: 0%");
      count = 0;
      total = splitDim.size();
      displayPercentage = 0;
      for (String splitDimValue : splitDim.dimValues)
      {
        JEXTableWriter writer = writers.get(splitDimValue);
        writer.close();
        String path = JEXTableWriter.defrag(writer.getPath());
        filePaths.put(new DimensionMap(splitDimName + "=" + splitDimValue), path);
       
        count++;
        currentPercentage = (int) (100.0 * count / total);
        if(currentPercentage != displayPercentage)
        {
          displayPercentage = currentPercentage;
          JEXStatics.statusBar.setStatusText("Defragging ARFFs: " + displayPercentage + "%");
        }
      }
      DimTable outputDimTable = new DimTable();
      outputDimTable.add(splitDim.copy());
      return new Table<String>(outputDimTable, filePaths);
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of tables.Dim

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.