Examples of PortfolioPerformanceData


Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

  @Override
  public double[] portfolio(PortfolioProblemDescription problem) {

    Double[][] performances = problem.getPerformancesForMaximization(0);
    PortfolioProblemDescription problemGA =
        new PortfolioProblemDescription(new PortfolioPerformanceData(
            performances), problem.getAcceptableRisk(),
            problem.getMaximizationFlags()[0], problem.getMinSize(),
            problem.getMaxSize());

    currentPool =
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

        new PortfolioPerformanceExtractor("CyclicChain",
            SimSpExPerspective.getPerformanceDataBase(),
            TotalRuntimePerfMeasurerFactory.class);

    try {
      PortfolioPerformanceData portPerfData = portExtract.extract();
      System.out
          .println(Strings.displayMatrix(portPerfData.performances, '\t'));
      for (SelectionTree config : portPerfData.configurations) {
        System.out.println();
        System.out.println(Strings.dispIterable(config.getUniqueFactories()));
      }

      String fileName = args[0];
      Files.save(portPerfData, fileName);
      PortfolioPerformanceData desPerfData =
          (PortfolioPerformanceData) Files.load(fileName);
      System.out.println(Strings.displayMatrix(desPerfData.performances, '\t'));

      for (SelectionTree config : desPerfData.configurations) {
        System.out.println();
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

        }
        matrix[algo][problem] = performance / numOfSimulatedReplications;
      }
    }

    return new PortfolioPerformanceData(matrix);
  }
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

   * @return the pair<double[],double[]>
   */
  private Pair<double[], double[]> createPortfolios(
      PerformanceDataGenerator generator, GeneticAlgorithmPortfolioSelector gaps) {

    PortfolioPerformanceData perfData = generator.generateTestMatrix();
    PortfolioProblemDescription pdd =
        new PortfolioProblemDescription(perfData, acceptableRisk, false,
            MIN_SIZE, MAX_SIZE);
    gaps.setIndividualFactory(new ListIndividualFactory());
    double[] portfolio = gaps.portfolio(pdd);
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

   */
  public void testSimplePortfolioConstruction() {

    List<Pair<Integer, Double>> portfolio =
        ps.constructPortfolio(new PortfolioProblemDescription(
            new PortfolioPerformanceData(PERF_DATA), 1, false, 1, 2));
    assertTrue(portfolio.size() == 1 || portfolio.size() == 2);

    double weightSum = 0;
    for (Pair<Integer, Double> pElem : portfolio) {
      assertTrue(pElem.getSecondValue() >= 0 && pElem.getSecondValue() <= 1.0);
      assertTrue(pElem.getFirstValue() >= 0
          && pElem.getFirstValue() < PERF_DATA[0].length);
      weightSum += pElem.getSecondValue();
    }

    assertTrue(Math.abs(1 - weightSum) <= AbstractPortfolioSelector.EPSILON);

    // This is a stochastic result (although *very* likely) - re-run if check
    // fails
    PERF_DATA[0] = new Double[] { .5, .5, .5, .5 };
    portfolio =
        ps.constructPortfolio(new PortfolioProblemDescription(
            new PortfolioPerformanceData(PERF_DATA), 1, true, 1, 2));
    assertEquals(1, portfolio.size());
    assertEquals(2, portfolio.get(0).getFirstValue().intValue());

    portfolio =
        ps.constructPortfolio(new PortfolioProblemDescription(
            new PortfolioPerformanceData(PERF_DATA), 1, false, 1, 2));
    assertEquals(1, portfolio.size());
    assertEquals(0, portfolio.get(0).getFirstValue().intValue());

  }
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

  PortfolioProblemDescription ppd;

  @Override
  public void setUp() {
    ppd =
        new PortfolioProblemDescription(new PortfolioPerformanceData(
            PERF_MATRIX), 0, false, 1, 2);
  }
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

  public static void main(String[] args) throws Exception {

    System.out.println("Hit enter to start...");
    System.in.read();

    PortfolioPerformanceData portPerfData =
        (PortfolioPerformanceData) Files.load(args[0]);
    System.err.println("Algorithms:" + portPerfData.performances.length);
    System.err.println(portPerfData.performances[0].length);
    System.out.println(Strings.displayMatrix(portPerfData.performances, '\t'));
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

   */
  public void testPerformance() {

    PerformanceDataGenerator generator =
        new PerformanceDataGenerator(50, 3, 200, 3, 3);
    PortfolioPerformanceData perfData = generator.generateTestMatrix();

    System.out.println("Number of Algorithm: " + perfData.performances.length);
    System.out
        .println("Number of Problems: " + perfData.performances[0].length);
    printMatrix(perfData.performances);
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

  private GeneticAlgorithmPortfolioSelector gaps;

  @Override
  public void setUp() {
    problemDescription =
        new PortfolioProblemDescription(new PortfolioPerformanceData(
            problemMatrix), 0, true, MIN_SIZE, MAX_SIZE);
    gaps = new GeneticAlgorithmPortfolioSelector();
    gaps.setFactoryGenePool(FACTORY_GENE_POOL);
  }
View Full Code Here

Examples of org.jamesii.asf.portfolios.plugintype.PortfolioPerformanceData

    gaps.setAbortCriterion(new GenerationCountAbort(GEN_COUNT));
    gaps.setFitness(NULL_FITNESS);
    gaps.setNumIndividuals(NUM_OF_IND);

    gaps.portfolio(new PortfolioProblemDescription(
        new PortfolioPerformanceData(problemMatrixNull), 0, true, MIN_SIZE,
        MAX_SIZE));
    gaps.setIndividualFactory(FACTORY_INDIVIDUAL);

    SimSystem.report(Level.INFO,
        "NullTest: Achieved fitness after " + gaps.getGenerationCount()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.