use of utilities.StatSummary in project SimpleAsteroids by ljialin.
the class GameRunner method reset.
public void reset() {
scores = new StatSummary("Game score stats");
nGames = 0;
p1Wins = 0;
p2Wins = 0;
nInitialLeaderWins = 0;
gameLogs = new ArrayList<>();
}
use of utilities.StatSummary in project SimpleAsteroids by ljialin.
the class RandomTestPlanetWars method main.
public static void main(String[] args) {
int nTrials = 100;
SimplePlayerInterface player = new RandomAgent();
StatSummary ss = new StatSummary("Random Player on Planet Wars");
ElapsedTimer t = new ElapsedTimer();
for (int i = 0; i < nTrials; i++) {
ss.add(evaluate(player));
}
System.out.println(ss);
System.out.println();
System.out.println(t);
}
use of utilities.StatSummary in project SimpleAsteroids by ljialin.
the class PlayoutPlotter method startPlot.
/*
just call this to initialise it at the start of a plot routine
*/
@Override
public PlayoutPlotter startPlot(int sequenceLength) {
lineChart = new LineChart().setBG(Color.gray);
lineChart.xAxis = new LineChartAxis(new double[] { 0, sequenceLength / 2, sequenceLength });
lineChart.yAxis = new LineChartAxis(new double[] { -50, -25, 0, 25, 50 });
lineChart.setYLabel("Expected Score");
lineChart.setXLabel("Rollout Depth");
lineChart.plotBG = Color.white;
frame = new JEasyFrame(lineChart, "Fitness versus depth");
scores = new StatSummary();
linePlots = new ArrayList<>();
return this;
}
use of utilities.StatSummary in project SimpleAsteroids by ljialin.
the class PlanetWarsLinkTest method main.
// todo: show a graphic of the rollout predictions
// split this in to two parts
// for each action, we need to collect the data
// then we need to display the data
// each time plot the fitness of each sample versus the length
// of the rollout - this will give a good idea of what we need to plot...
// todo: implement a collision mechanism
// todo: implement a nice graphic that shows transfer from planet to buffer
// this is very easy to do - but question of whether we need a timed or instant movement...
public static void main(String[] args) throws Exception {
int nTrials = 100;
ElapsedTimer timer = new ElapsedTimer();
StatSummary ss = new StatSummary();
for (int i = 0; i < nTrials; i++) {
System.out.println("Game: " + i);
ss.add(runTest());
System.out.println();
}
System.out.println(ss);
System.out.println(timer);
}
use of utilities.StatSummary in project SimpleAsteroids by ljialin.
the class SimpleMaxNTest method main.
public static void main(String[] args) {
StatSummary ss = new StatSummary();
int nTrials = 30;
for (int i = 0; i < nTrials; i++) {
ss.add(runOnce());
}
System.out.println(ss);
}
Aggregations