Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double RSSIwithError(bool v, double distance3D)
- {
- Ptr<NormalRandomVariable> m_norVar;
- m_norVar = CreateObject<NormalRandomVariable> ();
- m_norVar->SetAttribute ("Mean", DoubleValue (0));
- m_norVar->SetAttribute ("Variance", DoubleValue (3));
- double lossDbLOS, lossDbNLOS;
- lossDbLOS = 32.4 + 17.3 * log10 (distance3D) + 20 * log10 (30)+ m_norVar->GetValue();
- if(v==true)
- {
- m_norVar->SetAttribute ("Variance", DoubleValue (3));
- lossDbLOS = 32.4 + 17.3 * log10 (distance3D) + 20 * log10 (30)+ m_norVar->GetValue();
- return lossDbLOS;
- }
- else
- {
- m_norVar->SetAttribute ("Variance", DoubleValue (8.03));
- lossDbNLOS = 38.3 * log10 (distance3D) + 17.3 + 24.9 * log10 (30)+ m_norVar->GetValue();
- return std::max (lossDbLOS, lossDbNLOS);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement