Package org.jamesii.asf.spdm

Examples of org.jamesii.asf.spdm.Configuration


   */
  public static <T extends PerformanceTuple> Map<Configuration, List<T>> sortToConfigMap(
      List<T> perfTuples) {
    HashMap<Configuration, List<T>> configMap = new HashMap<>();
    for (T perfTuple : perfTuples) {
      Configuration config = perfTuple.getConfiguration();
      if (configMap.containsKey(config)) {
        configMap.get(config).add(perfTuple);
      } else {
        List<T> perfTupleList = new ArrayList<>();
        perfTupleList.add(perfTuple);
View Full Code Here


   * @return a performance tuple
   */
  public static PerformanceTuple generatePerformanceTuple(Features features,
      List<String> tokens) {

    Configuration conf = new Configuration(null);
    String[] identifiers = { SIM, SIMPARAMS, EQ, RNG };
    for (int i = 0; i < identifiers.length; i++) {
      String ident = identifiers[i];
      if (tokens.get(i).isEmpty()) {
        continue;
      }
      conf.put(ident, tokens.get(i));

    }

    // Average performance is 6th element
    double avgPerf = Double.parseDouble(tokens.get(5));
View Full Code Here

    List<ProblemPerformanceTuple> perfTuples = new ArrayList<>();

    for (IRuntimeConfiguration rtConfig : rtConfigs) {
      try {
        Configuration config = rtcToConfig.get(rtConfig.getID());
        List<Pair<Features, Double>> results =
            extractFeaturePerformanceTuples(problem, rtConfig, perfData);

        // Check whether features are same for all applications - only
        // create *one* performance tuple if that is the case
View Full Code Here

   * @param config
   *          the runtime configuration at hand
   * @return the corresponding configuration map for the data mining components
   */
  public static Configuration createConfiguration(IRuntimeConfiguration config) {
    return new Configuration(config.getSelectionTree());
  }
View Full Code Here

   * could be fine - if not, just override this method).
   *
   * @return the ensemble configuration
   */
  public Configuration getEnsembleConfig() {
    return new Configuration();
  }
View Full Code Here

    Map<Long, Map<Configuration, List<Double>>> map = new HashMap<>();
    Map<Long, Map<Configuration, ProblemPerformanceTuple>> resultTupleMap =
        new HashMap<>();
    for (ProblemPerformanceTuple tuple : instances) {
      Long problemID = tuple.getProblemDefinitionID();
      Configuration config = tuple.getConfiguration();
      Map<Configuration, List<Double>> configPerformanceMap =
          map.get(problemID);
      Map<Configuration, ProblemPerformanceTuple> configTupleMap =
          resultTupleMap.get(problemID);
      if (configTupleMap == null) {
        configPerformanceMap = new HashMap<>();
        configTupleMap = new HashMap<>();
        map.put(problemID, configPerformanceMap);
        resultTupleMap.put(problemID, configTupleMap);
      }
      List<Double> performanceList = configPerformanceMap.get(config);
      if (performanceList == null) {
        performanceList = new ArrayList<>();
        ProblemPerformanceTuple resultTuple =
            new ProblemPerformanceTuple(tuple.getProblemSchemeURI(),
                tuple.getProblemSchemeParameters(),
                tuple.getProblemDefinitionID(),
                tuple.getProblemDefinitionParameters(), tuple.getFeatures(),
                config, perfMeasureFactory, 0.0);
        configTupleMap.put(config, resultTuple);
        configPerformanceMap.put(config, performanceList);
      }
      performanceList.add(tuple.getPerformance());
    }

    for (Map.Entry<Long, Map<Configuration, List<Double>>> entry : map
        .entrySet()) {
      Long problemId = entry.getKey();
      for (Map.Entry<Configuration, List<Double>> entry2 : entry.getValue()
          .entrySet()) {
        Configuration config = entry2.getKey();
        List<Double> performances = entry2.getValue();
        Double performance = getAggregatedPerformance(performances);
        ProblemPerformanceTuple resultTuple =
            resultTupleMap.get(problemId).get(config);
        resultTuple.setPerformance(performance);
View Full Code Here

   */
  private List<PerformanceTuple> createAggregatedTuples(
      Map<Long, Features> featuresByProblem,
      Map<Long, Features> oldFeaturesByProblem,
      Map<Long, List<ProblemPerformanceTuple>> tuplesByProblem) {
    Configuration config = getEnsembleConfig();

    List<PerformanceTuple> aggregatedTuples = new ArrayList<>();
    for (Entry<Long, Features> featuresEntry : featuresByProblem.entrySet()) {

      Long problemID = featuresEntry.getKey();
View Full Code Here

   * @param entry
   *          the configuration entry
   * @return the predicted performance
   */
  private double lookUp(ConfigurationEntry entry) {
    Configuration config = entry.getConfig();
    if (!pastPredictions.containsKey(config)) {
      pastPredictions.put(config,
          Double.valueOf(predictor.predictPerformance(features, config)));
    }
    return pastPredictions.get(config);
View Full Code Here

  @Override
  public void setUp() {
    Features features = new Features();
    features.put(TEST_FEATURE, TEST_FEATURE_VALUE);
    Configuration configuration = new Configuration(null);
    configuration.put(TEST_CONFIG, TEST_CONFIG_VALUE);
    perfTuple =
        new PerformanceTuple(features, configuration,
            TotalRuntimePerfMeasurerFactory.class, 10);
  }
View Full Code Here

   */
  @Override
  protected void setUp() throws Exception {
    perfTuples = new ArrayList<>(100);
    for (int i = 0; i < 100; i++) {
      perfTuples.add(new PerformanceTuple(new Features(), new Configuration(
          null), TotalRuntimePerfMeasurerFactory.class, i + 1));
    }
  }
View Full Code Here

TOP

Related Classes of org.jamesii.asf.spdm.Configuration

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.