dear all
i'm trying to generate a random number which is an attribute for each node in the network using function GenerateRandomNumber() which is used on the constructor of the routing protocol to generate a random number and set the attribute uint32_t m_myRandomNo.
uint32_t
AeroRoutingProtocol :: GenerateRandomNumber ()
{
uint32_t rand = m_ipv4->GetObject<Node> ()->GetId ();
m_myRandomNo = UniformRandomVariable().GetInteger (rand,(rand+1000));
NS_LOG_FUNCTION (this << "the created random no is " << m_myRandomNo);
return m_myRandomNo;
}
i got this error during running a script
Program received signal SIGSEGV, Segmentation fault.
0xb5fc05ae in ns3::RngStream::RandU01 (this=0x0)
at ../src/core/model/rng-stream.cc:258
258 p1 = a12 * m_currentState[1] - a13n * m_currentState[0];
(gdb) backtrace
#0 0xb5fc05ae in ns3::RngStream::RandU01 (this=0x0)
at ../src/core/model/rng-stream.cc:258
#1 0xb5fadc1b in ns3::UniformRandomVariable::GetValue (this=0xbfffe320,
min=0, max=1001) at ../src/core/model/random-variable-stream.cc:164
#2 0xb5fadd4a in ns3::UniformRandomVariable::GetInteger (this=0xbfffe320,
min=0, max=1000) at ../src/core/model/random-variable-stream.cc:175
#3 0xb7b0eb98 in ns3::AeroRP::AeroRoutingProtocol::GenerateRandomNumber (
this=0x811fcb8) at ../src/aerorp/model/aerorp-routing-protocol.cc:1420
#4 0xb7b0e096 in ns3::AeroRP::AeroRoutingProtocol::AuthenticationIntialize (
this=0x811fcb8) at ../src/aerorp/model/aerorp-routing-protocol.cc:1337
#5 0xb7b08446 in ns3::AeroRP::AeroRoutingProtocol::Start (this=0x811fcb8)
at ../src/aerorp/model/aerorp-routing-protocol.cc:946
#6 0x08057930 in AeroRPSimulation::CaseRun (this=0xbfffe954, nWifis=60,
nSinks=1, nodeSpeed=1200, totalTime=1500, dataStart=100,
printRoutes=false, rate=..., CSVfileName=...)
at ../scratch/60nodetest.cc:350
#7 0x08056566 in main (argc=1, argv=0xbfffec84)
at ../scratch/60nodetest.cc:223
i have reviewed the documentation i didn't made something wrong (this is what i thought) that the function has a null pointer
thanks allot for help
--
Warmest regards and best wishes for a good health,urs sincerely
mero