error: setting the parameters values in .cc file instead of .ned

13 views
Skip to first unread message

SHanan

unread,
Feb 15, 2018, 1:52:28 PM2/15/18
to OMNeT++ Users
Hello, 

I am using routing -- builder code , to build network using text file. I created Dynamic.cc file : because I will use it later to pass requests .. etc .    

what I want is to set the values of nodesFile  / connectionsFile in Dynamic.cc file. But my code is not working: when I run the code -> he prompt a msessage "unassigned parameter" and ask me to enter the values !!

Dynamic.ned


package networks;

import VNFs.Firewall;
import VNFs.Router;
import VNFs.WebApp;
import builder.NetBuilder;

network Dynamic
{
    @class(Dynamic);
    string sfcNodes ;
    string sfcConnections ;
    submodules:
        builder: NetBuilder {
            nodesFile = sfcNodes;
            connectionsFile = sfcConnections;
        }
}



and the simple module (Netbuilder.ned ):
package builder;

//
// Dynamically sets up a network, with the topology coming from text files
//
simple NetBuilder
{
    parameters:
        @display("i=block/cogwheel_s");
        string nodesFile;
        string connectionsFile;
}


Dynamic.cc
void Dynamic::initialize(){
std::string nodes =getParentModule()->par("nodesFile").stdstringValue();
   std::string connections = getParentModule()->par("connectionsFile").stdstringValue();
    nodes= "SFC1_vnfs.txt";
    connections="SFC1_connections.txt";}



Reply all
Reply to author
Forward
0 new messages