omnet++ - Calculating end-to-end delay for SimpleServerApp in Veins-LTE -
i'm trying calculate end-to-end delay simpleserverapp in veins-lte , i'm unable results, when open result file statistics related delay 0 or nan.
i looked in tic-toc tutorial , tried that, way didn't statistics:
on module:
delayvector.record(delay); delayhist.collect(delay);
and when calling finish():
delayhist.recordas("delayfinish");
where
simtime_t delay; coutvector delayvector; clonghistogram delayhist;
then tried copy procedure other statistic recording, think can't used in case, because want send long:
on ned file:
@signal[delay](type="long"); @statistic[delay](title="delay"; source="delay"; record=vector, stats, histogram);
on module:
emit(delay,delay); //where first delay signal , second one, value.
that's calculate delay:
on sending module:
msg->setsendingtime();
on receiving module:
simtime_t delay = simtime() - msg->getsendingtime();
i'd appreciate help!
since version 4.1
omnet++ introduced concept of statistics/metrics collection , recording using signal mechanisms.
in brief signal mechanism works follows: given value attached (built-in object of type) signal , information recorded output files (either scalars or vectors) later on can analysed in order infer behaviour.
if don't understand how mechanisms work please make sure first read following sections of omnet++ manual:
once wrap head around concepts feel more comfortable want in terms of output results.
as far question concerned if want use signalling mechanisms in simpleserverapp
first have declare signals , corresponding statistic in .ned
file:
@signal[nameofsignal](type="sameastypeofvariable"); @statistic[nameofstatistic](title="nametoappearintheoutputfile"; source="nameofthesourceofthisstatistic"; record=typeofstat1, typeofstat2, typeofstat2);
then need declare signal variable in .h
:
simsignal_t nameofmetricsignal;
then register signal in initialize()
in .cc
same name used in .ned
signal:
nameofmetricsignal = registersignal("nameofsignal");
lastly have emit()
signal. is, attach value signal , let recoreded. location want depends on implementation.
emit(nameofmetricsignal, thevariabletobeattached);
for like:
ned:
@signal[delay](type="float");
@statistic[delay](title="delay"; source="delay"; record=mean, sum, stats, vector);
.h
simsignal_t delaysignal;
.cc
delaysignal = registersignal("delay");
.cc
emit(delaysignal, delay);
if getting 0
or nan
due division wrong number, wrong type of signal compared type of variable. make sure vector , scalar recording in not turned off (false
) in omnetpp.ini
Comments
Post a Comment