Class Scenario_Experiment

Description

Experiment class

Handles experiment-related functions, stores experiment data.

  • copyright: Copyright (c) 2010 TK Studios. (http://www.tkstudios.com)
  • license: New BSD License

Located in /Scenario/Experiment.php (line 31)


	
			
Variable Summary
Method Summary
Scenario_Experiment __construct (string $experiment_id, [int|null $row_id = null], [bool $create = true])
string getExperimentID ()
int getRowID ()
Scenario_Treatment getTreatment (Scenario_Identity $id, [bool $create = true])
void setExperimentID (string $experiment_id)
void setRowId (int $val)
Variables
string $_experiment_id (line 38)

Name of the experiment.

  • access: protected
int $_row_id (line 45)

Row ID for the experiment, usually used by databases.

  • access: protected
Methods
Constructor __construct (line 54)

Construct a new Experiment object.

  • access: public
Scenario_Experiment __construct (string $experiment_id, [int|null $row_id = null], [bool $create = true])
  • string $experiment_id
  • int|null $row_id
  • bool $create
getCore (line 166)

Gets a safe Scenario_Core reference.

  • return: An instance of Scenario_Core appropriate for use in the context of this experiment.
  • todo: Pass the core reference to new experiment objects rather than use the singleton.
  • access: public
Scenario_Core getCore ()
getExperimentID (line 138)

Get the experiment's identifying name.

  • access: public
string getExperimentID ()
getNewTreatment (line 127)

Retrieves a new Scenario_Treatment object for this experiment.

Should randomize between whatever treatments are desired for the experiment. By default, treatments select "default" or "alternate" if supplied with null for their name.

  • access: public
Scenario_Treatment getNewTreatment ()
getResults (line 156)

Get the results of this experiment as a Scenario_ResultSet collection.

  • access: public
Scenario_ResultSet getResults ()
getRowID (line 73)

Get the Row ID associated with this experiment (usually for database use).

  • return: The stored Row ID for this record, or null.
  • access: public
int getRowID ()
getTreatment (line 108)

Get a treatment for this experiment for the given Identity.

If the treatment does not exist, this method invokes getNewTreatment, which may be overridden in subclasses to return treatments according to different lists and weights. getTreatment should always return "default" among its options.

  • return: The requested treatment object.
  • access: public
Scenario_Treatment getTreatment (Scenario_Identity $id, [bool $create = true])
  • Scenario_Identity $id: Identity to use in retrieving a new or existing treatment.
  • bool $create: (Optional) whether or not to create the treatment if it does not exist.
setExperimentID (line 147)

Set the experiment's identifying name.

  • access: public
void setExperimentID (string $experiment_id)
  • string $experiment_id
setRowId (line 82)

Set the Row ID associated with this experiment (usually for database use).

  • access: public
void setRowId (int $val)
  • int $val

Documentation generated on Sat, 23 Oct 2010 18:10:45 -0400 by phpDocumentor 1.4.3