Skip to content

Commit

Permalink
Added a plot function for the performance tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew authored and Andrew committed Oct 23, 2016
1 parent 5b4e4cd commit f7c7eec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,NEATFormulaSimulation)
S3method(plot,NEATSimulation)
S3method(plot,rneatneuralnet)
export(NEATSimulation.GetStateHistoryForGenomeAndSpecies)
export(NEATSimulation.RunSingleGeneration)
Expand Down
4 changes: 4 additions & 0 deletions R/neat.R
Expand Up @@ -1037,6 +1037,10 @@ NEATSimulation.GetStateHistoryForGenomeAndSpecies <- function(simulation, genome

}

#' @export
plot.NEATSimulation <- function(simulation){
plotPerformanceTracker(simulation$PerformanceTracker)
}

plotPerformanceTracker <- function(data){
plot(x=data[,"generation"],y=data[,"maxFitness"],col="blue",main="Fitness",xlab="Generation",ylab="Fitness",type="o",ylim=c(0,max(data[,"maxFitness"])),lwd=2)
Expand Down

0 comments on commit f7c7eec

Please sign in to comment.