Carregar dados
setwd("~/Downloads/data")
ebp.firstrobot <- read.csv("intra_backpropagation-myfirstrobot.csv", header = FALSE)
colnames(ebp.firstrobot) <- c("turno", "erro")
ebp.spinbot <- read.csv("intra_backpropagation-spinbot.csv", header = FALSE)
colnames(ebp.spinbot) <- c("turno", "erro")
ebp.walls <- read.csv("intra_backpropagation-walls.csv", header = FALSE)
colnames(ebp.walls) <- c("turno", "erro")
stats.firstrobot <- read.csv("stats-myfirstrobot.csv", header = FALSE)
colnames(stats.firstrobot) <- c("round", "n_turnos", "venceu", "percentual_acerto_tiro")
stats.spinbot <- read.csv("stats-spinbot.csv", header = FALSE)
colnames(stats.spinbot) <- c("round", "n_turnos", "venceu", "percentual_acerto_tiro")
stats.walls <- read.csv("stats-walls.csv", header = FALSE)
colnames(stats.walls) <- c("round", "n_turnos", "venceu", "percentual_acerto_tiro")
Analise por round
library(ggplot2)
library(grid)
# setwd('~/Downloads/robocode_artigo/images')
# pdf(file='percentual_tiro.pdf', height=14, width=8.5)
a <- ggplot(stats.firstrobot, aes(x = round, y = percentual_acerto_tiro)) +
geom_line() + labs(title = "FirstRobot")
b <- ggplot(stats.spinbot, aes(x = round, y = percentual_acerto_tiro)) + geom_line() +
labs(title = "SpinBot")
c <- ggplot(stats.walls, aes(x = round, y = percentual_acerto_tiro)) + geom_line() +
labs(title = "Walls")
grid.newpage()
pushViewport(viewport(layout = grid.layout(3, 1)))
print(a, vp = viewport(layout.pos.row = 1, layout.pos.col = 1), main = "Percentual de Acerto de Tiro por Round")
print(b, vp = viewport(layout.pos.row = 2, layout.pos.col = 1))
print(c, vp = viewport(layout.pos.row = 3, layout.pos.col = 1))
# dev.off()
# setwd('~/Downloads/robocode_artigo/images')
# pdf(file='partidas_vencidas.pdf', height=14, width=8.5)
a <- ggplot(stats.firstrobot, aes(x = round, y = venceu)) + geom_line() + labs(title = "FirstRobot")
b <- ggplot(stats.spinbot, aes(x = round, y = venceu)) + geom_line() + labs(title = "SpinBot")
c <- ggplot(stats.walls, aes(x = round, y = venceu)) + geom_line() + labs(title = "Walls")
grid.newpage()
pushViewport(viewport(layout = grid.layout(3, 1)))
print(a, vp = viewport(layout.pos.row = 1, layout.pos.col = 1), main = "Partidas Vencidas e Perdidas por Round")
print(b, vp = viewport(layout.pos.row = 2, layout.pos.col = 1))
print(c, vp = viewport(layout.pos.row = 3, layout.pos.col = 1))
# dev.off()
Analise por turno
# setwd('~/Downloads/robocode_artigo/images')
# pdf(file='analise_turno.pdf', height=14, width=8.5)
a1 <- ggplot(ebp.firstrobot, aes(x = turno, y = erro)) + geom_line() + labs(title = "FirstRobot")
a2 <- ggplot(ebp.firstrobot, aes(x = turno, y = log(erro))) + geom_line() +
labs(title = "FirstRobot")
b1 <- ggplot(ebp.spinbot, aes(x = turno, y = erro)) + geom_line() + labs(title = "SpinBot")
b2 <- ggplot(ebp.spinbot, aes(x = turno, y = log(erro))) + geom_line() + labs(title = "SpinBot")
c1 <- ggplot(ebp.walls, aes(x = turno, y = erro)) + geom_line() + labs(title = "Walls")
c2 <- ggplot(ebp.walls, aes(x = turno, y = log(erro))) + geom_line() + labs(title = "Walls")
grid.newpage()
pushViewport(viewport(layout = grid.layout(3, 2)))
print(a1, vp = viewport(layout.pos.row = 1, layout.pos.col = 1), main = "Erro de Predição por Turno")
print(a2, vp = viewport(layout.pos.row = 1, layout.pos.col = 2))
print(b1, vp = viewport(layout.pos.row = 2, layout.pos.col = 1))
print(b2, vp = viewport(layout.pos.row = 2, layout.pos.col = 2))
print(c1, vp = viewport(layout.pos.row = 3, layout.pos.col = 1))
print(c2, vp = viewport(layout.pos.row = 3, layout.pos.col = 2))
# dev.off()