Class InputOutputExperiment<T extends InputFromManager,S>
Object
org.anchoranalysis.bean.AnchorBean<Experiment>
org.anchoranalysis.experiment.bean.Experiment
org.anchoranalysis.experiment.bean.io.OutputExperiment
org.anchoranalysis.experiment.bean.io.InputOutputExperiment<T,S>
- Type Parameters:
T- input-object typeS- shared-state for job
- All Implemented Interfaces:
AssociateXMLUponLoad,ReplaceInputManager<T>,ReplaceOutputManager,ReplaceTask<T,S>
public class InputOutputExperiment<T extends InputFromManager,S> extends OutputExperiment implements ReplaceInputManager<T>, ReplaceOutputManager, ReplaceTask<T,S>
An experiment that uses both an
InputManager to specify inputs and a OutputManager to specify outputting.
The following outputs are produced:
| Output Name | Default? | Description |
|---|---|---|
| "logExperiment" | yes | A textual log file for non-job-specific messages, one for the entire experiment. |
| "logJob" | yes | A textual log file for job-specific messages, one for each job. |
- Author:
- Owen Feehan
-
Field Summary
Fields inherited from class org.anchoranalysis.experiment.bean.io.OutputExperiment
OUTPUT_EXECUTION_TIME -
Constructor Summary
Constructors Constructor Description InputOutputExperiment() -
Method Summary
Modifier and Type Method Description protected MultiLevelOutputEnableddefaultOutputs()If specified, default rules for determine which outputs are enabled or not.protected Optional<TaskStatistics>executeExperimentWithParameters(ParametersExperiment parameters)Executes the experiment for parameters.InputManager<T>getInput()The input-manager to specify where/which/how necessary inputs for the experiment occur.LoggingDestinationgetLogTask()Where log messages that do pertain to a specific job (input) appear.StringgetMessageNoInputs()A message written to the logger if no inputs exist for the experiment, and it thus ends early.JobProcessor<T,S>getTaskProcessor()What task is associated with the experiment, and how it is processed.voidreplaceInputManager(InputManager<T> inputManager)Replace the existing @{link InputManager} associated with this class.voidreplaceOutputManager(OutputManager output)Replace the currently-assignedOutputManagerwith another.voidreplaceTask(Task<T,S> taskToReplace)Replace the currently-assignedTaskwith another.voidsetInput(InputManager<T> input)The input-manager to specify where/which/how necessary inputs for the experiment occur.voidsetLogTask(LoggingDestination logTask)Where log messages that do pertain to a specific job (input) appear.voidsetMessageNoInputs(String messageNoInputs)A message written to the logger if no inputs exist for the experiment, and it thus ends early.voidsetTaskProcessor(JobProcessor<T,S> taskProcessor)What task is associated with the experiment, and how it is processed.booleanuseDetailedLogging()Whether to log in more or less detail.Methods inherited from class org.anchoranalysis.experiment.bean.io.OutputExperiment
executeExperiment, getExperimentIdentifier, getLogExperiment, getOutput, isForceDetailedLogging, setExperimentIdentifier, setForceDetailedLogging, setLogExperiment, setOutputMethods inherited from class org.anchoranalysis.experiment.bean.Experiment
associateXML, getXMLConfigurationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
InputOutputExperiment
public InputOutputExperiment()
-
-
Method Details
-
useDetailedLogging
public boolean useDetailedLogging()Description copied from class:ExperimentWhether to log in more or less detail.It's appropriate to perform more detailed logging for a lengthier experiment, but something quick and simple is preferable for a short job, which may only be outputted to the console.
- Overrides:
useDetailedLoggingin classOutputExperiment- Returns:
- true iff detailed logging should be employed.
-
replaceInputManager
Description copied from interface:ReplaceInputManagerReplace the existing @{link InputManager} associated with this class.- Specified by:
replaceInputManagerin interfaceReplaceInputManager<T extends InputFromManager>- Parameters:
inputManager- the new input-manager that is assigned.- Throws:
OperationFailedException- if the assignment cannot complete successfully.
-
replaceOutputManager
Description copied from interface:ReplaceOutputManagerReplace the currently-assignedOutputManagerwith another.- Specified by:
replaceOutputManagerin interfaceReplaceOutputManager- Parameters:
output- the task to replace.- Throws:
OperationFailedException- if the task cannot be successfully replaced.
-
replaceTask
Description copied from interface:ReplaceTaskReplace the currently-assignedTaskwith another.- Specified by:
replaceTaskin interfaceReplaceTask<T extends InputFromManager,S>- Parameters:
taskToReplace- the task to replace.- Throws:
OperationFailedException- if the task cannot be successfully replaced.
-
executeExperimentWithParameters
protected Optional<TaskStatistics> executeExperimentWithParameters(ParametersExperiment parameters) throws ExperimentExecutionExceptionDescription copied from class:OutputExperimentExecutes the experiment for parameters.- Specified by:
executeExperimentWithParametersin classOutputExperiment- Parameters:
parameters- a combination of run-time and bean-time specified elements used in the experiment.- Returns:
- statistics of the tasks, if they exist.
- Throws:
ExperimentExecutionException- if anything occurs stop the experiment finishing its execution
-
defaultOutputs
Description copied from class:OutputExperimentIf specified, default rules for determine which outputs are enabled or not.- Specified by:
defaultOutputsin classOutputExperiment- Returns:
- the default rules if they exist.
-
getInput
The input-manager to specify where/which/how necessary inputs for the experiment occur. -
setInput
The input-manager to specify where/which/how necessary inputs for the experiment occur. -
getTaskProcessor
What task is associated with the experiment, and how it is processed.e.g. how the task processes the inputs in the form of jobs (sequentially, parallel, how many processors? etc.)
-
setTaskProcessor
What task is associated with the experiment, and how it is processed.e.g. how the task processes the inputs in the form of jobs (sequentially, parallel, how many processors? etc.)
-
getLogTask
Where log messages that do pertain to a specific job (input) appear.This is in contrast to
logExperimentwhere non-job specific log messages appear. -
setLogTask
Where log messages that do pertain to a specific job (input) appear.This is in contrast to
logExperimentwhere non-job specific log messages appear. -
getMessageNoInputs
A message written to the logger if no inputs exist for the experiment, and it thus ends early. -
setMessageNoInputs
A message written to the logger if no inputs exist for the experiment, and it thus ends early.
-