Exchange data between nodes in OMNeT++

2019-08-17 17:40发布

I'm using OMNeT++ to simulate a network. The messages exchanged between nodes are type integer and complex number.

How can I exchange the type of data between different nodes, because cMessage cannot accept integer and complex data.

1条回答
Evening l夕情丶
2楼-- · 2019-08-17 18:01

You can easily define custom messages with any content using .msg files. Take a look at the corresponding chapter in the Simulation Manual. This way you can define your "complex" type message, by adding two fields of type double, named for example re and im. The message compiler will generate a subclass of cMessage from this definition, which you can use for communication between nodes.

查看更多
登录 后发表回答