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()