You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following lines are present in the Simulation class:
val randomSource2 = randomSource.nextSource()
if (context.recreateDatabase) init(randomSource2)
Different data is generated when replaced with the following lines:
if (context.recreateDatabase) init(randomSource.nextSource())
else randomSource.nextSource()
The following unit test was written to test the behaviour of the RandomSource class:
@Test
fun testSource() {
val seed: Long = 0
val randomSourceA = RandomSource(seed)
val randomSourceB = RandomSource(seed)
assert(randomSourceA.nextInt(1000000) == randomSourceB.nextInt(1000000))
val randomSourceA2 = randomSourceA.nextSource()
repeat(1000000) {
randomSourceA2.nextBoolean()
}
if (false) {}
else randomSourceB.nextSource()
assert(randomSourceA.nextInt(1000000) == randomSourceB.nextInt(1000000))
}
The test passed. It is unknown why a change that appears to be a trivial refactor causes changes to the data generated, and this warrants looking further into at a later date.
Environment
OS: MacOS 12.6.1
TypeDB version: 2.16.1
TypeDB client: client-java
The text was updated successfully, but these errors were encountered:
Description
The following lines are present in the Simulation class:
Different data is generated when replaced with the following lines:
The following unit test was written to test the behaviour of the RandomSource class:
The test passed. It is unknown why a change that appears to be a trivial refactor causes changes to the data generated, and this warrants looking further into at a later date.
Environment
The text was updated successfully, but these errors were encountered: