如何为 OMNETPP.INI 中的节点数组赋值
how to assign value to an array of nodes in OMNETPP.INI
网络中有 10 个节点,我想将节点 [0] 分配给节点 [4],ValueA= 10,其余 OMNETPP.INI 中的值为 90。我能想到的唯一愚蠢的分配值的方法如下:
**.*Node[0].ValueA= "10"
**.*Node[1].ValueA= "10"
......
......
**.*Node[5].ValueA= "90"
**.*Node[6].ValueA= "90"
.......
.......
我正在考虑使用 FOR 循环以更有效的方式分配值,但我认为这在 OMNETPP.INI 中是不可能的。
谁能帮助启发我如何实现这一目标?谢谢。
有多种选择和方法可供选择。
例如,您可以使用:
**.Node[0..4].ValueA = "10"
**.Node[5..9].ValueA = "90"
查看 OMNET Simulation manual -> Chapter Wildcard 模式以获取更多信息。
网络中有 10 个节点,我想将节点 [0] 分配给节点 [4],ValueA= 10,其余 OMNETPP.INI 中的值为 90。我能想到的唯一愚蠢的分配值的方法如下:
**.*Node[0].ValueA= "10"
**.*Node[1].ValueA= "10"
......
......
**.*Node[5].ValueA= "90"
**.*Node[6].ValueA= "90"
.......
.......
我正在考虑使用 FOR 循环以更有效的方式分配值,但我认为这在 OMNETPP.INI 中是不可能的。 谁能帮助启发我如何实现这一目标?谢谢。
有多种选择和方法可供选择。 例如,您可以使用:
**.Node[0..4].ValueA = "10"
**.Node[5..9].ValueA = "90"
查看 OMNET Simulation manual -> Chapter Wildcard 模式以获取更多信息。