OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000521OMNeT++simulation kernelpublic2012-01-15 13:322012-01-15 17:36
Reporterandras 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.2 
Target VersionFixed in Version 
Summary0000521: channel parameters cannot be set with pattern assignments in NED
DescriptionChannel parameters cannot be set with pattern assignments in NED

Example:

module Node
{
    gates:
        input in;
        output out;
    connections allowunconnected:
}

network FifoNet
{
    parameters:
        **.datarate = 444 Mbps; // <---- THIS LINE IS INEFFECTIVE
    submodules:
        a: Node;
        b: Node;
    connections allowunconnected:
        a.out --> ned.DatarateChannel --> b.in;
}

The datarate setting line does not take effect. At the same time, a **.datarate=... line in omnetpp.ini is OK.


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000688)
andras (administrator)
2012-01-15 16:36

Pattern assignments are supposed to be applied to channels in same way as to submodules, in

  void cNEDNetworkBuilder::assignParametersFromPatterns(cComponent *component)

invoked indirectly from

  cChannelType::create(const char *name);

This method calls getParentModule() repeatedly until it reaches the top, and applies pattern assignments it finds at each level. This works fine for modules,
but a channel's getParentModule() returns NULL, because the parent module is not know yet! (cChannel::getParentModule() computes it from the source gate, which is unset at this point). Modules work because cModuleType::create() requires the parent module pointer too, in addition to the name string.

Options:

1. add the "cModule *parentmodule" arg to cChannelType::create() too; this will make it symmetric with cModuleType. connectTo() will need to ensure that the channel object is indeed used for a connection that has the previously specified parent.

2. change the code so that parameter reading is delayed until the channel object is used for a connection.
(0000689)
andras (administrator)
2012-01-15 17:36

Only 2) works, because the srcgat/srcmodule is also part of the channel fullpath, parentmodule is not enough.

Plan:
- {cModuleType|cChannelType}::create() should only apply the parameter values that come from the NED *type* of component (regardless of the place of instantiation)
- local assignments (from submodule/connection NED element), NED pattern assignments and inifile assignments should be done within finalizeParameters(). finalizeParameters() already calls ev.readParameter(); it should also call a new cComponentType::assignParameters() method first, which would perform the local assignments and pattern assignments from NED. This should not touch parameters already set.

Between the two, the user could manually set parameters; user's assignments would not be overwritten by later local/pattern assignments.

- Issue History
Date Modified Username Field Change
2012-01-15 13:32 andras New Issue
2012-01-15 16:36 andras Note Added: 0000688
2012-01-15 17:36 andras Note Added: 0000689


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker