Anonymous | Login | 2022-05-28 16:08 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0000521 | OMNeT++ | simulation kernel | public | 2012-01-15 13:32 | 2012-01-15 17:36 | ||||||||
Reporter | andras | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | 4.2 | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000521: channel parameters cannot be set with pattern assignments in NED | ||||||||||||
Description | Channel 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. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files | |||||||||||||
![]() |
|
(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. |
![]() |
|||
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 - 2022 MantisBT Team |