There is a little bug in ChannelControl.cc.
On line 130 it says:
// use half of playground size if model returned 0
if (maxInterferenceDistance <= 0) {
maxInterferenceDistance = min(playgroundSize.x, playgroundSize.y) /
2 - 1;
}
If fixInterferenceHorizon is set to 0 in omnetpp.ini the
maxInterferenceDistance is calculated by the channelmodel which also
returns 0.
So the maxInterferenceDistance is half the playgroundsize all the
time, even if no Torus is used!
This Problem has very big impact if the size of the Playground is very
small and no Torus is used.
For example on a 100x100 Playground, the maxInterferenceRange is set
to 50 that is far too small.
To fix it, the line should be changed to:
if (maxInterferenceDistance <= 0) {
if (useTorus)
{
maxInterferenceDistance = min(playgroundSize.x,
playgroundSize.y) / 2 - 1;
}
else
{
maxInterferenceDistance = max(playgroundSize.x, playgroundSize.y);
}
}
Greetings, Alex
BTW:
The ChannelControl should also check if min(pgsX, pgsY) is >= 2,
otherwise there will be an error.
Like:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
(I used a pgs of 100x1 because I simulated a line of nodes, and my
topology generating tool chooses the smallest fitting pgs...)