public class QuickMultiDatasetStructuredExperiment<T extends InputFromManager,S> extends Experiment implements ReplaceInputManager<T>, ReplaceOutputManager
QuickMultiDatasetStructuredExperiment
put sets properties according to an
expected directory structure.
Project Directory/ Experiments/ # where Experiments are stored Experiments/include/ # where a loggerExperiment.xml and loggerTask.xml can be found Filesets/ # where Filesets are stored IO/OutputManager/ # where OutputManagers are stored
It also assumes a certain naming structure for the xml files in each, based upon an experiment-type parameter $1.
Filesets/For$1/ # the first letter of $1 is capitalized) IO/OutputManager/$1.xml
his allows many parameters of QuickMultiDatasetStructuredExperiment
to be easily set.
Constructor and Description |
---|
QuickMultiDatasetStructuredExperiment() |
Modifier and Type | Method and Description |
---|---|
void |
associateXML(org.apache.commons.configuration.XMLConfiguration xmlConfiguration)
Associated an XML configuration with an object.
|
void |
checkMisconfigured(BeanInstanceMap defaultInstances)
Checks that a bean's properties conform to expectations.
|
Optional<Path> |
executeExperiment(ExecutionArguments arguments)
Executes the experiment.
|
String |
getBeanExtension() |
StringSet |
getDatasets() |
String |
getDatasetSpecific() |
int |
getDirectoryDistance()
How many directories to recurse back from the current file to the Experiments/ directory
|
String |
getExperimentType()
The value of $1 (see comment above) in naming-structure.
|
String |
getIdentifierSuffix() |
int |
getMaxNumberProcessors() |
Task<T,S> |
getTask() |
boolean |
isSuppressExceptions() |
void |
localise(Path path)
Called once after the bean is created, localising the bean to a path on the filesystem.
|
void |
replaceInputManager(InputManager<T> inputManager)
Replace the existing @{link InputManager} associated with this class.
|
void |
replaceOutputManager(OutputManager output)
Replace the currently-assigned
OutputManager with another. |
void |
setBeanExtension(String beanExtension) |
void |
setDatasets(StringSet datasets) |
void |
setDatasetSpecific(String datasetSpecific) |
void |
setDirectoryDistance(int directoryDistance)
How many directories to recurse back from the current file to the Experiments/ directory
|
void |
setExperimentType(String experimentType)
The value of $1 (see comment above) in naming-structure.
|
void |
setIdentifierSuffix(String identifierSuffix) |
void |
setMaxNumberProcessors(int maxNumProcessors) |
void |
setSuppressExceptions(boolean suppressExceptions) |
void |
setTask(Task<T,S> task) |
boolean |
useDetailedLogging()
Whether to log in more or less detail.
|
getXMLConfiguration
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, toString
public QuickMultiDatasetStructuredExperiment()
public void localise(Path path) throws BeanMisconfiguredException
AnchorBean
It is sometimes useful to override this method so as to include other files.
localise
in class AnchorBean<Experiment>
path
- a path on the filesystem which is associated with the bean (can be null,
indicating no localization)BeanMisconfiguredException
- if a relative-path is passedpublic void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
AnchorBean
checkMisconfigured
in class AnchorBean<Experiment>
defaultInstances
- all available default instances if the DefaultInstance
annotation is usedBeanMisconfiguredException
- if the bean has not been configured properly as XMLpublic void associateXML(org.apache.commons.configuration.XMLConfiguration xmlConfiguration)
AssociateXMLUponLoad
associateXML
in interface AssociateXMLUponLoad
associateXML
in class Experiment
xmlConfiguration
- the xml-configuration to associate with an object.public void replaceOutputManager(OutputManager output) throws OperationFailedException
ReplaceOutputManager
OutputManager
with another.replaceOutputManager
in interface ReplaceOutputManager
output
- the task to replace.OperationFailedException
- if the task cannot be successfully replaced.public void replaceInputManager(InputManager<T> inputManager) throws OperationFailedException
ReplaceInputManager
replaceInputManager
in interface ReplaceInputManager<T extends InputFromManager>
inputManager
- the new input-manager that is assigned.OperationFailedException
- if the assignment cannot complete successfully.public Optional<Path> executeExperiment(ExecutionArguments arguments) throws ExperimentExecutionException
Experiment
executeExperiment
in class Experiment
arguments
- arguments that may influence how the experiment is run.ExperimentExecutionException
- if an error occurs executing the experiment.public boolean useDetailedLogging()
Experiment
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.
useDetailedLogging
in class Experiment
public String getDatasetSpecific()
public void setDatasetSpecific(String datasetSpecific)
public String getBeanExtension()
public void setBeanExtension(String beanExtension)
public String getIdentifierSuffix()
public void setIdentifierSuffix(String identifierSuffix)
public StringSet getDatasets()
public void setDatasets(StringSet datasets)
public int getMaxNumberProcessors()
public void setMaxNumberProcessors(int maxNumProcessors)
public boolean isSuppressExceptions()
public void setSuppressExceptions(boolean suppressExceptions)
public int getDirectoryDistance()
0 implies that the file is directly in Experiments/ 1 implies that the file is in Experiments/SOMESUBDIR/ etc.
public void setDirectoryDistance(int directoryDistance)
0 implies that the file is directly in Experiments/ 1 implies that the file is in Experiments/SOMESUBDIR/ etc.
public String getExperimentType()
public void setExperimentType(String experimentType)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.