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();
}
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;
}
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;
}
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();
}
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++;
}
Aggregations