es.udc.gii.common.eaf.log
Class LogTool
java.lang.Object
es.udc.gii.common.eaf.log.LogTool
- All Implemented Interfaces:
- Configurable, java.util.Observer
- Direct Known Subclasses:
- AllPopulationsLogTool, BestFEsLogTool, BestIndividualLogTool, BestMeanLogTool, BestSoFarFitnessEvolutionLogTool, CMABestFEsLogTool, CMABestIndividualLogTool, CMABestMeanLogTool, CMAFEsBestMeanLogTool, CMAFEsIndividualLogTool, CMAFEsToReachValueLogTool, ExtinctLogTool, FandCRParameterLogTool, FEsBestMeanLogTool, FEsIndividualLogTool, FEsToReachValueLogTool, MMGASummaryLogTool, NSGA2LogTool, ParallelLogTool, PopulationLogTool
public abstract class LogTool
- extends java.lang.Object
- implements java.util.Observer, Configurable
This abstract class represents a log tool, this is used to record the information generated
by the algorithm while its execution.
This tool implements the observer pattern, so the observable objects call to the update method
to print the information.
To configure a log tool that extend this class, the xml code of the configuration file should be as
follows:
<LogTool>
<Class>value</Class>
<Folder>value</Folder>
<Name>value</Name>
<!-- More parameters if they are necessary -->
</LogToo>
Where the tag Class is mandatory, and indicates the specific class to be used. The tags
Folder and Name are optional, and indicates the folder where the log will be recorded
and the name of the file, respectively. If these two tags do not appear, their defautl value is used.
Default values:
- Folder default value is "working_directory/OF".
- Name default value is ALG_POP_TS.txt (monoprocessor environment) or ALG_POP_TS_ND.txt (distributed environment).
- Since:
- 1.0
- Author:
- Grupo Integrado de IngenierĂa (www.gii.udc.es)
Method Summary |
void |
configure(org.apache.commons.configuration.Configuration conf)
Configures the specific element that implements this method. |
private void |
createFile(java.lang.String folder,
java.lang.String file_name)
|
protected void |
finalize()
|
java.io.PrintStream |
getLog()
|
java.lang.String |
getLogID()
|
java.lang.String |
getNodeID()
|
void |
setFile(java.lang.String fileName)
|
void |
update(java.util.Observable o,
java.lang.Object arg)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private java.io.PrintStream log
folder
private java.lang.String folder
name
protected java.lang.String name
fileExtension
protected java.lang.String fileExtension
doCreateFile
private boolean doCreateFile
oldName
protected java.lang.String oldName
oldFolder
protected java.lang.String oldFolder
LogTool
public LogTool()
createFile
private void createFile(java.lang.String folder,
java.lang.String file_name)
configure
public void configure(org.apache.commons.configuration.Configuration conf)
- Description copied from interface:
Configurable
- Configures the specific element that implements this method.
- Specified by:
configure
in interface Configurable
- Parameters:
conf
- a Configuration object.- See Also:
Configuration
getLog
public java.io.PrintStream getLog()
setFile
public void setFile(java.lang.String fileName)
getLogID
public java.lang.String getLogID()
getNodeID
public java.lang.String getNodeID()
update
public void update(java.util.Observable o,
java.lang.Object arg)
- Specified by:
update
in interface java.util.Observer
finalize
protected void finalize()
throws java.lang.Throwable
- Overrides:
finalize
in class java.lang.Object
- Throws:
java.lang.Throwable