aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-05-20 09:48:32 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-05-20 09:48:32 +0200
commit738f22d12f3648fceaec2dd1982224e45e4a246d (patch)
treeb7abce1896c65a1abca6c4afeb1caa5bf76f35e3 /src
parentf7c6f8ad56a645a09a5a22010f86ca7a81d85635 (diff)
Tests
Diffstat (limited to 'src')
-rw-r--r--src/simulator.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/simulator.cc b/src/simulator.cc
index 76bb0fb..fd123d8 100644
--- a/src/simulator.cc
+++ b/src/simulator.cc
@@ -125,6 +125,7 @@ static void obs_node(std::vector<std::string> args) {
u32 nSendFail=0;
u32 nRcvFail=0;
u32 nSend=0;
+ u32 hint_added=0;
double totalUptime=0;
Payload *hint_forward=NULL;
while(i.ShouldContinue()){
@@ -210,6 +211,7 @@ static void obs_node(std::vector<std::string> args) {
if(CLOCK < p->hint){
i.AddEvent(p->hint, p->duration);
hint_forward=new Payload(*p);
+ hint_added++;
}
}
}
@@ -237,8 +239,10 @@ static void obs_node(std::vector<std::string> args) {
}catch(...){
XBT_INFO("%s could not receive any data",CNAME);
nRcvFail++;
- if(hintReceived)
+ if(hintReceived){
i.AddEvent(hint->hint, hint->duration); // Add the hint to the event list
+ hint_added++;
+ }
}
}
forward_mode=!forward_mode; // Toggle mode (go back and forth between receiving and forwarding)
@@ -262,5 +266,5 @@ static void obs_node(std::vector<std::string> args) {
}
// Done
MODE_OFF()
- XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|isSender:%d|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|totalUptime:%f|seed:%d)",CNAME,CNAME,i.is_sender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed);
+ XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|isSender:%d|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|totalUptime:%f|seed:%d|hint_added:%d)",CNAME,CNAME,i.is_sender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed,hint_added);
} \ No newline at end of file