mirror of
https://gitlab.com/manzerbredes/loosely-coupled-dss-extended.git
synced 2025-04-05 19:16:26 +02:00
Minor changes
This commit is contained in:
parent
66a1d58b9e
commit
480900c124
2 changed files with 13 additions and 10 deletions
|
@ -3,6 +3,7 @@ library("gridExtra")
|
|||
library("patchwork")
|
||||
library("knitr")
|
||||
library(RColorBrewer)
|
||||
library(latex2exp)
|
||||
|
||||
r_=function(x){round(x,digits=2)}
|
||||
color=function(){scale_fill_brewer(palette = "Accent")}
|
||||
|
@ -19,7 +20,7 @@ simkey_rename=function(key){
|
|||
if(key=="extended")
|
||||
return("Extended")
|
||||
if(key=="hintandextended")
|
||||
return("Hints+Extended")
|
||||
return("Hints+\nExtended")
|
||||
return(key)
|
||||
}
|
||||
dformat=function(data){
|
||||
|
@ -66,13 +67,12 @@ return(rbind(total60%>%mutate(wakeupfor=60),total180%>%mutate(wakeupfor=180)))
|
|||
}
|
||||
|
||||
# Load stats
|
||||
#stats_sor=build_stats("logs/sor_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="sor")
|
||||
#stats_uor=build_stats("logs/uor_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="uor")
|
||||
#stats_fh=build_stats("logs/farhint_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="farhint")
|
||||
#stats=rbind(stats_sor,stats_uor,stats_fh)
|
||||
stats_sor=build_stats("logs/sor_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="Shutdown on\nreceive")
|
||||
stats_uor=build_stats("logs/uor_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="Unschedule on\nreceive")
|
||||
stats_fh=build_stats("logs/farhint_results/results.csv")%>%filter(type=="Sender")%>%mutate(strategy="Far hint")
|
||||
stats=rbind(stats_sor,stats_uor,stats_fh)%>%filter(wireless=="nbiot",wakeupfor==60) # Change filter as you which (which plot you want down bellow)
|
||||
|
||||
|
||||
if(FALSE){
|
||||
pareto=tibble()
|
||||
stats%>%ungroup()%>%group_by(wakeupfor,wireless)%>%group_walk(function(data, t){
|
||||
for(i in 1:NROW(data)){
|
||||
|
@ -87,13 +87,16 @@ for(i in 1:NROW(data)){
|
|||
pareto<<-rbind(pareto,cbind(pt,t))
|
||||
}
|
||||
}})
|
||||
#colnames(pareto) <- c("energy","success","type")
|
||||
pareto = pareto %>% mutate(energy = as.numeric(energy))
|
||||
pareto = pareto %>% mutate(success = as.numeric(success))
|
||||
pareto = pareto %>% arrange(energy,success)
|
||||
}
|
||||
ggplot(stats,aes(energy,success,color=simkey,shape=strategy))+
|
||||
pareto = pareto %>%dformat()
|
||||
|
||||
ggplot(stats%>%dformat(),aes(energy,success,color=simkey,shape=strategy))+
|
||||
geom_line(data=pareto,aes(energy,success),linetype="dashed", size=1,inherit.aes=FALSE)+
|
||||
geom_point(alpha=0.1,size=4)+
|
||||
geom_point(data=pareto,size=4)+scale_y_reverse()+
|
||||
facet_wrap(~wakeupfor+wireless,scale="free")+xlab("Sender energy consumption (J)")+ylab("#Delivery success")
|
||||
labs(color="Policies:",shape="Strategies:")+scale_color_brewer(palette = "Spectral")+theme_minimal()+theme(legend.position="top")+
|
||||
xlab("Sender energy consumption (J)")+ylab(TeX(r'(#Succ$_p$)'))
|
||||
# +facet_wrap(~wakeupfor+wireless,scale="free")
|
||||
ggsave("pareto.pdf",width=9,height=9)
|
||||
|
|
BIN
results/pareto.pdf
Normal file
BIN
results/pareto.pdf
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue