Options no longer passed to Set; only sample size is needed

master
Mike Gerwitz 2012-03-04 08:12:31 -05:00
parent 216231b888
commit 31b7fb8e44
4 changed files with 12 additions and 8 deletions

View File

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

View File

@ -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();
},

View File

@ -6,10 +6,14 @@ rectest.set.Set = Interface( 'Set',
/**
* Create a new set from a base set and the given options
*
* @param {Array.<string>} 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.<string>} base_set base set
* @param {number} sample_size number of samples to be returned
*/
__construct: [ 'base_set', 'options' ],
__construct: [ 'base_set', 'sample_size' ],
/**

View File

@ -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 );
}
} );