Bug 1421 - Frequency dependent propagation loss models need uniform Frequency / Lambda attribute
Frequency dependent propagation loss models need uniform Frequency / Lambda a...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: propagation
ns-3.13
All All
: P5 normal
Assigned To: Pavel Boyko
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-02 08:41 EDT by Pavel Boyko
Modified: 2013-05-07 13:04 EDT (History)
3 users (show)

See Also:


Attachments
replace Lambda with Frequency (10.04 KB, patch)
2013-05-06 11:14 EDT, Nicola Baldo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Boyko 2012-05-02 08:41:30 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.
Comment 1 Nicola Baldo 2012-05-03 10:05:38 EDT
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.
Comment 2 Tom Henderson 2012-05-04 15:44:07 EDT
(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.
Comment 3 Nicola Baldo 2013-05-06 11:14:51 EDT
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?
Comment 4 Pavel Boyko 2013-05-07 08:44:05 EDT
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?
Comment 5 Nicola Baldo 2013-05-07 13:04:45 EDT
changeset:   2b69b173a877