omnetpp / docs.omnetpp.org

OMNeT++ Documentation and Tutorials
https://docs.omnetpp.org
32 stars 41 forks source link

[Wrong design output of ned file] Tutorials->Turn it Into a Real Network->tictoc10.ned #17

Closed TsangHans closed 1 year ago

TsangHans commented 1 year ago

First of all, I'd like to thank the contributors of this document. Because of this document, I can quickly start Omnetpp. Here is my running environment. I hope it can help you solve my problem.

  • OperationSystem: Windows 10
  • Omnetpp: 6.0.1 (MD5: 85015db4715e8ca4c4d7deb72c133edc)

During my study, I encountered a problem: when I used the following code to construct a network, I could not achieve the expected effect shown in the tutorial.

// file: tictoc10.ned

simple Txc10 
{ 
  parameters: 
  @display("i=block/routing"); 
  gates: 
    input in[]; // declare in[] and out[] to be vector gates 
    output out[]; 
} 

network Tictoc10 
 { 

  submodules: 
    tic[6]: Txc10; 

  connections: 
    tic[0].out++ --> { delay = 100ms; } --> tic[1].in++; 
    tic[0].in++ <-- { delay = 100ms; } <-- tic[1].out++; 

    tic[1].out++ --> { delay = 100ms; } --> tic[2].in++; 
    tic[1].in++ <-- { delay = 100ms; } <-- tic[2].out++; 

    tic[1].out++ --> { delay = 100ms; } --> tic[4].in++; 
    tic[1].in++ <-- { delay = 100ms; } <-- tic[4].out++; 

    tic[3].out++ --> { delay = 100ms; } --> tic[4].in++; 
    tic[3].in++ <-- { delay = 100ms; } <-- tic[4].out++; 

    tic[4].out++ --> { delay = 100ms; } --> tic[5].in++; 
    tic[4].in++ <-- { delay = 100ms; } <-- tic[5].out++; 
 } 

The following is the network structure built on my computer. image

I don't know why I can't parse the module of array type, so I need some help, thank you.

flashxiaomang commented 1 year ago

I'm a user, I don't know exactly why, but I have a guess about the question. the annotation "display" has a parameter setting the position of the node, I forget the exact name, but you can find it at the offical website of omnet. I think each node are allocated the same default position, so the node is overlaped by the next node, so they stack together. But that doesn't matter, you can run the ned file, and in the omnet simulation surface, they're spreaded.

TsangHans commented 1 year ago

I'm a user, I don't know exactly why, but I have a guess about the question. the annotation "display" has a parameter setting the position of the node, I forget the exact name, but you can find it at the offical website of omnet. I think each node are allocated the same default position, so the node is overlaped by the next node, so they stack together. But that doesn't matter, you can run the ned file, and in the omnet simulation surface, they're spreaded.

Thank you for your reply. I understand your meaning roughly.

The nodes of the network topology are still overlapped when i run the ned file, but this exactly does not affect the operation of the background code. image

I am considering whether to reduce the version of the omnetpp.

TsangHans commented 1 year ago

Answer myself.

When I rolled back the Omnetpp version 5.6.1, it successfully displayed the topology when running the simulation. image

Thank you again for your reply @flashxiaomang .