inet
inet copied to clipboard
BitErrorRate filter sending very small value to cHistogram result recorder causing crash
The error thrown by the cHistogram is recorded here: https://github.com/omnetpp/omnetpp/issues/863
However, a workaround is to limit the minimum value of the result filter in ResultFilters.cc with the following:
void BitErrorRateFromErrorRateIndFilter::receiveSignal(cResultFilter *prev, simtime_t_cref t, cObject *object, cObject *details)
{
if (auto pk = dynamic_cast<Packet *>(object)) {
auto tag = pk->findTag<ErrorRateInd>();
if (tag){
const double ber = tag->getBitErrorRate();
fire(this, t, (ber<2e-320)?0.0:ber, details); //TODO isNaN?
}
}
}
The value was being generated by a Ieee802154Radio with modulation QPSK, calling BpskModulation::calculateSER(snir = 2.6374, bandwidth = 2.8e6, bitrate=10e3) = 2e-323
I think this should be fixed in omnet, otherwise we end up with this condition all over the place. I leave this open until it gets fixed there.
I agree, this is very much a workaround of the actual bug, which is only triggered in very speific circumstances!
The related omnet bug has been closed, so I close this issue now.