EnumValue with Python Bindings

36 views
Skip to first unread message

Shyam Parekh

unread,
Jun 21, 2023, 2:47:13 AM6/21/23
to ns-3-users
I'm trying to translate the following c++ statement into python.

Config::SetDefault("ns3::LteAmc::AmcModel", EnumValue(LteAmc::PiroEW2010));

In particular, I'm not sure how to translateEnumValue(LteAmc::PiroEW2010).

The following seems to run without any error.

ns.core.Config.SetDefault("ns3::LteAmc::AmcModel", ns.core.EnumValue(ns.LteAmc. PiroEW2010))

Is it the correct way?

Thanks,

Shyam

Gabriel Ferreira

unread,
Jun 21, 2023, 2:57:39 PM6/21/23
to ns-3-users
Yes Shyam, all ns-3 types in Python should be prefixed with 'ns.'

Shyam Parekh

unread,
Jun 21, 2023, 3:49:46 PM6/21/23
to ns-3-users
Thank you Gabriel! Besides ns prefix, I wasn't sure if LteAmc::PiroEW2010 should be translated as LteAmc.PiroEW2010.

Shyam
Message has been deleted

Shyam Parekh

unread,
Jun 21, 2023, 4:09:56 PM6/21/23
to ns-3-users
I meant to say the following in the previous message:

Besides using ns.core.EnumValue, I also wasn't sure if I should translate LteAmc::PiroEW2010 as ns.LteAmc.PiroEW2010.

Thanks,

Shyam

Shyam Parekh

unread,
Jun 21, 2023, 4:11:07 PM6/21/23
to ns-3-users
I meant to say the following in the previous message:

Besides using ns.core.EnumValue, I also wasn't sure if I should translate LteAmc::PiroEW2010 as ns.LteAmc.PiroEW2010.

Thanks,

Shyam


On Wednesday, June 21, 2023 at 11:57:39 AM UTC-7 Gabriel Ferreira wrote:
Reply all
Reply to author
Forward
0 new messages