Package adams.opt.genetic.setupupload
Class AbstractSetupUpload
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.opt.genetic.setupupload.AbstractSetupUpload
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,FlowContextHandler,Serializable
public abstract class AbstractSetupUpload extends AbstractOptionHandler implements FlowContextHandler
Ancestor for schemes that upload the setup of a genetic algorithm.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_FITNESSthe key for the fitness.static StringKEY_MEASUREthe key for the measure.protected Stringm_Experimentthe name of the experiment.protected Actorm_FlowContextthe flow context.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractSetupUpload()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected abstract voiddoFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)Finishing up the genetic algorithm run.protected abstract voiddoStart(AbstractGeneticAlgorithm algorithm)Before Starting the uploads, ie the genetic algorithm run.protected abstract StringdoUpload(Map<String,Object> setup)Uploads the setup.StringexperimentTipText()Returns the tip text for this property.voidfinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)Finishing up the genetic algorithm run.StringgetExperiment()Returns the experiment name to use.ActorgetFlowContext()Return the flow context, if any.abstract booleanrequiresFlowContext()Returns whether flow context is required.voidsetExperiment(String value)Sets the experiment name to use.voidsetFlowContext(Actor value)Sets the flow context, if any.voidstart(AbstractGeneticAlgorithm algorithm)Before Starting the uploads, ie the genetic algorithm run.static PropertiestoProperties(Map<String,Object> setup)Turns the setup map into a properties object.Stringupload(Map<String,Object> setup)Uploads the setup.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
KEY_MEASURE
public static final String KEY_MEASURE
the key for the measure.- See Also:
- Constant Field Values
-
KEY_FITNESS
public static final String KEY_FITNESS
the key for the fitness.- See Also:
- Constant Field Values
-
m_FlowContext
protected Actor m_FlowContext
the flow context.
-
m_Experiment
protected String m_Experiment
the name of the experiment.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setExperiment
public void setExperiment(String value)
Sets the experiment name to use.- Parameters:
value- the name
-
getExperiment
public String getExperiment()
Returns the experiment name to use.- Returns:
- the name
-
experimentTipText
public String experimentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context, if any.- Specified by:
setFlowContextin interfaceFlowContextHandler- Parameters:
value- the context
-
getFlowContext
public Actor getFlowContext()
Return the flow context, if any.- Specified by:
getFlowContextin interfaceFlowContextHandler- Returns:
- the context, null if none available
-
requiresFlowContext
public abstract boolean requiresFlowContext()
Returns whether flow context is required.- Returns:
- true if required
-
doStart
protected abstract void doStart(AbstractGeneticAlgorithm algorithm)
Before Starting the uploads, ie the genetic algorithm run.- Parameters:
algorithm- the algorithm initiating the run
-
start
public void start(AbstractGeneticAlgorithm algorithm)
Before Starting the uploads, ie the genetic algorithm run.- Parameters:
algorithm- the algorithm initiating the run
-
doUpload
protected abstract String doUpload(Map<String,Object> setup)
Uploads the setup.- Parameters:
setup- the setup data to upload- Returns:
- null if successful, otherwise error message
-
upload
public String upload(Map<String,Object> setup)
Uploads the setup.- Parameters:
setup- the setup data to upload- Returns:
- null if successful, otherwise error message
-
doFinish
protected abstract void doFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)
Finishing up the genetic algorithm run.- Parameters:
algorithm- the algorithm that initiated the runerror- null if successful, otherwise error messageparams- the parameters to store
-
finish
public void finish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)
Finishing up the genetic algorithm run.- Parameters:
algorithm- the algorithm that initiated the runerror- null if successful, otherwise error messageparams- the parameters to store
-
toProperties
public static Properties toProperties(Map<String,Object> setup)
Turns the setup map into a properties object.- Parameters:
setup- the setup to convert- Returns:
- the generated properties
-
-