Hi,
I looked at the code you sent me and I must say that you've encountered the elusive "it's not a bug, it's a feature" problem.
The problem here is that the module feeds a departure time to google, in order to have google maps calculate the best route based on the time of day. This is used mainly for public transportations, but still it is provided to Google. By default, this time is set to the current system time when the RoutesMobilityHelper constructor is invoked.
Now, Google doesn't allow to ask directions in the past (I experimented around and it should have worked in your case, but the fact is that it didn't), and because the variable was set in the beginning of the simulation, it would eventually be considered the past as far as the API was concerned, and it would sent back an INVALID_REQUEST response. In your case, this would happen in execution number 144.
A quick fix for this, without altering the module's code, is to set the departure time to a value in the future (I tried with 8 days from now) and you won't run into this problem. You must set the time to EPOCH, and you can convert easily between the "human" time and EPOCH using the date command.
For example:
date +%s -d "December 24 2015 4:56:00"
You can also use several online converters, such as
this.
To set the departure time for the RoutesMobilityModule, you must invoke the SetDepartureTime(std::string) function before the execution of the ChooseRoutes function, like this:
routes.SetDepartureTime("1450932960"); //EPOCH time for December 24 2015 4:56:00
I executed your script with the departure time set as above and everything went fine. I'll try to push a fix for this soon, but I don't know when I'll get around to it. I also didn't notice this bug before because, when dealing with numerous nodes I would use a virtual machine. Nothing like this ever happened, as far as I can recall, and I went back to it to try and confirm it there, but I couldn't reproduce it with 200 nodes. I noticed that the departure time was set only once, for every request.
I tinkered with the departure_time variable to perform some requests manually and I noticed that google allows for the directions to be asked in the past, as long as it wasn't too far back. The time google allows for the directions to be asked (estimated with the manual requests, around an hour) in the past should be more than enough for most simulations, so it could also be a problem with Google.
Also, a side note. You said before that you were setting some nodes to a fixed position, using the module. You should use the ConstantPositionMobilityModel, to set the nodes's positions. You can find the values for X,Y and Z with the debug output from the RoutesMobilityHelper debug module (just run your script once and record the values of X, Y and Z for the nodes you want to keep stationed).
You can use the ConstantPositionMobilityModel as such (I modified this from some code I had, so it should work, but I didn't test it. If it doesn't work, check the documentation for this mobility model ;) ):
void
PositionFixedNodes (NodeContainer& nodeContainer, double x, double y, double z)
{
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();
uint32_t numOfNodes = nodeContainer.GetN();
for(uint32_t i = 0; i< numOfNodes; i++)
{
positionAlloc->Add(Vector(x,y,z));
}
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.SetPositionAllocator(positionAlloc);
mobility.Install(nodeContainer);
}
Best regards,
Tiago