First of all, this question or its variation is probably asked a large number of times. I apologise for the reiteration.
Problem statement: I am trying to generate 'n' static RSU nodes with random initial positions. I am using LinearMobilityand setting the speed etc. to 0 to achieve static-ness of RSUs. N.B. The vehicles are generated on fly from sumo through TraCI (this is working fine). The aim is to generate the RSUs such that, they are inside the area of the map, in the vicinity of where the vehicles are moving.
But I am unable to do that. A lot of RSUs are generated, spread in the grey area (the playground) outside the map (which usually is at the bottom right corner), and I could not find a work around. (Being inexperienced with OMNET++) I strongly suspect this is wrong, because surely the road side units cannot be outside the map!
Is there a way such that the playground area can be aligned with the map area? If, yes then I think by knowing the 4 corner coordinates of the SUMO map, it should be possible to restrict the positions of the RSUs to the more or less within a rectangular Coordinate range. I would then use something like the following to generate RSUs: (#suppose the corners are [(1000,1000),(1500,1000),(1000, 1500),(1500,1500)])
network testNetwork extends Scenario
{
parameters:
int numRSUs;
@display("bgb=$playgroundSizeX,$playgroundSizeY");
submodules:
rsu[numRSUs]: RSU {
mobilityType = "LinearMobility";
mobility.x = uniform(1000, 1500);
mobility.y = uniform(1000, 1500);
mobility.z = 0;
mobility.speed = 0;
mobility.angle = 0;
mobility.acceleration = 0;
mobility.updateInterval =0;
}
connections allowunconnected:
}
Is this possible or even remotely a good idea? Can anybody please let me know if there is a way to solve this?