Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. double RSSIwithError(bool v, double distance3D)
  2. {
  3. Ptr<NormalRandomVariable> m_norVar;
  4. m_norVar = CreateObject<NormalRandomVariable> ();
  5. m_norVar->SetAttribute ("Mean", DoubleValue (0));
  6. m_norVar->SetAttribute ("Variance", DoubleValue (3));
  7. double lossDbLOS, lossDbNLOS;
  8.  
  9. lossDbLOS = 32.4 + 17.3 * log10 (distance3D) + 20 * log10 (30)+ m_norVar->GetValue();
  10.  
  11. if(v==true)
  12. {
  13. m_norVar->SetAttribute ("Variance", DoubleValue (3));
  14. lossDbLOS = 32.4 + 17.3 * log10 (distance3D) + 20 * log10 (30)+ m_norVar->GetValue();
  15. return lossDbLOS;
  16.  
  17. }
  18. else
  19. {
  20. m_norVar->SetAttribute ("Variance", DoubleValue (8.03));
  21. lossDbNLOS = 38.3 * log10 (distance3D) + 17.3 + 24.9 * log10 (30)+ m_norVar->GetValue();
  22. return std::max (lossDbLOS, lossDbNLOS);
  23.  
  24. }
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement