Search in sources :

Example 1 with StatSummary

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<>();
}
Also used : StatSummary(utilities.StatSummary)

Example 2 with StatSummary

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);
}
Also used : StatSummary(utilities.StatSummary) ElapsedTimer(utilities.ElapsedTimer)

Example 3 with StatSummary

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;
}
Also used : StatSummary(utilities.StatSummary) JEasyFrame(utilities.JEasyFrame)

Example 4 with StatSummary

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);
}
Also used : StatSummary(utilities.StatSummary) ElapsedTimer(utilities.ElapsedTimer)

Example 5 with StatSummary

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);
}
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