Search in sources :

Example 56 with StatSummary

use of utilities.StatSummary in project SimpleAsteroids by ljialin.

the class ConvNTuple method getExplorationEstimate.

@Override
public double getExplorationEstimate(int[] x) {
    // StatSummary ssTot = new StatSummary();
    StatSummary exploreStats = new StatSummary();
    for (int[] index : indices) {
        double address = address(x, index);
        StatSummary ss = sampleDis.statMap.get(address);
        if (ss != null) {
            exploreStats.add(explore(ss.n()));
        } else {
            exploreStats.add(explore(0));
        }
    }
    // System.out.println("Explore stats n() " + exploreStats.n() + " : " + exploreStats.mean());
    return exploreStats.mean();
}
Also used : StatSummary(utilities.StatSummary)

Example 57 with StatSummary

use of utilities.StatSummary in project SimpleAsteroids by ljialin.

the class ConvNTuple method getNoveltyStats.

public StatSummary getNoveltyStats(int[] x) {
    StatSummary ssTot = new StatSummary();
    for (int[] index : indices) {
        double address = address(x, index);
        StatSummary ss = sampleDis.statMap.get(address);
        if (ss != null) {
            ssTot.add(ss.n());
        } else {
            ssTot.add(0);
        }
    }
    return ssTot;
}
Also used : StatSummary(utilities.StatSummary)

Example 58 with StatSummary

use of utilities.StatSummary in project SimpleAsteroids by ljialin.

the class EvoNTupleTest method runTrials.

public static StatSummary runTrials(EvoAlg ea, SolutionEvaluator evaluator, int nTrials, int nFitnessEvals) {
    // record the time stats
    StatSummary ss = new StatSummary();
    for (int i = 0; i < nTrials; i++) {
        ElapsedTimer t = new ElapsedTimer();
        evaluator.reset();
        ea.runTrial(evaluator, nFitnessEvals);
        System.out.println(t);
        evaluator.logger().report();
        System.out.println();
        ss.add(evaluator.logger().ss.max());
    }
    return ss;
}
Also used : StatSummary(utilities.StatSummary) ElapsedTimer(utilities.ElapsedTimer)

Example 59 with StatSummary

use of utilities.StatSummary in project SimpleAsteroids by ljialin.

the class GeneMeanModel method resetStats.

public void resetStats() {
    // give each one a 50% chance of being on
    // set each StatSummary as strict to avoid incorrect use of mean value
    // a StatSummary with no numbers does not have a mean
    stats = new StatSummary[nValues];
    for (int i = 0; i < nValues; i++) stats[i] = new StatSummary().setStrict(true);
    // use the overall mean summary to handle any values we've not yet seen
    mean = new StatSummary();
}
Also used : StatSummary(utilities.StatSummary)

Example 60 with StatSummary

use of utilities.StatSummary in project SimpleAsteroids by ljialin.

the class NTuple method add.

public void add(int[] x, StatSummary ssIncoming) {
    // for each address that occurs, we're going to store something
    StatSummary ss = getStatsForceCreate(x);
    ss.add(ssIncoming);
    nSamples++;
}
Also used : StatSummary(utilities.StatSummary)

Aggregations

StatSummary (utilities.StatSummary)88 ElapsedTimer (utilities.ElapsedTimer)27 ArrayList (java.util.ArrayList)10 JEasyFrame (utilities.JEasyFrame)8 SimpleRMHC (ga.SimpleRMHC)7 NTupleBanditEA (ntuple.NTupleBanditEA)6 EvoAlg (evodef.EvoAlg)4 Random (java.util.Random)4 LineChart (plot.LineChart)4 LineChartAxis (plot.LineChartAxis)4 StateObservationMulti (core.game.StateObservationMulti)3 DefaultMutator (evodef.DefaultMutator)3 TreeSet (java.util.TreeSet)3 Types (ontology.Types)3 LineGroup (plot.LineGroup)3 ElapsedCpuTimer (tools.ElapsedCpuTimer)3 Gson (com.google.gson.Gson)2 GsonBuilder (com.google.gson.GsonBuilder)2 AbstractMultiPlayer (core.player.AbstractMultiPlayer)2 ShortestPathTest (evomaze.ShortestPathTest)2