Anonymous | Login | 2022-06-26 06:09 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000693 | OMNeT++ | simulation kernel | public | 2013-12-08 19:38 | 2013-12-09 10:30 | ||||
Reporter | woife | ||||||||
Assigned To | andras | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 4.3.1 | ||||||||
Target Version | Fixed in Version | 4.4 | |||||||
Summary | 0000693: truncnormal can return negative values | ||||||||
Description | The documentation for the function truncnormal states the following: "Normal distribution truncated to nonnegative values." [1] There is a SimTime-version of truncnormal, and this version can return negative values: -----------[ Code in OMNeT/include/distrib.h ------------------------------ /** * Normal distribution truncated to nonnegative values. * It is implemented with a loop that discards negative values until * a nonnegative one comes. This means that the execution time is not bounded: * a large negative mean with much smaller stddev is likely to result * in a large number of iterations. * * The mean and stddev parameters serve as parameters to the normal * distribution before truncation. The actual random variate returned * will have a different mean and standard deviation. * * @param mean mean of the normal distribution * @param stddev standard deviation of the normal distribution * @param rng the underlying random number generator */ SIM_API double truncnormal(double mean, double stddev, int rng=0); /** * SimTime version of truncnormal(double,double,int), for convenience. */ inline SimTime truncnormal(SimTime mean, SimTime stddev, int rng=0) {return normal(mean.dbl(), stddev.dbl(), rng);} ------------------------------------------------------------------ The problem here is that the SimTime-version internally does not call truncnormal(), but the standard normal() function. [1] http://www.omnetpp.org/doc/omnetpp/api/group__RandomNumbersCont.html#ge59607f50d297c0f8ce72b833c343c50 [^] | ||||||||
Additional Information | I don't know OMNeT well enough for the 'Category' where this bug fits, so I have chosen 'simulation kernel'. Please adjust as appropriate. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
![]() |
|
(0000858) andras (administrator) 2013-12-09 10:30 |
Thanks for the report, came just in time to be included in OMNeT++ 4.4. It was a copy-paste bug, fixed. |
![]() |
|||
Date Modified | Username | Field | Change |
2013-12-08 19:38 | woife | New Issue | |
2013-12-09 10:30 | andras | Note Added: 0000858 | |
2013-12-09 10:30 | andras | Status | new => resolved |
2013-12-09 10:30 | andras | Fixed in Version | => 4.4 |
2013-12-09 10:30 | andras | Resolution | open => fixed |
2013-12-09 10:30 | andras | Assigned To | => andras |
Copyright © 2000 - 2022 MantisBT Team |