Search in sources :

Example 1 with MBanditEA

use of bandits.MBanditEA in project SimpleAsteroids by ljialin.

the class TestEA method sweepSamplingRate.

public static void sweepSamplingRate(int from, int to) {
    EvoAlg ea = new MBanditEA();
    // SolutionEvaluator evaluator = new EvalMaxM(nDims, mValues, 1.0);
    // SolutionEvaluator noiseFree = new EvalMaxM(nDims, mValues, 0.0);
    SolutionEvaluator evaluator = new EvalNoisyWinRate(nDims, mValues, 1.0);
    SolutionEvaluator noiseFree = new EvalNoisyWinRate(nDims, mValues, 0.0);
    for (int i = from; i <= to; i++) {
        ea = new SimpleRMHC(i);
        // ea = new MBanditEA();
        ea = new NTupleBanditEA();
        StatSummary ss = runTrials(ea, evaluator, noiseFree, nTrials, nFitnessEvals);
        // System.out.format("%d\t %.2f \t %.3f \t %.3f \t %.2f\n", i, ss.mean(), ss.stdErr(), ssOpt.mean(), nOpt.mean());
        System.out.format("%d\t %.3f \t %.3f \t %.3f \t %.2f\t  %.3f\n", i, ss.mean(), nOpt.mean(), ssOpt.mean(), ntOpt.mean(), ntPerf.mean());
    // System.out.format("%d\t %.2f \t %.2f \t %.2f \n", i, ss.mean(), ss.stdErr(), ssOpt.mean());
    }
}
Also used : StatSummary(utilities.StatSummary) SimpleRMHC(ga.SimpleRMHC) NTupleBanditEA(ntuple.NTupleBanditEA) MBanditEA(bandits.MBanditEA)

Example 2 with MBanditEA

use of bandits.MBanditEA in project SimpleAsteroids by ljialin.

the class EvoNTupleTest method main.

public static void main(String[] args) {
    // the number of bandits is equal to the size of the array
    int nDims = 5;
    int nTrials = 50;
    int nFitnessEvals = 10000;
    EvoAlg ea = new MBanditEA();
    ea = new SimpleRMHC();
    SolutionEvaluator evaluator = new TenFitnessEval(nDims);
    System.out.println("Best fitness stats:");
    System.out.println(runTrials(ea, evaluator, nTrials, nFitnessEvals));
// evaluator.
}
Also used : SolutionEvaluator(evodef.SolutionEvaluator) SimpleRMHC(ga.SimpleRMHC) EvoAlg(evodef.EvoAlg) MBanditEA(bandits.MBanditEA)

Example 3 with MBanditEA

use of bandits.MBanditEA in project SimpleAsteroids by ljialin.

the class BattleTestEA method main.

public static void main(String[] args) {
    // the number of bandits is equal to the size of the array
    int nTrials = 10;
    int nFitnessEvals = 100;
    EvoAlg ea = new MBanditEA();
    ea = new SimpleRMHC(1);
    int nDims = 10;
    int mValues = 2;
    // SolutionEvaluator evaluator = new EvalMaxM(nDims, mValues);
    SolutionEvaluator evaluator = new EvalBattleGame();
    // ea = new NTupleBanditEA();
    System.out.println("Best fitness stats:");
    System.out.println(runTrials(ea, evaluator, nTrials, nFitnessEvals));
// evaluator.
}
Also used : SimpleRMHC(ga.SimpleRMHC) EvalBattleGame(gvglink.EvalBattleGame) MBanditEA(bandits.MBanditEA)

Aggregations

MBanditEA (bandits.MBanditEA)3 SimpleRMHC (ga.SimpleRMHC)3 EvoAlg (evodef.EvoAlg)1 SolutionEvaluator (evodef.SolutionEvaluator)1 EvalBattleGame (gvglink.EvalBattleGame)1 NTupleBanditEA (ntuple.NTupleBanditEA)1 StatSummary (utilities.StatSummary)1