diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2024-03-27 15:58:10 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2024-03-27 15:58:10 +0100 |
| commit | 480900c124ce227664ab7ae59561cb9f928efbda (patch) | |
| tree | a92b9ea29e8059a22fb4d16749af01b95082bbb8 | |
| parent | 66a1d58b9ebec13efdd12e93f04d59214d0502e8 (diff) | |
Minor changes
| -rw-r--r-- | results/pareto.R | 23 | ||||
| -rw-r--r-- | results/pareto.pdf | bin | 0 -> 91033 bytes |
2 files changed, 13 insertions, 10 deletions
diff --git a/results/pareto.R b/results/pareto.R index 9116bf4..7411e3b 100644 --- a/results/pareto.R +++ b/results/pareto.R @@ -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) diff --git a/results/pareto.pdf b/results/pareto.pdf Binary files differnew file mode 100644 index 0000000..1345c83 --- /dev/null +++ b/results/pareto.pdf |
