Package tables

Examples of tables.DimTable


    CSVList pol_SPEED = new CSVList(this.parameters.getValueOfParameter(Statics.pol_SPEED));
    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));
View Full Code Here


    return this.dimTable;
  }
 
  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

  }
 
  private <E> Table<E> readData(DimensionMap filter, E dummyInstance)
  {
    JEXStatics.statusBar.setStatusText("Started Reading ARFF");
    DimTable filteredDimTable;
    if(filter == null)
    {
      filteredDimTable = this.dimTable.copy();
    }
    else
    {
      filteredDimTable = this.dimTable.getSubTable(filter);
    }
   
    double count = 0;
    try
    {
      if(this.multipleReadsFlag)
      {
        this.reset();
      }
      // gather the data
      TreeMap<DimensionMap,E> data = new TreeMap<DimensionMap,E>();
     
      Instance instance;
      Pair<DimensionMap,E> pair;
      if(filter == null)
      {
        while ((instance = this.loader.m_ArffReader.readInstance(this.structure)) != null)
        {
          pair = this.getPair(instance);
          if(pair.p2 != null)
          {
            data.put(pair.p1, pair.p2);
          }
          count++;
          if(count % 1000 == 0)
          {
            JEXStatics.statusBar.setStatusText("Reading ARFF Line Number: " + count + "");
          }
        }
      }
      else
      {
        while ((instance = this.loader.m_ArffReader.readInstance(this.structure)) != null)
        {
          pair = this.getPair(instance);
          if(pair.p2 != null && filteredDimTable.hasDimensionMap(pair.p1))
          {
            data.put(pair.p1, pair.p2);
          }
          count++;
          if(count % 1000 == 0)
View Full Code Here

      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

    return JEXTableWriter.writeTable(tableName, data, ARFF_FILE);
  }
 
  public static <E> String writeTable(String tableName, TreeMap<DimensionMap,E> data, String extension)
  {
    DimTable dimTable = new DimTable(data);
    return JEXTableWriter.writeTable(tableName, dimTable, data, extension);
  }
View Full Code Here

TOP

Related Classes of tables.DimTable

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.