diff --git a/00_data/solution.Rdata b/00_data/solution.Rdata new file mode 100644 index 0000000000000000000000000000000000000000..e66150558d1efd930aae84a93711204725614a0f Binary files /dev/null and b/00_data/solution.Rdata differ diff --git a/01_code/240108_JB_path_evaluation.R b/01_code/240108_JB_path_evaluation.R new file mode 100644 index 0000000000000000000000000000000000000000..4754449465fef6945d88bf2ce0c73c8d219a81cc --- /dev/null +++ b/01_code/240108_JB_path_evaluation.R @@ -0,0 +1,54 @@ +rm(list=ls()) + +library("data.table") + +thedata <- read.csv(file="00_data/point_cloud.csv") + +# file for result +# Oakman +# solution <- read.csv("2023_submissions/Oakman/oakman_path.txt") +# opt.path <- solution$Path + +# Zellmer +# solution <- read.csv("2023_submissions/Zellmer/optimizedPath.csv") +# opt.path <- solution$Path + +# Bleher +# load(file="00_data/solution.Rdata") +# opt.path <- result + +# Müller +# solution <- read.csv("2023_submissions/Mueller/solution_path_Peter_Mueller.csv") +# opt.path <- solution$Path + +# Puke +#puke <- readRDS(file="2023_submissions/Puke/ordered.rds") +#opt.path <- puke$ID + +# Müller +solution <- read.csv("2023_submissions/Quinger/submission_file.csv") +opt.path <- solution$path + +# Check validity of result +# which(!(thedata$ID %in% opt.path)) +# opt.path[1] == 1 +# opt.path[length(opt.path)] == 1 + + +#Calculate distance +opt.path.dt <- data.table(opt.path=opt.path,lead.opt.path = shift(opt.path,-1)) +setDT(thedata) +opt.path.dt <- merge(opt.path.dt,thedata,by.y="ID",by.x="opt.path",suffixes=c("","_0")) +opt.path.dt <- merge(opt.path.dt,thedata,by.y="ID",by.x="lead.opt.path",suffixes=c("","_1")) +opt.path.dt[,distance:=sqrt((x_1-x)^2+(y_1-y)^2)] +sum(opt.path.dt$distance) + +# Puke: 386217.7 +# Quinger: 416693.5 +# Oakman: 424498.7 +# Zellmer: 424498.7 +# Bleher: 424498.7 +# Müller: 529287.5 + +plot(thedata[,c("x","y")],pch=16,cex=0.1) +lines(thedata[opt.path[which(opt.path!=0)],c("x","y")],col="red")