I'm completely confused by random-variable-stream.h. I'm trying to print out the value of "OffTime" by the below code:
Ptr<ExponentialRandomVariable> x = CreateObject<ExponentialRandomVariable> ();
x->SetAttribute ("Mean", DoubleValue (0.1));
std::stringstream value ;
value <<"ns3::ConstantRandomVariable[Constant=" << x->GetValue ()<<"]";
onoff.SetAttribute("OffTime",StringValue(value.str()));
NS_LOG_UNCOND("off time:" << value.str());
NS_LOG_UNCOND("off time:" << x->GetValue());
But the print gives me 2 different values, while I have used the same value of "x" in "value". My output is this:
off time:ns3::ConstantRandomVariable[Constant=0.0422695]
off time:0.338839
Please help :(