marf
Class Configuration

java.lang.Object
  extended by marf.Configuration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Configuration
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Encapsulates MARF configuration parameters for serialization to disk or network.

$Id: Configuration.java,v 1.4 2008/01/08 17:54:51 mokhov Exp $

Since:
0.3.0.6
Version:
$Revision: 1.4 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  boolean bDebug
          Debug flag.
protected  boolean bDumpSpectrogram
          Indicates whether or not to dump a spectrogram at the end of feature extraction.
protected  boolean bDumpWaveGraph
          Indicates whether or not to dump a wave graph.
protected  int iClassificationMethod
          Indicates what classification method to use in the pipeline.
protected  int iCurrentSubject
          ID of the currently trained speaker.
protected  int iFeatureExtractionMethod
          Indicates what feature extraction method to use in the pipeline.
protected  int iPreprocessingMethod
          Indicates what preprocessing method to use in the pipeline.
protected  int iSampleFormat
          Indicates what sample format is in use.
protected  ModuleParams oModuleParams
          Stores module-specific parameters in an independent way.
protected  java.lang.String strClassificationPluginClass
          Fully-qualified class name of a classification plug-in.
protected  java.lang.String strFeatureExtractionPluginClass
          Fully-qualified class name of a feature extraction plug-in.
protected  java.lang.String strFileName
          Indicates current incoming sample filename.
protected  java.lang.String strPreprocessingPluginClass
          Fully-qualified class name of a preprocessing plug-in.
protected  java.lang.String strSampleLoaderPluginClass
          Fully-qualified class name of a sample loader plug-in.
protected  java.lang.String strSamplesDir
          Indicates directory name with training samples.
 
Constructor Summary
Configuration()
           
Configuration(Configuration poConfiguration)
          Copy-constructor.
Configuration(int piPreprocessingMethod, int piFeatureExtractionMethod, int piClassificationMethod, int piSampleFormat, int piCurrentSubject, java.lang.String pstrFileName, java.lang.String pstrSamplesDir, ModuleParams poModuleParams, boolean pbDumpSpectrogram, boolean pbDumpWaveGraph, java.lang.String pstrSampleLoaderPluginClass, java.lang.String pstrPreprocessingPluginClass, java.lang.String pstrFeatureExtractionPluginClass, java.lang.String pstrClassificationPluginClass, boolean pbDebug)
          All-fields constructor.
 
Method Summary
 java.lang.Object clone()
           
 int getClassificationMethod()
           
 java.lang.String getClassificationPluginClass()
           
 int getCurrentSubject()
           
 int getFeatureExtractionMethod()
           
 java.lang.String getFeatureExtractionPluginClass()
           
 java.lang.String getFileName()
           
 ModuleParams getModuleParams()
           
 int getPreprocessingMethod()
           
 java.lang.String getPreprocessingPluginClass()
           
 int getSampleFormat()
           
 java.lang.String getSampleLoaderPluginClass()
           
 java.lang.String getSamplesDir()
           
 boolean isDebugOn()
           
 boolean isDumpSpectrogramOn()
           
 boolean isDumpWaveGraphOn()
           
 void setClassificationMethod(int piClassificationMethod)
           
 void setClassificationPluginClass(java.lang.String pstrClassificationPluginClass)
           
 void setCurrentSubject(int piCurrentSubject)
           
 void setDebug(boolean pbDebug)
           
 void setDumpSpectrogram(boolean pbDumpSpectrogram)
           
 void setDumpWaveGraph(boolean pbDumpWaveGraph)
           
 void setFeatureExtractionMethod(int piFeatureExtractionMethod)
           
 void setFeatureExtractionPluginClass(java.lang.String pstrFeatureExtractionPluginClass)
           
 void setFileName(java.lang.String pstrFileName)
           
 void setModuleParams(ModuleParams poModuleParams)
           
 void setPreprocessingMethod(int piPreprocessingMethod)
           
 void setPreprocessingPluginClass(java.lang.String pstrPreprocessingPluginClass)
           
 void setSampleFormat(int piSampleFormat)
           
 void setSampleLoaderPluginClass(java.lang.String pstrSampleLoaderPluginClass)
           
 void setSamplesDir(java.lang.String pstrSamplesDir)
           
 java.lang.String[] toArgumentVector()
          Converts configuration to argv-type of array using Properties with name=value pairs for each configuration element.
 ModuleParams toModuleParams()
           
 java.util.Properties toProperties()
          Converts the encapsulated configuration to the Properties-style format.
 java.lang.String toString()
          Returns String representation of Configuration by converting Properties to the String format.
 java.util.Vector toVector()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iPreprocessingMethod

protected int iPreprocessingMethod
Indicates what preprocessing method to use in the pipeline.


iFeatureExtractionMethod

protected int iFeatureExtractionMethod
Indicates what feature extraction method to use in the pipeline.


iClassificationMethod

protected int iClassificationMethod
Indicates what classification method to use in the pipeline.


iSampleFormat

protected int iSampleFormat
Indicates what sample format is in use.


iCurrentSubject

protected int iCurrentSubject
ID of the currently trained speaker.


strFileName

protected java.lang.String strFileName
Indicates current incoming sample filename.


strSamplesDir

protected java.lang.String strSamplesDir
Indicates directory name with training samples.


oModuleParams

protected ModuleParams oModuleParams
Stores module-specific parameters in an independent way.


bDumpSpectrogram

protected boolean bDumpSpectrogram
Indicates whether or not to dump a spectrogram at the end of feature extraction.


bDumpWaveGraph

protected boolean bDumpWaveGraph
Indicates whether or not to dump a wave graph.


strSampleLoaderPluginClass

protected java.lang.String strSampleLoaderPluginClass
Fully-qualified class name of a sample loader plug-in.


strPreprocessingPluginClass

protected java.lang.String strPreprocessingPluginClass
Fully-qualified class name of a preprocessing plug-in.


strFeatureExtractionPluginClass

protected java.lang.String strFeatureExtractionPluginClass
Fully-qualified class name of a feature extraction plug-in.


strClassificationPluginClass

protected java.lang.String strClassificationPluginClass
Fully-qualified class name of a classification plug-in.


bDebug

protected boolean bDebug
Debug flag.

Constructor Detail

Configuration

public Configuration()

Configuration

public Configuration(int piPreprocessingMethod,
                     int piFeatureExtractionMethod,
                     int piClassificationMethod,
                     int piSampleFormat,
                     int piCurrentSubject,
                     java.lang.String pstrFileName,
                     java.lang.String pstrSamplesDir,
                     ModuleParams poModuleParams,
                     boolean pbDumpSpectrogram,
                     boolean pbDumpWaveGraph,
                     java.lang.String pstrSampleLoaderPluginClass,
                     java.lang.String pstrPreprocessingPluginClass,
                     java.lang.String pstrFeatureExtractionPluginClass,
                     java.lang.String pstrClassificationPluginClass,
                     boolean pbDebug)
All-fields constructor.

Parameters:
piPreprocessingMethod -
piFeatureExtractionMethod -
piClassificationMethod -
piSampleFormat -
piCurrentSubject -
pstrFileName -
pstrSamplesDir -
poModuleParams -
pbDumpSpectrogram -
pbDumpWaveGraph -
pstrSampleLoaderPluginClass -
pstrPreprocessingPluginClass -
pstrFeatureExtractionPluginClass -
pstrClassificationPluginClass -
pbDebug -

Configuration

public Configuration(Configuration poConfiguration)
Copy-constructor.

Parameters:
poConfiguration -
Method Detail

toProperties

public java.util.Properties toProperties()
Converts the encapsulated configuration to the Properties-style format. Primarily used for debugging at this point. TODO: document/standardize/constify property keys.

Returns:
instance of java.util.Properties with MARF configuration.
See Also:
Properties, toString()

toModuleParams

public ModuleParams toModuleParams()
Returns:
Throws:
NotImplementedException

toArgumentVector

public java.lang.String[] toArgumentVector()
Converts configuration to argv-type of array using Properties with name=value pairs for each configuration element.

Returns:
array of strings representing
See Also:
toProperties()

toVector

public java.util.Vector toVector()
Returns:

isDebugOn

public boolean isDebugOn()
Returns:
Returns the bDebug.

setDebug

public void setDebug(boolean pbDebug)
Parameters:
pbDebug - The bDebug to set.

isDumpSpectrogramOn

public boolean isDumpSpectrogramOn()
Returns:
Returns the bDumpSpectrogram.

setDumpSpectrogram

public void setDumpSpectrogram(boolean pbDumpSpectrogram)
Parameters:
pbDumpSpectrogram - The bDumpSpectrogram to set.

isDumpWaveGraphOn

public boolean isDumpWaveGraphOn()
Returns:
Returns the bDumpWaveGraph.

setDumpWaveGraph

public void setDumpWaveGraph(boolean pbDumpWaveGraph)
Parameters:
pbDumpWaveGraph - The bDumpWaveGraph to set.

getClassificationMethod

public int getClassificationMethod()
Returns:
Returns the iClassificationMethod.

setClassificationMethod

public void setClassificationMethod(int piClassificationMethod)
Parameters:
piClassificationMethod - The iClassificationMethod to set.

getCurrentSubject

public int getCurrentSubject()
Returns:
Returns the iCurrentSubject.

setCurrentSubject

public void setCurrentSubject(int piCurrentSubject)
Parameters:
piCurrentSubject - The iCurrentSubject to set.

getFeatureExtractionMethod

public int getFeatureExtractionMethod()
Returns:
Returns the iFeatureExtractionMethod.

setFeatureExtractionMethod

public void setFeatureExtractionMethod(int piFeatureExtractionMethod)
Parameters:
piFeatureExtractionMethod - The iFeatureExtractionMethod to set.

getPreprocessingMethod

public int getPreprocessingMethod()
Returns:
Returns the iPreprocessingMethod.

setPreprocessingMethod

public void setPreprocessingMethod(int piPreprocessingMethod)
Parameters:
piPreprocessingMethod - The iPreprocessingMethod to set.

getSampleFormat

public int getSampleFormat()
Returns:
Returns the iSampleFormat.

setSampleFormat

public void setSampleFormat(int piSampleFormat)
Parameters:
piSampleFormat - The iSampleFormat to set.

getClassificationPluginClass

public java.lang.String getClassificationPluginClass()
Returns:
Returns the oClassificationPluginClass.

setClassificationPluginClass

public void setClassificationPluginClass(java.lang.String pstrClassificationPluginClass)
Parameters:
pstrClassificationPluginClass - The oClassificationPluginClass to set.

getFeatureExtractionPluginClass

public java.lang.String getFeatureExtractionPluginClass()
Returns:
Returns the oFeatureExtractionPluginClass.

setFeatureExtractionPluginClass

public void setFeatureExtractionPluginClass(java.lang.String pstrFeatureExtractionPluginClass)
Parameters:
pstrFeatureExtractionPluginClass - The oFeatureExtractionPluginClass to set.

getModuleParams

public ModuleParams getModuleParams()
Returns:
Returns the oModuleParams.

setModuleParams

public void setModuleParams(ModuleParams poModuleParams)
Parameters:
poModuleParams - The oModuleParams to set.

getPreprocessingPluginClass

public java.lang.String getPreprocessingPluginClass()
Returns:
Returns the oPreprocessingPluginClass.

setPreprocessingPluginClass

public void setPreprocessingPluginClass(java.lang.String pstrPreprocessingPluginClass)
Parameters:
pstrPreprocessingPluginClass - The oPreprocessingPluginClass to set.

getSampleLoaderPluginClass

public java.lang.String getSampleLoaderPluginClass()
Returns:
Returns the oSampleLoaderPluginClass.

setSampleLoaderPluginClass

public void setSampleLoaderPluginClass(java.lang.String pstrSampleLoaderPluginClass)
Parameters:
pstrSampleLoaderPluginClass - The oSampleLoaderPluginClass to set.

getFileName

public java.lang.String getFileName()
Returns:
Returns the strFileName.

setFileName

public void setFileName(java.lang.String pstrFileName)
Parameters:
pstrFileName - The strFileName to set.

getSamplesDir

public java.lang.String getSamplesDir()
Returns:
Returns the strSamplesDir.

setSamplesDir

public void setSamplesDir(java.lang.String pstrSamplesDir)
Parameters:
pstrSamplesDir - The strSamplesDir to set.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

toString

public java.lang.String toString()
Returns String representation of Configuration by converting Properties to the String format. Primarily for debugging.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString(), toProperties()


SourceForge Logo