Package org.jamesii.asf.spdm.dataimport

Examples of org.jamesii.asf.spdm.dataimport.PerformanceDataSet


  public PerformanceDataSet getPerformanceData() {

    List<PerformanceTuple> performanceData = new ArrayList<>();

    if (!dirFile.isDirectory()) {
      return new PerformanceDataSet(performanceData, maximisePerformance);
    }

    SimSystem.report(Level.INFO, "Main directory for file data import: " + dirFile.getAbsolutePath());

    List<File> importableFiles = getEligibleFiles(dirFile);
    Collections.sort(importableFiles, new CompareFilesByName());

    for (File file : importableFiles) {
      performanceData.addAll(readProblemFile(file, getModelProps(file)));
    }

    SimSystem.report(Level.INFO, "Size of performance data: " + performanceData.size()
    + " tuples from " + importableFiles.size() + " files.");
    return new PerformanceDataSet(performanceData, maximisePerformance);
  }
View Full Code Here


        (new XMLImportManagerFactory()).create(new ParameterBlock(
            "./testdata/test.xml", XMLImportManagerFactory.RESULT_FILE), SimSystem.getRegistry().createContext());
  }

  public void testImport() {
    PerformanceDataSet perfData = manager.getPerformanceData();
    assertNotNull(perfData);
    assertNotNull(perfData.getInstances());
    assertNotNull(perfData.getMetaData());
    assertEquals(11, perfData.getInstances().size());
  }
View Full Code Here

    assertEquals("rwc", testTuple.getConfiguration().get(FileImportManager.RNG));
    assertTrue(Math.abs(testTuple.getPerformance() - 3.48973) < 0.001);
  }

  public void testTupleList() {
    PerformanceDataSet dataSet = fileManager.getPerformanceData();
    List<PerformanceTuple> tuples = dataSet.getInstances();
    assertEquals(344, tuples.size());
    PerformanceTuple testTuple = tuples.get(17);
    assertEquals("nrma", testTuple.getConfiguration()
        .get(FileImportManager.SIM));
    System.out.println("Eq:"
View Full Code Here

    assertEquals("rwc", testTuple.getConfiguration().get(FileImportManager.RNG));

  }

  public void testMetaData() {
    PerformanceDataSet dataSet = fileManager.getPerformanceData();
    PerfTupleMetaData metaData = dataSet.getMetaData();
    assertNotNull(metaData);
    assertEquals(4, metaData.getNominalAttribs().size());
    assertEquals(0, metaData.getNumericAttribs().size());
  }
View Full Code Here

TOP

Related Classes of org.jamesii.asf.spdm.dataimport.PerformanceDataSet

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.