admin管理员组文章数量:1332873
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?
1 Answer
Reset to default 1You 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()
本文标签: Change parameters during runtime using handleParameterChange() in OMNetStack Overflow
版权声明:本文标题:Change parameters during runtime using handleParameterChange() in OMNet++ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742295827a2448704.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论