The AlgChecker class is used to perform tests on a given algorithm under the specific environment created by the given values. More...
#include <algchecker.h>
Public Member Functions | |
| AlgChecker (int dimensions, int algType, double winSize, int numPartsIn, int finalTime, int seedIn) | |
| AlgChecker constructs the algorithm and environment specified by the input. More... | |
| void | run () |
| run calculates the time it takes the already constructed algorithm to complete the given number of timesteps under the constructed environment. More... | |
The AlgChecker class is used to perform tests on a given algorithm under the specific environment created by the given values.
Test results are printed to stdout.
| AlgChecker::AlgChecker | ( | int | dimensions, |
| int | algType, | ||
| double | winSize, | ||
| int | numPartsIn, | ||
| int | finalTime, | ||
| int | seedIn | ||
| ) |
AlgChecker constructs the algorithm and environment specified by the input.
| dimensions | 2 for 2D, 3 for 3D, 4 for Orbital |
| algType | 0 for Brute Force, 1 for QuadTree/OctTree, 2 for Spatial Hash, 3 for Sweep 'N Prune Simple, 4 for Sweep 'N Prune Multi |
| winSize | the length of each side of the bounding space |
| numPartsIn | the number of particles to exist in the environment |
| finalTime | the number of timesteps to run the algorithm for |
| seedIn | the seed for the random generator |
| void AlgChecker::run | ( | ) |
run calculates the time it takes the already constructed algorithm to complete the given number of timesteps under the constructed environment.
It outputs to stdout a new line "n,t,c" where n = the number of particles in the environment, t = the time it took to complete, and c = the number of collisions the algorithm detected
1.8.6