Bugzilla – Bug 1421
Frequency dependent propagation loss models need uniform Frequency / Lambda attribute
Last modified: 2013-05-07 13:04:45 EDT
Currently some models use Frequency, some use Lambda, some use both. The best way seems to support both attributes (Frequency in Hz and Lambda in meters) defining proper setters / getters which keep both values syncronized. Another question is a "correct" default value for frequency / lambda. I'd suggest to have an invalid default (say, 0 Hz) to be sure that user does care to set a valid value.
I think that supporting both attributes has the problem that the user can break the synchronization between the values by changing only one default value with Config::SetDefault or from the command line. To avoid this problem, my proposal is to support the Frequency attribute, which is more user-friendly, and drop the Lambda attribute.
(In reply to comment #1) > I think that supporting both attributes has the problem that the user can break > the synchronization between the values by changing only one default value with > Config::SetDefault or from the command line. > > To avoid this problem, my proposal is to support the Frequency attribute, which > is more user-friendly, and drop the Lambda attribute. I believe that order of attribute initialization is not guaranteed. I would opt for Nicola's suggestion as well.
Created attachment 1592 [details] replace Lambda with Frequency Here is a patch that modifies Friis and TwoRayGround replacing the Lambda attribute with the Frequency attribute, and the Set/GetLambda methods with Set/GetFrequency methods. I've also changed the test vectors to use frequency values that correspond to the previously used wavelength values. The patch is against ns-3-dev b24738ffa84b. All tests pass. I think we could push it for ns-3.17. Any comment on this?
Hi Nicola, I reviewed the patch, please push and close the bug. Thank you. Best regards, Pavel (In reply to comment #3) > Created attachment 1592 [details] > replace Lambda with Frequency > > Here is a patch that modifies Friis and TwoRayGround replacing the Lambda > attribute with the Frequency attribute, and the Set/GetLambda methods with > Set/GetFrequency methods. I've also changed the test vectors to use frequency > values that correspond to the previously used wavelength values. > > The patch is against ns-3-dev b24738ffa84b. All tests pass. I think we could > push it for ns-3.17. Any comment on this?
changeset: 2b69b173a877