LteHelper::InstallSingleEnbDevice's use of ObjectFactory for some objects but not all

22 views
Skip to first unread message

Peter Danielsen

unread,
Oct 18, 2016, 4:28:46 PM10/18/16
to ns-3-users
Hi,

I'm looking at the code for LteHelper::InstallSingleEnbDevice and see that some objects are created with hard-coded types, such as
  Ptr<LteEnbMac> mac = CreateObject<LteEnbMac> ();
 while others use an ObjectFactory, such as
  Ptr<FfMacScheduler> sched = m_schedulerFactory.Create<FfMacScheduler> ();

What's the philosophy for using the former method for creating the layers (PHY, MAC, RRC) instead of an ObjectFactory, which would allow experimentation with alternate implementations?  I have the same question for UeManager's creation of the PDCP and RLC layers.

Thanks,

Peter

Tommaso Pecorella

unread,
Oct 20, 2016, 5:32:14 PM10/20/16
to ns-3-users
Hi,

I can only guess that it's an implementation choice. Perhaps the coder didn't foresee the need to use a factory, or he/she decided that the change could be done in the future.
After all, to use a different layer implementation, usually you need much more than "just" a factory, you need also an abstraction layer.

Cheers,

T.

Peter Danielsen

unread,
Oct 21, 2016, 10:57:46 AM10/21/16
to ns-3-users
Thanks for the reply.

Is there a recommended way to experiment with different layer implementations?   Two that come to mind are
  1. Create a new class to use instead of LteHelper.  It would probably mostly be the same as LteHelper, but instantiating the alternative layer implementations.
  2. Do not use LteHelper and effectively inline its code instead, but with the alternative layer implementations.
Both alternatives unfortunately involve code duplication.

I would have thought that the factory approach in LteHelper would suffice due to standardized layer APIs (as is done for scheduler selection)?

Peter

Tommaso Pecorella

unread,
Oct 22, 2016, 11:43:58 AM10/22/16
to ns-3-users
Hi,

you forgot option 3:
- modify LteHelper to fit your needs.

T.
Reply all
Reply to author
Forward
0 new messages