I am new to OMNET++ and I have the following problem:
Network.ned
, CustNetworkNode.ned
, Maclayer.ned
, Maclayer.cc
, Maclayer.h
and omnetpp.iniCustNetworkNode.ned
file :package customproject;
import inet.queueing.queue.DropTailQueue;
import inet.applications.common.SinkApp;
import inet.applications.common.SourceApp;
import inet.physicallayer.wireless.common.contract.packetlevel.IRadio;
import inet.mobility.contract.IMobility;
module CustNetworkNode
{
parameters:
radio.antenna.mobilityModule = default("^.^.^.mobility");
gates:
input radioIn @directIn;
submodules:
radio: <default("UnitDiskRadio")> like IRadio {
@display("p=199.42,621.92");
}
mac: Maclayer {
@display("p=199.42,441.09");
}
queue: DropTailQueue {
@display("p=200,300");
}
traffic_gen: SourceApp {
@display("p=199.42,104.78");
}
consumer: SinkApp {
@display("p=332.93,104.78");
}
mobility: <default("StationaryMobility")> like IMobility {
@display("p=58.5,117");
}
connections allowunconnected:
radioIn --> { @display("m=s"); } --> radio.radioIn;
radio.upperLayerOut --> mac.lowerLayerIn;
radio.upperLayerIn <-- mac.lowerLayerOut;
queue.out --> mac.upperLayerIn;
queue.in <-- traffic_gen.socketOut;
mac.upperLayerOut --> consumer.socketIn;
}
//radio.antenna.mobilityModule = default("^.^.^.mobility");
After running the omnetpp.ini file again I'm getting this
I don't sign any parameter and I get the following
I have read a relevant topic with someone that faced the same issues but I cannot find any solid answer that solves these problems. Omnet++ simple wireless node
Any recommendations?
By default the mobility module is a submodule of the network node and the antenna module is a submodule of the radio module which is a submodule of the network node. You have arranged your modules differently, so the mobility module is not found by the antenna. You should either arrange modules in a similar way how it's done by default or set the mobilityModule parameter of the antenna module such that it correctly references the mobility module relative to the antenna module.