最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Change parameters during runtime using handleParameterChange() in OMNet++ - Stack Overflow

programmeradmin2浏览0评论

I am a beginner in OMNet++. I need to chnage my mobiliity parameter during runtime. I came across the handleParameterChange() in OMNet++ simulation Manual . I actually want to set the displayCommunicationRange parameter to true of a particular node.

cModule* cNode=getParentModule()->getSubmodule("wlan", 0)->getSubmodule("radio");  
cNode->par("displayCommunicationRange").setBoolValue(true);  

but this results that the parameter cannot be set during runtime. Can anyone give me steps to use handleParameterChange() to do this?

I am a beginner in OMNet++. I need to chnage my mobiliity parameter during runtime. I came across the handleParameterChange() in OMNet++ simulation Manual . I actually want to set the displayCommunicationRange parameter to true of a particular node.

cModule* cNode=getParentModule()->getSubmodule("wlan", 0)->getSubmodule("radio");  
cNode->par("displayCommunicationRange").setBoolValue(true);  

but this results that the parameter cannot be set during runtime. Can anyone give me steps to use handleParameterChange() to do this?

Share Improve this question edited Nov 25, 2024 at 7:57 Nishani Kasineshan asked Nov 22, 2024 at 5:14 Nishani KasineshanNishani Kasineshan 6828 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You have to add the @mutable property to the parameter to allow parameter changes. As this is display parameter that is not cached (i.e. it is always accessed by par() you don't have to implement anything in handleParameteChange()

发布评论

评论列表(0)

  1. 暂无评论