Space Comps
 All Classes Files Functions Variables
Public Member Functions | List of all members
AlgChecker Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

AlgChecker::AlgChecker ( int  dimensions,
int  algType,
double  winSize,
int  numPartsIn,
int  finalTime,
int  seedIn 
)

AlgChecker constructs the algorithm and environment specified by the input.

Parameters
dimensions2 for 2D, 3 for 3D, 4 for Orbital
algType0 for Brute Force, 1 for QuadTree/OctTree, 2 for Spatial Hash, 3 for Sweep 'N Prune Simple, 4 for Sweep 'N Prune Multi
winSizethe length of each side of the bounding space
numPartsInthe number of particles to exist in the environment
finalTimethe number of timesteps to run the algorithm for
seedInthe seed for the random generator

Member Function Documentation

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


The documentation for this class was generated from the following files: