Bugzilla – Full Text Bug Listing |
Summary: | eliminate random variation in trace-based tests | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
Component: | test framework | Assignee: | Tom Henderson <tomh> |
Status: | NEW --- | ||
Severity: | normal | CC: | ns-bugs |
Priority: | P5 | ||
Version: | pre-release | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | patch to fix aodv |
Description
Tom Henderson
2012-08-26 14:29:08 EDT
> 1) definition of a static random variable (which will perturb the stream
> assignment of all non-static instances) in some file does not change the pcap
> output
>
> e.g. in some implementation file compiled into ns-3, temporarily add
>
> static Ptr<NormalRandomVariable> testStaticVariable =
> CreateObject<NormalRandomVariable> ();
>
> and make sure all tests still pass
to clarify a bit further, I am not suggesting to add this variable permanently to ns-3-dev, but rather that the tests are fixed such that temporary insertion of this variable does not perturb traces.
This bug is a little harder than it looks because many temporary random variable stream variables are constructed and destructed with stream = -1 and config-store does not show streams associated with attributes. (In reply to comment #2) > This bug is a little harder than it looks because many temporary random > variable stream variables are constructed and destructed with stream = -1 and > config-store does not show streams associated with attributes. Does config-store save not show the eventual stream assignment? I would expect it to. Here are a couple random variable streams from the config-store output file: default ns3::RandomRectanglePositionAllocator::X "ns3::UniformRandomVariable[Min=0.0|Max=1.0]" default ns3::RandomRectanglePositionAllocator::Y "ns3::UniformRandomVariable[Min=0.0|Max=1.0]" No stream is shown. Created attachment 1446 [details]
patch to fix aodv
This patch fixes AODV; the random variable was being used before SetStream could be called.
While this makes the test traces fixed with respect to other random variables in the system, it does not permit the test cases to be shuffled in order, since new Mac48Address will be allocated (a Mac48Address::Reset() method would help in this regard).
The mesh tests still need to be fixed, probably along the same lines (check that random variables are not used before their streams are fixed.
|