Reputation: 1
Very new to omnet but I've been trying to set up a wireless mesh on top of StandardHost. While it compiles well, when the simulation starts I get this error:
Mobility position is not a finite number after initialize (x=-nan,y=-nan,z=-nan) -- in module (inet::StationaryMobility) Net.node[0].mobility (id=12), during network initialization
Below are my package.ned
, omnetpp.ini
and mwe.ned
.
If I set up the Node
submodules of Net
one by one and add a fixed property @display("p=...")
to each one of them then it works. Setting them up more parametrically i.e. node[size]: Node;
it fails to execute the simulation with the above error.
Any help would be very much appreciated.
Thanks in advance!
package mwe;
[General]
network = Net
*.radioMedium.typename = "Ieee802154NarrowbandScalarRadioMedium"
*.host*.wlan[0].radio.typename = "Ieee802154NarrowbandScalarRadio"
**.wlan[0].typename = "Ieee802154NarrowbandInterface"
*.host*.ipv4.arp.typename = "GlobalArp"
*.size = 2
package mwe;
import inet.node.inet.StandardHost;
import inet.physicallayer.unitdisk.UnitDiskRadioMedium;
import inet.physicallayer.contract.packetlevel.IRadioMedium;
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
module Node extends StandardHost
{
parameters:
numWlanInterfaces = default(1);
}
network Net
{
parameters:
int size = default(1);
submodules:
configurator: Ipv4NetworkConfigurator;
radioMedium: <default("UnitDiskRadioMedium")> like IRadioMedium;
node[size]: Node;
}
Upvotes: 0
Views: 775
Reputation: 279
I had a similar problem, with the exact same error message.
I solved it by setting the following parameters:
*.host[*].mobility.constraintAreaMaxX = 650m
*.host[*].mobility.constraintAreaMinX = 0m
*.host[*].mobility.constraintAreaMaxY = 500m
*.host[*].mobility.constraintAreaMinY = 0m
*.host[*].mobility.constraintAreaMaxZ = 0m
*.host[*].mobility.constraintAreaMinZ = 0m
I found the solution reading through the MobilityBase::setInitialPosition
method: with a minimal configuration, getRandomPosition
is called, and uses those values as min and max for the random.
Upvotes: 1