Search in sources :

Example 1 with AnnotatedFitnessSpace

use of evodef.AnnotatedFitnessSpace in project SimpleAsteroids by ljialin.

the class TestHyperParamAsteroids method main.

public static void main(String[] args) {
    AnnotatedFitnessSpace testAsteroids = new EvoAgentSearchSpaceAsteroids();
    EvoAlg[] evoAlgs = { new NTupleBanditEA().setKExplore(10000), // new CompactSlidingGA(),
    new SlidingMeanEDA() };
    int nChecks = 50;
    int nEvals = 50;
    int nTrials = 2;
    for (EvoAlg evoAlg : evoAlgs) {
        HyperParamTuneRunner runner = new HyperParamTuneRunner();
        runner.nChecks = nChecks;
        runner.nTrials = nTrials;
        runner.nEvals = nEvals;
        runner.runTrials(evoAlg, testAsteroids);
    }
}
Also used : AnnotatedFitnessSpace(evodef.AnnotatedFitnessSpace) EvoAgentSearchSpaceAsteroids(planetwar.EvoAgentSearchSpaceAsteroids) SlidingMeanEDA(ntuple.SlidingMeanEDA) NTupleBanditEA(ntuple.NTupleBanditEA) EvoAlg(evodef.EvoAlg)

Example 2 with AnnotatedFitnessSpace

use of evodef.AnnotatedFitnessSpace in project SimpleAsteroids by ljialin.

the class TestHyperParamPlanetWars method main.

public static void main(String[] args) {
    int nEvals = 288;
    if (args.length == 1) {
        nEvals = Integer.parseInt(args[0]);
    }
    System.out.println("Optimization budget: " + nEvals);
    NTupleBanditEA ntbea = new NTupleBanditEA().setKExplore(1);
    GameState.includeBuffersInScore = true;
    EvoAgentSearchSpace.tickBudget = 2000;
    EvoAlg[] evoAlgs = { // new SimpleRMHC(5),
    ntbea };
    int nChecks = 100;
    int nTrials = 100;
    ElapsedTimer timer = new ElapsedTimer();
    for (EvoAlg evoAlg : evoAlgs) {
        // LineChart lineChart = new LineChart();
        // lineChart.yAxis = new LineChartAxis(new double[]{-2, -1, 0, 1, 2});
        // lineChart.setYLabel("Fitness");
        HyperParamTuneRunner runner = new HyperParamTuneRunner();
        // runner.verbose = true;
        // runner.setLineChart(lineChart);
        runner.nChecks = nChecks;
        runner.nTrials = nTrials;
        runner.nEvals = nEvals;
        runner.plotChecks = 0;
        AnnotatedFitnessSpace testPlanetWars = new EvoAgentSearchSpace();
        System.out.println("Testing: " + evoAlg);
        runner.runTrials(evoAlg, testPlanetWars);
        System.out.println("Finished testing: " + evoAlg);
    // note, this is a bit of a hack: it only reports the final solution
    // System.out.println(new EvoAgentSearchSpace().report(runner.solution));
    }
    // System.out.println(ntbea.getModel().s);
    System.out.println("Time for all experiments: " + timer);
}
Also used : AnnotatedFitnessSpace(evodef.AnnotatedFitnessSpace) ElapsedTimer(utilities.ElapsedTimer) NTupleBanditEA(ntuple.NTupleBanditEA) EvoAlg(evodef.EvoAlg) EvoAgentSearchSpace(planetwar.EvoAgentSearchSpace)

Aggregations

AnnotatedFitnessSpace (evodef.AnnotatedFitnessSpace)2 EvoAlg (evodef.EvoAlg)2 NTupleBanditEA (ntuple.NTupleBanditEA)2 SlidingMeanEDA (ntuple.SlidingMeanEDA)1 EvoAgentSearchSpace (planetwar.EvoAgentSearchSpace)1 EvoAgentSearchSpaceAsteroids (planetwar.EvoAgentSearchSpaceAsteroids)1 ElapsedTimer (utilities.ElapsedTimer)1