Unknown Parameter in Module???!!!

234 views
Skip to first unread message

Wajdi

unread,
Jul 29, 2019, 5:41:47 AM7/29/19
to OMNeT++ Users

Hi,

I have migrated my old software from OMNET3.3 to 5.6.

It is error free syntax now, but I still get this running Error (while Initializing).

“unknown Parameter nodeAddress in module SetUpHandler (see attached fig)

I don't know what the issue is, since it is defined in the ini and ned files.

Here is my code:


void SetUpHandler::initialize() {


                //Pointer to the StatisticsCollector module to collect statistics

          cModule *module = this->getParentModule()->getParentModule()->getSubmodule("statistics");

          stats = check_and_cast<StatisticsCollector *>(module);


                //Get a pointer to the Topology module

          cModule *mod = this->getParentModule()->getParentModule()->getSubmodule("topology");

          topo = check_and_cast<Topology *>(mod);

 

          cMessage *smsg = new cMessage();

           this->scheduleAt(simTime().dbl(),smsg);

  }

void SetUpHandler::handleMessage(cMessage *msg) {

    delete msg;

       this->initializeIpTopology(LP);

       this->initializeIpTopology(HP);

 }

……

….

……

void SetUpHandler::initializeIpTopology(Priority priority){

    cModule *sourmod = this->getParentModule();

    volatile int sAddress = sourmod->par("nodeAddress"); //.longValue();

    volatile int dAddress;

    volatile int numOutFibers = sourmod->gateSize("outputFibers");

Par.jpg

Alfonso Ariza Quintana

unread,
Jul 29, 2019, 7:16:21 AM7/29/19
to omn...@googlegroups.com
The parent module doesn't have the  parameter nodeAddress.
It is possible to extract the node address using L3AddressResolver

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Wajdi <wajdi.a...@gmail.com>
Enviado: lunes, 29 de julio de 2019 11:41
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] Unknown Parameter in Module???!!!
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/549a20ed-54bf-4b1f-a0f9-eb6b9c7abc8d%40googlegroups.com.

Wajdi Al-Halabi

unread,
Jul 29, 2019, 9:14:37 AM7/29/19
to omn...@googlegroups.com

Thanks for your response, but….

Sorry, that does not help,

I do not use INET and do not have L3 Address,,

actually the node address in my network is defined in the NED and INI files,

 

(Node {
    parameters:
        volatile int nodeAddress;
        volatile double rposx;
        volatile double rposy; )

 

furthermore I can access this Par in other modules ( e.g. Topology Module) of my simulation, but not from the  SetUpHandler ..!!!

 

I hope you can help to solve this Prob.

 

thanks



_____________________
Dr. Eng. Wajdi Halabi, Assistant Prof.
Department of Information Technology and Computer Science
University College of Science & Technology (UCST)
Khanyounes, Gaza Strip, Palestine



Rouibah said

unread,
Jul 29, 2019, 9:20:19 AM7/29/19
to omn...@googlegroups.com
salam
The parent module doesn't have the  parameter nodeAddress. 
send me  the   SetUpHandler and network ned file

salam

Alfonso Ariza Quintana

unread,
Jul 29, 2019, 9:28:40 AM7/29/19
to omn...@googlegroups.com

I suspect tht the parent module is no the node, it is posible that you have other module between the SetUpHandler and the node

 

Enviado desde Correo para Windows 10

 


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Wajdi Al-Halabi <wajdi.a...@gmail.com>
Enviado: Monday, July 29, 2019 3:14:18 PM
Para: omn...@googlegroups.com <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] Unknown Parameter in Module???!!!
 

Wajdi Al-Halabi

unread,
Jul 29, 2019, 10:29:46 AM7/29/19
to omn...@googlegroups.com
Ok it is done..
PLZ. C attached files.

I hope U can help...

Salam, thank you


setup.cc
setup.h
gmplsRouter.ned

Rudolf Hornig

unread,
Jul 29, 2019, 11:46:58 AM7/29/19
to OMNeT++ Users
Your code is not failing because the parent module is does not have a nodeAddress, but rather because you later iterate over some other nodes in the network and some of those nodes are probably a type of Node (which has a COMMENTED out parameter called

for(int i=0; i<numNodes; i++){
  if(i!=sAddress){
    destmod = this->getParentModule()->getParentModule()->getSubmodule("node", i);
    dAddress = destmod->par("nodeAddress");
//.longValue(); 

NED:
simple Node{
  parameters:
  //volatile int nodeAddress;//: numeric const, //IP address of the node
  volatile double rposx;//: numeric const,
  volatile double rposy;//: numeric const,
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.

Wajdi Al-Halabi

unread,
Jul 30, 2019, 3:49:41 AM7/30/19
to omn...@googlegroups.com
Thanks for your response, but that did not help..

the problem can be that I did not migrate ( //destmod = sourmod->gate("outputFibers", i)->destinationGate()->fromGate()->ownerModule();)
from OMNET3.3 to 5.6 correctly
this row must return the detestation node at the other end of the phys. fiber Chanel

Regards

_____________________


To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/1c458799-5183-4454-8945-64272359452f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages