Scanning Experiment
This is the base implementation of scanning experiments.
This class should be subclassed for producing actual experiments. The procs should be extended where necessary.
Vars | |
required_atoms | The typepaths and number of atoms that must be scanned |
---|---|
scan_message | If set, it'll be used in place of the generic "Scan samples of \a [initial(target.name)]" in serialize_progress_stage() |
scanned | The list of atoms with sub-lists of atom references for scanned atoms contributing to the experiment (Or a count of atoms destoryed for destructive expiriments) |
Procs | |
New | Initializes the scanned atoms lists |
check_progress | Gets the number of atoms that have been scanned and the goal |
do_after_experiment | Performs actions following a successful experiment action |
experiment_requirements | Attempts to get the typepath for an atom that would contribute to the experiment |
final_contributing_index_checks | Performs any additional checks against the atom being considered for selection as a contributing index |
is_complete | Checks if the scanning experiment is complete |
perform_experiment_actions | Attempts to scan an atom towards the experiment's goal |
serialize_progress_stage | Serializes a progress stage into a list to be sent to the UI |
Var Details
required_atoms
The typepaths and number of atoms that must be scanned
scan_message
If set, it'll be used in place of the generic "Scan samples of \a [initial(target.name)]" in serialize_progress_stage()
scanned
The list of atoms with sub-lists of atom references for scanned atoms contributing to the experiment (Or a count of atoms destoryed for destructive expiriments)
Proc Details
New
Initializes the scanned atoms lists
Initializes the internal scanned atoms list to keep track of which atoms have already been scanned
check_progress
Gets the number of atoms that have been scanned and the goal
This proc returns a string describing the number of atoms that have been scanned as well as the target number of atoms.
do_after_experiment
Performs actions following a successful experiment action
This proc is intended to be used to add additional functionality to follow experiment actions without having to change the perform_experiment_actions proc to get access to the selected typepath index Arguments:
- target - The atom being scanned
- typepath - The typepath (selected index) of the target atom
experiment_requirements
Attempts to get the typepath for an atom that would contribute to the experiment
This proc checks the required atoms for a typepath that this target atom can contribute to and if found returns that typepath, otherwise returns null Arguments:
- target - The atom to attempt to scan
final_contributing_index_checks
Performs any additional checks against the atom being considered for selection as a contributing index
This proc is intended to be used to add additional functionality to contributing index checks without having to duplicate the iteration structure of experiment_requirements() Arguments:
- target - The atom being scanned
- typepath - The typepath (selected index) of the target atom
is_complete
Checks if the scanning experiment is complete
Returns TRUE/FALSE as to if the necessary number of atoms have been scanned.
perform_experiment_actions
Attempts to scan an atom towards the experiment's goal
This proc attempts to scan an atom towards the experiment's goal, and returns TRUE/FALSE based on success. Arguments:
- target - The atom to attempt to scan
serialize_progress_stage
Serializes a progress stage into a list to be sent to the UI
Arguments:
- target - The targeted atom for this progress stage
- seen_instances - The number of instances seen of this atom