com.vadeen.neat.gui.stats.NeatStats Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neat-gui Show documentation
Show all versions of neat-gui Show documentation
GUI implemenation for com.vadeen.neat.
The newest version!
package com.vadeen.neat.gui.stats;
import com.vadeen.neat.generation.Generation;
import com.vadeen.neat.gui.stats.info.GenomeInfo;
import com.vadeen.neat.gui.stats.info.SpeciesInfo;
import com.vadeen.neat.species.Species;
import java.util.ArrayList;
import java.util.List;
/**
* Gathers info about generations over time.
*/
public class NeatStats {
/**
* Species stats over time.
*/
public List> speciesOverTime = new ArrayList<>();
/**
* Best genome stats over time.
*/
public List bestGenomeOverTime = new ArrayList<>();
public void addGeneration(Generation g) {
addSpecies(g.getSpecies());
bestGenomeOverTime.add(GenomeInfo.of(g.getBestGenome()));
}
private void addSpecies(List species) {
List stats = new ArrayList<>();
for (Species s : species)
stats.add(SpeciesInfo.of(s));
speciesOverTime.add(stats);
}
public List> getSpeciesOverTime() {
return speciesOverTime;
}
public List getBestGenomeOverTime() {
return bestGenomeOverTime;
}
}