Package ai.libs.jaicore.experiments
Class ExperimentRunner
- java.lang.Object
-
- ai.libs.jaicore.experiments.ExperimentRunner
-
- All Implemented Interfaces:
org.api4.java.common.control.ILoggingCustomizable
public class ExperimentRunner extends java.lang.Object implements org.api4.java.common.control.ILoggingCustomizableThis class is used to run experiments.
-
-
Constructor Summary
Constructors Constructor Description ExperimentRunner(ExperimentRunner other)Copy constructor for making a (shallow) copy of an already existing experiment runner.ExperimentRunner(IExperimentSetConfig config, IExperimentSetEvaluator evaluator, IExperimentDatabaseHandle databaseHandle)ExperimentRunner(IExperimentSetConfig config, IExperimentSetEvaluator evaluator, IExperimentDatabaseHandle databaseHandle, java.lang.String executorInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconductExperiment(ExperimentDBEntry expEntry)Conducts a single experiment The experiment is expected to be marked as started already.java.lang.StringgetLoggerName()booleanmightHaveMoreExperiments()voidrandomlyConductExperiments()Conducts an unbound number of randomly chosen experiments from the grid.voidrandomlyConductExperiments(int maxNumberOfExperiments)Conducts a limited number of not yet conducted experiments randomly chosen from the grid.voidrandomlyConductExperimentsInParallel(int maxNumberOfExperiments, int numThreads)Conducts a limited number of not yet conducted experiments randomly chosen from the grid.voidsequentiallyConductExperiments()Conducts an unbound number of experiments from the grid.voidsequentiallyConductExperiments(int maxNumberOfExperiments)voidsetCheckMemory(boolean checkMemory)voidsetLoggerName(java.lang.String name)
-
-
-
Constructor Detail
-
ExperimentRunner
public ExperimentRunner(IExperimentSetConfig config, IExperimentSetEvaluator evaluator, IExperimentDatabaseHandle databaseHandle) throws ExperimentDBInteractionFailedException
-
ExperimentRunner
public ExperimentRunner(IExperimentSetConfig config, IExperimentSetEvaluator evaluator, IExperimentDatabaseHandle databaseHandle, java.lang.String executorInfo) throws ExperimentDBInteractionFailedException
-
ExperimentRunner
public ExperimentRunner(ExperimentRunner other)
Copy constructor for making a (shallow) copy of an already existing experiment runner.- Parameters:
other- The experiment runner to be copied.
-
-
Method Detail
-
setCheckMemory
public void setCheckMemory(boolean checkMemory)
-
randomlyConductExperiments
public void randomlyConductExperiments(int maxNumberOfExperiments) throws ExperimentDBInteractionFailedException, java.lang.InterruptedExceptionConducts a limited number of not yet conducted experiments randomly chosen from the grid.- Parameters:
maxNumberOfExperiments- Limit for the number of experiments- Throws:
ExperimentDBInteractionFailedExceptionjava.lang.InterruptedException
-
randomlyConductExperimentsInParallel
public void randomlyConductExperimentsInParallel(int maxNumberOfExperiments, int numThreads) throws java.lang.InterruptedException, ExperimentDBInteractionFailedExceptionConducts a limited number of not yet conducted experiments randomly chosen from the grid.- Parameters:
maxNumberOfExperiments- Limit for the number of experimentsnumThreads- Number of threads for running multiple copies of the experiment runner in parallel.- Throws:
ExperimentDBInteractionFailedExceptionjava.lang.InterruptedException
-
sequentiallyConductExperiments
public void sequentiallyConductExperiments(int maxNumberOfExperiments) throws ExperimentDBInteractionFailedException, java.lang.InterruptedException- Throws:
ExperimentDBInteractionFailedExceptionjava.lang.InterruptedException
-
randomlyConductExperiments
public void randomlyConductExperiments() throws ExperimentDBInteractionFailedException, java.lang.InterruptedExceptionConducts an unbound number of randomly chosen experiments from the grid.- Throws:
ExperimentDBInteractionFailedExceptionjava.lang.InterruptedException
-
sequentiallyConductExperiments
public void sequentiallyConductExperiments() throws ExperimentDBInteractionFailedException, java.lang.InterruptedExceptionConducts an unbound number of experiments from the grid.- Throws:
ExperimentDBInteractionFailedExceptionjava.lang.InterruptedException
-
conductExperiment
protected void conductExperiment(ExperimentDBEntry expEntry) throws ExperimentDBInteractionFailedException, java.lang.InterruptedException
Conducts a single experiment The experiment is expected to be marked as started already.- Parameters:
expEntry- the experiment to be conducted- Throws:
ExperimentDBInteractionFailedExceptionExperimentAlreadyStartedExceptionjava.lang.InterruptedExceptionjava.lang.Exception- These are not the exceptions thrown by the experiment itself, because these are logged into the database. Exceptions thrown here are technical exceptions that occur when arranging the experiment
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
mightHaveMoreExperiments
public boolean mightHaveMoreExperiments()
-
-