Package adams.opt.genetic.setupupload
Class MySQL
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,FlowContextHandler,Serializable
public class MySQL extends AbstractSetupUpload
Stores the setup information in the specified MySQL table.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_SUCCESSFULprotected AbstractDatabaseConnectionm_DatabaseConnectionthe database connection.protected Stringm_Tablethe table to store the setups in.-
Fields inherited from class adams.opt.genetic.setupupload.AbstractSetupUpload
KEY_FITNESS, KEY_MEASURE, m_Experiment, m_FlowContext
-
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 MySQL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected voiddoFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)Finishing up the genetic algorithm run.protected voiddoStart(AbstractGeneticAlgorithm algorithm)Before Starting the uploads, ie the genetic algorithm run.protected StringdoUpload(Map<String,Object> setup)Uploads the setup.StringgetTable()Returns the table name to use.StringglobalInfo()Returns a string describing the object.protected StringinitDatabase()Initializes the database connection, if necessary.protected StringinitTable()Initializes the table.booleanrequiresFlowContext()Returns whether flow context is required.protected voidreset()Resets the scheme.voidsetTable(String value)Sets the table name to use.StringtableTipText()Returns the tip text for this property.-
Methods inherited from class adams.opt.genetic.setupupload.AbstractSetupUpload
experimentTipText, finish, getExperiment, getFlowContext, setExperiment, setFlowContext, start, toProperties, upload
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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_SUCCESSFUL
public static final String KEY_SUCCESSFUL
- See Also:
- Constant Field Values
-
m_Table
protected String m_Table
the table to store the setups in.
-
m_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractSetupUpload
-
setTable
public void setTable(String value)
Sets the table name to use.- Parameters:
value- the name
-
getTable
public String getTable()
Returns the table name to use.- Returns:
- the name
-
tableTipText
public String tableTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
requiresFlowContext
public boolean requiresFlowContext()
Returns whether flow context is required.- Specified by:
requiresFlowContextin classAbstractSetupUpload- Returns:
- true if required
-
doStart
protected void doStart(AbstractGeneticAlgorithm algorithm)
Before Starting the uploads, ie the genetic algorithm run.- Specified by:
doStartin classAbstractSetupUpload- Parameters:
algorithm- the algorithm initiating the run
-
initDatabase
protected String initDatabase()
Initializes the database connection, if necessary.- Returns:
- null if successful or already initialized, otherwise error message
-
initTable
protected String initTable()
Initializes the table.- Returns:
- null if successful or already initialized, otherwise error message
-
doUpload
protected String doUpload(Map<String,Object> setup)
Uploads the setup.- Specified by:
doUploadin classAbstractSetupUpload- Parameters:
setup- the setup data to upload- Returns:
- null if successful, otherwise error message
-
doFinish
protected void doFinish(AbstractGeneticAlgorithm algorithm, String error, Map<String,Object> params)
Finishing up the genetic algorithm run.- Specified by:
doFinishin classAbstractSetupUpload- Parameters:
algorithm- the algorithm that initiated the runerror- null if successful, otherwise error messageparams- the parameters to store
-
-