diff --git a/scripts/TestRunner.js b/scripts/TestRunner.js index 4986b00..dcf3a07 100644 --- a/scripts/TestRunner.js +++ b/scripts/TestRunner.js @@ -93,7 +93,7 @@ rectest.TestRunner = Class( 'TestRunner', var _self = this, run = this._setFactory.fromId( options.ralgo, - test_case.getSet( options.set ), options + test_case.getSet( options.set ), +options.samples ); // allow test case to initialize its display diff --git a/scripts/set/RandomGroupedSet.js b/scripts/set/RandomGroupedSet.js index 222f712..6bc7534 100644 --- a/scripts/set/RandomGroupedSet.js +++ b/scripts/set/RandomGroupedSet.js @@ -32,11 +32,11 @@ rectest.set.RandomGroupedSet = Class( 'RandomGroupedSet' ) 'private _setPos': 0, - __construct: function( base_set, options ) + __construct: function( base_set, sample_size ) { this._set = base_set; this._setLength = this._set.length; - this._samplesRemain = +options.samples || -1; + this._samplesRemain = +sample_size || -1; this._reset(); }, diff --git a/scripts/set/Set.js b/scripts/set/Set.js index 454b168..a63871b 100644 --- a/scripts/set/Set.js +++ b/scripts/set/Set.js @@ -6,10 +6,14 @@ rectest.set.Set = Interface( 'Set', /** * Create a new set from a base set and the given options * - * @param {Array.} base_set base set - * @param {Object} options configuration options + * It should be noted that the sample size is required because certain + * algorithms need to understand the data in order to provide a truely + * random set across all samples. + * + * @param {Array.} base_set base set + * @param {number} sample_size number of samples to be returned */ - __construct: [ 'base_set', 'options' ], + __construct: [ 'base_set', 'sample_size' ], /** diff --git a/scripts/set/SetFactory.js b/scripts/set/SetFactory.js index cf382e4..34b66fa 100644 --- a/scripts/set/SetFactory.js +++ b/scripts/set/SetFactory.js @@ -3,7 +3,7 @@ */ rectest.set.SetFactory = Class( 'SetFactory', { - 'public fromId': function( id, base_set, options ) + 'public fromId': function( id, base_set, sample_size ) { var sets = rectest.set; @@ -12,6 +12,6 @@ rectest.set.SetFactory = Class( 'SetFactory', sets.RandomGroupedSet, null, null - ][ id ]( base_set, options ); + ][ id ]( base_set, sample_size ); } } );