From a85db5cca2b241736bccd5dbb1085c6a9bfb70c6 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 14 Nov 2022 16:25:46 +0100 Subject: Update --- analysis/analysis.R | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'analysis/analysis.R') diff --git a/analysis/analysis.R b/analysis/analysis.R index f38a1a3..110549f 100644 --- a/analysis/analysis.R +++ b/analysis/analysis.R @@ -30,6 +30,13 @@ data_seed=data%>%group_by(simkey,wireless,wakeupfor,seed)%>%summarize(energy=sum mutate(efficiency=energy/coverage)%>% ungroup() +## Load simulation results +sim=read_csv("../simulations/results/results.csv") +data_sim=sim%>%group_by(simkey,wireless,wakeupfor,seed)%>%summarize(energy=sum(energy),coverage=sum(nDataRcv))%>% + mutate(efficiency=energy/coverage)%>% + ungroup() + + ## Perform various plots to understand the data GG_VARIOUS=function(){ ## Dimension Coverage @@ -66,8 +73,18 @@ GG_VARIOUS=function(){ } ## Plot to generate: -GG_VARIOUS() +#GG_VARIOUS() + + +GG_SIMULATIONS = function() { + ## Dimension Energy + ggplot(sim%>%mutate(wakeupfor=as.character(wakeupfor)), + aes(simkey,energy,color=model))+geom_point()+facet_wrap(~wireless+wakeupfor)+ggtitle("Simulation Dimension Energy")+ylab("Energy Consumption (J)") + ggsave("figures/sim_dimension_energy.pdf") + +} +GG_SIMULATIONS() system("rm -f figures/combined.pdf") system("pdfunite figures/*.pdf figures/combined.pdf") -- cgit v1.2.3