mirror of
https://gitlab.com/manzerbredes/loosely-coupled-dss-extended.git
synced 2025-06-26 23:37:41 +00:00
Improve data analysis
This commit is contained in:
parent
84d9ce59ae
commit
0a125c3661
32 changed files with 205278 additions and 38517 deletions
45
results/scheduler/wakeup.R
Normal file
45
results/scheduler/wakeup.R
Normal file
|
@ -0,0 +1,45 @@
|
|||
library("tidyverse")
|
||||
library("gridExtra")
|
||||
|
||||
pdf(NULL)
|
||||
|
||||
# Load data
|
||||
data=read_csv("wakeup.csv")
|
||||
yorder=str_sort(unique(data$node),numeric=TRUE)
|
||||
data=data%>%mutate(node=factor(node,levels=yorder))
|
||||
|
||||
# Load hint
|
||||
hint=read_csv("hint.csv")
|
||||
|
||||
# Load hint forward
|
||||
hint_fw=read_csv("hint_fw.csv")
|
||||
|
||||
# Load data
|
||||
data_rcv=read_csv("data.csv")
|
||||
|
||||
|
||||
# Configure axis
|
||||
ts_range=seq(0, 24)*3600
|
||||
ts_labels=ts_range/3600
|
||||
|
||||
# Plot
|
||||
p1=ggplot(data,aes(x=wakets,y=node))+
|
||||
geom_hline(aes(yintercept=node),color="grey",size=3)+
|
||||
geom_vline(data=hint,aes(xintercept=wakets,color="Hint slots"),show.legend = FALSE,linetype="longdash",size=0.3)+
|
||||
geom_linerange(aes(xmin=wakets,xmax=sleepts),size=10)+
|
||||
geom_linerange(data=hint,aes(xmin=wakets,xmax=wakets+duration,color="Hint slots"),size=10)+
|
||||
geom_point(data=data_rcv,aes(x=ts,color="Data received"),shape=18,size=4)+
|
||||
geom_point(data=hint,aes(x=rcvat,color="Hint received"),shape=18,size=3)+
|
||||
geom_point(data=hint_fw,aes(x=ts,color="Hint Forwarded"),shape=18,size=2)+
|
||||
xlab("Time (hours)")+ylab("Node")+
|
||||
scale_x_continuous(breaks = ts_range, labels=ts_labels)+
|
||||
scale_colour_manual(name="Legend",values=c("Hint slots"="blue","Data received"="red","Hint received"="green","Hint Forwarded"="purple"))+
|
||||
theme(panel.grid.major.x = element_line(size = 1.2),panel.grid.major.y = element_blank(),panel.grid.minor = element_blank())
|
||||
|
||||
stats=data%>%group_by(node)%>%summarise(n=n())%>%mutate(n=n-24)
|
||||
|
||||
p2=ggplot(stats,aes(x=node,y=n))+
|
||||
geom_bar(stat="identity")+xlab("Node")+ylab("Extra wake up count")
|
||||
|
||||
p=grid.arrange(p1,p2,heights=c(10,5))
|
||||
ggsave(plot=p,"schedule.png",dpi=300,width = 10,height=10)
|
Loading…
Add table
Add a link
Reference in a new issue