Commit aed07367 authored by Jonathon Duerig's avatar Jonathon Duerig

Randomize order of visitation based on source node.

parent a0a100b4
......@@ -74,14 +74,32 @@ sub runTest
#-----------------------------------------------------------------------
@randList = ();
for ($i = 1; $i <= $nodeCount; ++$i)
{
for ($j = $i + 1; $j <= $nodeCount; ++$j)
push(@randList, $i);
}
srand($source);
for ($i = 1; $i <= $nodeCount; ++$i)
{
$first = int(rand($nodeCount));
$second = int(rand($nodeCount));
$temp = $randList[$first];
$randList[$first] = $randList[$second];
$randList[$second] = $temp;
}
for ($i = 0; $i < $nodeCount; ++$i)
{
for ($j = $i + 1; $j < $nodeCount; ++$j)
{
if ($i != $source
&& $j != $source)
$dest1 = $randList[$i];
$dest2 = $randList[$j];
if ($dest1 != $source
&& $dest2 != $source)
{
runTest($i, $j);
runTest($dest1, $dest2);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment