core: Add function to reset the next random variable stream index counter

This commit is contained in:
Gabriel Ferreira
2024-10-04 10:32:10 +02:00
parent 4e642e5d60
commit 0d0dbd961e
2 changed files with 11 additions and 0 deletions

View File

@@ -101,4 +101,10 @@ RngSeedManager::GetNextStreamIndex()
return next;
}
void
RngSeedManager::ResetNextStreamIndex()
{
g_nextStreamIndex = 0;
}
} // namespace ns3

View File

@@ -93,6 +93,11 @@ class RngSeedManager
* \returns The next stream index.
*/
static uint64_t GetNextStreamIndex();
/**
* Resets the global stream index counter.
*/
static void ResetNextStreamIndex();
};
/** Alias for compatibility. */