Bug 1421

Summary: Frequency dependent propagation loss models need uniform Frequency / Lambda attribute
Product: ns-3 Reporter: Pavel Boyko <boyko>
Component: propagationAssignee: Pavel Boyko <boyko>
Status: RESOLVED FIXED    
Severity: normal CC: nicola, ns-bugs, tomh
Priority: P5    
Version: ns-3.13   
Hardware: All   
OS: All   
Attachments: replace Lambda with Frequency

Description Pavel Boyko 2012-05-02 08:41:30 UTC
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 UTC
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 UTC
(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 UTC
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 UTC
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 UTC
changeset:   2b69b173a877