Examples of PlannerBenchmarkFactory


Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

        return "org/optaplanner/examples/nqueens/benchmark/nqueensBenchmarkConfig.xml";
    }

    @Override
    protected PlannerBenchmarkFactory buildPlannerBenchmarkFactory(File unsolvedDataFile) {
        PlannerBenchmarkFactory benchmarkFactory = super.buildPlannerBenchmarkFactory(unsolvedDataFile);
        PlannerBenchmarkConfig benchmarkConfig = benchmarkFactory.getPlannerBenchmarkConfig();
        benchmarkConfig.setWarmUpSecondsSpentLimit(0L);
        benchmarkConfig.getInheritedSolverBenchmarkConfig().getSolverConfig().getEntityClassList()
                .add(Row.class); // Intentionally crash the solver
        return benchmarkFactory;
    }
View Full Code Here

Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

        this.argOption = argOption;
    }

    @Test
    public void buildPlannerBenchmark() {
        PlannerBenchmarkFactory plannerBenchmarkFactory = argOption.buildPlannerBenchmarkFactory();
        PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark();
        assertNotNull(plannerBenchmark);
    }
View Full Code Here

Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

    private static final long MAXIMUM_SECONDS_SPENT = 30L;

    protected abstract String createBenchmarkConfigResource();

    protected void runBenchmarkTest(File unsolvedDataFile) {
        PlannerBenchmarkFactory plannerBenchmarkFactory = buildPlannerBenchmarkFactory(unsolvedDataFile);
        PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark();
        plannerBenchmark.benchmark();
    }
View Full Code Here

Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

        plannerBenchmark.benchmark();
    }
   
    protected PlannerBenchmarkFactory buildPlannerBenchmarkFactory(File unsolvedDataFile) {
        String benchmarkConfigResource = createBenchmarkConfigResource();
        PlannerBenchmarkFactory benchmarkFactory = PlannerBenchmarkFactory.createFromXmlResource(benchmarkConfigResource);
        PlannerBenchmarkConfig plannerBenchmarkConfig = benchmarkFactory.getPlannerBenchmarkConfig();
        String benchmarkDirectoryPath = plannerBenchmarkConfig.getBenchmarkDirectory().getPath();
        // On Windows, getPath() contains backslashes instead of normal slashes
        String prefix = "local" + File.separator + "data" + File.separator;
        if (!benchmarkDirectoryPath.startsWith(prefix)) {
            throw new IllegalStateException("The benchmarkDirectoryPath (" + benchmarkDirectoryPath
View Full Code Here

Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

            }
        }
        if (argOption == null) {
            argOption = benchmarkArgumentMap.values().iterator().next();
        }
        PlannerBenchmarkFactory plannerBenchmarkFactory = argOption.buildPlannerBenchmarkFactory();
        if (!aggregator) {
            PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark();
            plannerBenchmark.benchmark();
        } else {
            BenchmarkAggregatorFrame.createAndDisplay(plannerBenchmarkFactory);
        }
    }
View Full Code Here

Examples of org.optaplanner.benchmark.api.PlannerBenchmarkFactory

public class CloudBalancingBenchmarkHelloWorld {

    public static void main(String[] args) {
        // Build the PlannerBenchmark
        PlannerBenchmarkFactory plannerBenchmarkFactory = PlannerBenchmarkFactory.createFromXmlResource(
                "org/optaplanner/examples/cloudbalancing/benchmark/cloudBalancingBenchmarkConfig.xml");
        PlannerBenchmark plannerBenchmark = plannerBenchmarkFactory.buildPlannerBenchmark();

        // Benchmark the problem
        plannerBenchmark.benchmark();

        // Show the benchmark report
        System.out.println("\nPlease open the benchmark report in:  \n"
                + plannerBenchmarkFactory.getPlannerBenchmarkConfig().getBenchmarkDirectory().getAbsolutePath());
    }
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.