From e57012930792fd1bc987f1fcae92e9c9be3a82f9 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Fri, 7 Apr 2017 20:23:34 +0300 Subject: [PATCH] core: Check that CDF covers the whole distribution in EmpiricalRandomVariable::Validate --- src/core/model/random-variable-stream.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/model/random-variable-stream.cc b/src/core/model/random-variable-stream.cc index dca094d0c..ce1ff8417 100644 --- a/src/core/model/random-variable-stream.cc +++ b/src/core/model/random-variable-stream.cc @@ -1655,6 +1655,10 @@ void EmpiricalRandomVariable::Validate () } prior = current; } + if (prior.cdf != 1.0) + { + NS_FATAL_ERROR ("CDF does not cover the whole distribution"); + } m_validated = true; }