⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mesh.ned

📁 omnet++下仿真100个节点的路由协议!
💻 NED
字号:
//
// This file is part of an OMNeT++/OMNEST simulation example.
//
// Copyright (C) 1992-2005 Andras Varga
//
// This file is distributed WITHOUT ANY WARRANTY. See the file
// `license' for details on this and other legal matters.
//


module Mesh
    parameters:
        height : numeric const,
        width : numeric const;
    submodules:
        node: Node[height*width];
            parameters:
                address = index;
            gatesizes:
                in[4],
                out[4];
            display: "p=,,m,$width,40,40;i=misc/node_vs";
    connections nocheck:
        for i=0..height-1, j=0..width-1 do
            node[i*width+j].out[0] --> node[(i+1)*width+j].in[1] if i!=height-1;
            node[i*width+j].in[0] <-- node[(i+1)*width+j].out[1] if i!=height-1;
            node[i*width+j].out[2] --> node[i*width+j+1].in[3] if j!=width-1;
            node[i*width+j].in[2] <-- node[i*width+j+1].out[3] if j!=width-1;
        endfor;
endmodule


network mesh : Mesh
    parameters:
        height = input(9,"Number of rows"),
        width = input(7,"Number of columns");
endnetwork

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -