the simulation being tested
the AdvanceStrategy for advancing the simulation thru time
run the simulation until this time is reached
Optional expectedVars: null | number[]the set of expected state variables, or null
Optional tolerance: numberthe maximum allowed difference between expected and actual state variables
Optional expectedEnergyDiff: numberthe expected change in total energy, or NaN if energy should not be tested
Optional energyTol: numbermaximum allowed difference to expected energy change
Optional expectedCollisions: numberexpected number of collisions, or -1 to not test number of collisions
Optional expectedSearches: numberexpected number of collision searches, or -1 to not test number of collision searches. Default is zero.
Generated using TypeDoc
Runs the simulation until the given time, then compares the state variables against the given expected state variables, using the given tolerance. Optionally checks that energy has been constant from start to finish of the test run. See
checkResultfor details about specifying the expected results. If any expected results are given, or the constant energy test is done, then prints a message saying that the current test has passed.If expected results are not provided, the simulation is run for the specified time with no tests being done. Tests are only done for the expected results provided. For example, you can give
nullforexpectedVarsbut still have energy tests performed. Or vice versa: giveexpectedVarsto be checked, but no expected energy results.The default value for number of collision searches done is zero. To ignore collision searches, provide -1 for that argument. If that number of collision searches suddenly increases, then something has gone wrong with collision time estimation.
Debugging: Set the
debugvariable before running this to see some debug output: prints state of the first object at each time step, and then the state of all objects at conclusion of the test.