OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001011OMNeT++simulation kernelpublic2017-05-04 22:532017-05-04 22:53
Reporterpaolinux 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx86OSWindowsOS Version10
Product Version5.1 
Target VersionFixed in Version 
Summary0001011: Name is not unique within its component,
DescriptionI'm not sure if this is a bug or a feature but I've noticed the following change when moving from 5.0 to 5.1.

In the previous version, the following NED declaration was fine:

       switch: Switch if numClients > 10 {
            parameters:
                pkRate = 1.5*numClients;
        }

       switch: Switch if numClients <= 10 {
            parameters:
                pkRate = 2.5*numClients;
        }

My understanding was that as long as the two conditions ("numClients > 10" and "numClinents <=10") were mutually exclusive, the declaration was correct as only one instance of Switch would be created.

However, when running this code under 5.1, I get the following error

<!> Error: Name 'switch' is not unique within its component, at
omnetpp-5.1\samples\dyna\ClientServer.ned:31

Is this the intended behavior or is indeed a bug? I find the former behavior rather handy when I want to change the type of a given sub-module based on the value of a parameter.
Steps To ReproduceChange the ClientServer.ned in samples/dyna as follows

network ClientServer
{
    parameters:
        int numClients @prompt("Number of clients") = default(4);
    submodules:
        server: Server {
            parameters:
                @display("p=210,70");
        }
        switch: Switch if numClients > 10 {
            parameters:
                pkRate = 1.5*numClients; // pkRate should be >= numClients, otherwise switch will become the bottleneck
                queueMaxLen = 20; // buffer max 20 packets
                @display("p=210,170");
            gates:
                port[numClients+1];
        }

       switch: Switch if numClients <= 10 {
            parameters:
                pkRate = 2.5*numClients; // pkRate should be >= numClients, otherwise switch will become the bottleneck
                queueMaxLen = 20; // buffer max 20 packets
                @display("p=210,170");
            gates:
                port[numClients+1];
        }


        client[numClients]: Client {
            parameters:
                timeout = 5s;
                @display("p=70,270,m,10,80");
        }
    connections:
        for i=0..numClients-1 {
            client[i].port <--> { delay = 10ms; } <--> switch.port[i];
        }
        server.port <--> { delay = 10ms; } <--> switch.port[numClients];
}
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-05-04 22:53 paolinux New Issue


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker