Omnet ++-分层无线网络

时间:2019-06-17 18:42:55

标签: iot omnet++ inet

我正在尝试使用模块和子模块实现分层无线网络,但是当我运行模拟时,会收到以下消息:

  

无法为FogNet.sensorNrtwork,sensotHost [0] .wlan [0] .radio创建中等可视化效果,因为找不到FogNet.visualizer.mediumVisualizer的网络节点可视化效果

我在模块和子模块中添加了radioMedium和可视化工具,当我只运行子模块时,一切正常,但是当我运行带有子模块的模块时,我收到此消息,我注意到这只是错误如果我的主模块有无线网络,或者我换成主模块上的有线网络,一切正常。

我的Ned文件

network FogNet
{
    @display("bgb=294.62997,178.42499;i=device/smallrouter");
    submodules:

        computer: StandardHost {
            @display("p=198.37999,141.95999;i=device/device");
        }
        sensorNetwork: SensorNet {
            @display("p=68.25,141.95999");
        }
        configurator: Ipv4NetworkConfigurator {
            parameters:
                assignDisjunctSubnetAddresses = false;
                @display("p=34,20;is=s");
        }
        radioMedium: Ieee80211ScalarRadioMedium {
            parameters:
                @display("p=109.2,19.109999;is=s");
        }
        accessPoint: AccessPoint {
            @display("p=186.54999,79.17;i=device/antennatower");
        }
        visualizer: IntegratedCanvasVisualizer {
            parameters:
                @display("p=170.17,20.929998;is=s");
        }
    connections:
        sensorNetwork.ethg++ <--> computer.ethg++;

}

network SensorNet
{
    parameters:
        @display("i=misc/sensor;bgb=382,301");
        int numSensors = 4;
    gates:
        inout ethg[];
    submodules:
        visualizer: IntegratedCanvasVisualizer {
            parameters:
                @display("p=43,78;is=s");
        }
        configurator: Ipv4NetworkConfigurator {
            parameters:
                assignDisjunctSubnetAddresses = true;
                @display("p=43,27;is=s");
        }
        radioMedium: Ieee80211ScalarRadioMedium {
            parameters:
                @display("p=42,130;is=s");
        }
        sensorHost[numSensors]: SensorNode {
            @display("p=171,174");
        }
        gateway: SensorNode {
            @display("p=217,58;i=misc/sensorgateway");
            forwarding = true;
        }
    connections:
        for i=0..sizeof(ethg)-1 {
            ethg++ <--> Eth100M <--> gateway.ethg++;
        }
}

我的ini文件

[Config Fognode]
network = FogNet
sim-time-limit = 400s

**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 500m
**.constraintAreaMaxY = 500m
**.constraintAreaMaxZ = 0m

**.addDefaultRoutes = false
*.gateway.forwarding = true

**.gateway.numApps = 1
**.gateway.app[0].typename = "UdpEchoApp"
**.gateway.app[0].localPort = 1000

**.*Host*.numApps = 1

**.*Host*.app[0].typename = "UdpBasicApp"
**.*Host*.app[0].destAddresses = "sensorNetwork.gateway"
**.*Host*.app[0].destPort = 1000
**.*Host*.app[0].messageLength = 100B
**.*Host*.app[0].sendInterval = 1s
**.*Host*.app[0].stopTime = 300s

**.*Host*.mobility.typename = "StaticGridMobility"
**.numSensors = 4
**.*Host*.mobility.numHosts = 4
**.*Host*.mobility.marginX = 100m
**.*Host*.mobility.marginY = 100m

**.initialZ = 0m

0 个答案:

没有答案