jAudioFeatureExtractor.ACE.DataTypes
Class Batch

java.lang.Object
  extended by jAudioFeatureExtractor.ACE.DataTypes.Batch
All Implemented Interfaces:
java.io.Serializable

public class Batch
extends java.lang.Object
implements java.io.Serializable

Data type used to represent a batch file.

Author:
Daniel McEnnis
See Also:
Serialized Form

Constructor Summary
Batch()
           
 
Method Summary
 void applySettings(RecordingInfo[][] recording, int[] windowSize, double[] windowOverlap, double[] samplingRate, boolean[] normalise, boolean[] perWindow, boolean[] overall, java.lang.String[] destinationFK, java.lang.String[] destinationFV, int[] outputType)
          apply this batch against info needed for a datamodel so that it can be executed.
 void execute()
          Execute this batch by first setting the context ass specified in the batch, then executing using the data model.
 java.util.HashMap<java.lang.String,java.lang.Boolean> getActivated()
           
 Aggregator[] getAggregator()
           
 java.lang.String[][] getAggregatorFeatures()
           
 java.lang.String[] getAggregatorNames()
           
 java.lang.String[][] getAggregatorParameters()
           
 java.util.HashMap<java.lang.String,java.lang.String[]> getAttributes()
           
 DataModel getDataModel()
           
 java.lang.String getDestinationFK()
           
 java.lang.String getDestinationFV()
           
 java.lang.String getName()
          Returns the name of this batch.
 int getOutputType()
           
 RecordingInfo[] getRecording()
           
 double getSamplingRate()
           
 double getWindowOverlap()
           
 int getWindowSize()
           
 boolean isNormalise()
           
 boolean isOverall()
           
 boolean isPerWindow()
           
 java.lang.String outputXML()
          Output this batch in XML format.
 void setAggregators(java.lang.String[] aggNames, java.lang.String[][] aggFeatures, java.lang.String[][] aggParam)
           
 void setAttributes(java.util.HashMap<java.lang.String,java.lang.String[]> attributes)
           
 void setDataModel(DataModel dm)
          Set the data model against which this batch is executed.
 void setDestination(java.lang.String FK, java.lang.String FV)
          Sets where the extracted features should be stored.
 void setDestinationFK(java.lang.String destinationFK)
           
 void setDestinationFV(java.lang.String destinationFV)
           
 void setFeatures(java.util.HashMap<java.lang.String,java.lang.Boolean> activated, java.util.HashMap<java.lang.String,java.lang.String[]> attributes)
          Sets which features are active and the parameters of these features.
 void setName(java.lang.String name)
          Sets the name of this batch.
 void setNormalise(boolean normalise)
           
 void setOutputType(int outputType)
           
 void setOverall(boolean overall)
           
 void setPerWindow(boolean perWindow)
           
 void setRecording(RecordingInfo[] recording)
           
 void setRecordings(java.io.File[] files)
          Sets the recordings that this batch will load and execute.
 void setSamplingRate(double samplingRate)
           
 void setSettings(int windowSize, double windowOverlap, double samplingRate, boolean normalise, boolean perWindow, boolean overall, int outputType)
          Sets the attributes for how the features are to be extracted when executed.
 void setWindowOverlap(double windowOverlap)
           
 void setWindowSize(int windowSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Batch

public Batch()
Method Detail

setDataModel

public void setDataModel(DataModel dm)
Set the data model against which this batch is executed.

Parameters:
dm - Context of this batch.

execute

public void execute()
             throws java.lang.Exception
Execute this batch by first setting the context ass specified in the batch, then executing using the data model.

Throws:
java.lang.Exception

setRecordings

public void setRecordings(java.io.File[] files)
                   throws java.lang.Exception
Sets the recordings that this batch will load and execute.

Parameters:
files - recordings which are to be scheduled for porcessing.
Throws:
java.lang.Exception

setSettings

public void setSettings(int windowSize,
                        double windowOverlap,
                        double samplingRate,
                        boolean normalise,
                        boolean perWindow,
                        boolean overall,
                        int outputType)
Sets the attributes for how the features are to be extracted when executed.

Parameters:
windowSize - Size of the analysis window in samples.
windowOverlap - Percent overlap of the windows. Must be greater than or equal to 0 and less than 1.
samplingRate - number of samples per second of audio.
normalise - should the files be normalised before execution.
perWindow - should features be extracted for each window in each file.
overall - should overall features be extracted for each files.
outputType - what format should the extracted features be saved in.

setDestination

public void setDestination(java.lang.String FK,
                           java.lang.String FV)
Sets where the extracted features should be stored.

Parameters:
FK - Location where feature descriptions should be stored.
FV - Location where extracted features should be stored.

setFeatures

public void setFeatures(java.util.HashMap<java.lang.String,java.lang.Boolean> activated,
                        java.util.HashMap<java.lang.String,java.lang.String[]> attributes)
Sets which features are active and the parameters of these features.

Parameters:
activated - Which features are to be extracted.
attributes - settings of parameters of these features.

getName

public java.lang.String getName()
Returns the name of this batch.

Returns:
name assigned to this batch.

setName

public void setName(java.lang.String name)
Sets the name of this batch. This name must be unique.

Parameters:
name - Name of this batch.

getAggregator

public Aggregator[] getAggregator()
                           throws java.lang.Exception
Throws:
java.lang.Exception

outputXML

public java.lang.String outputXML()
Output this batch in XML format.

Returns:
String contains a complete batch XML file.

applySettings

public void applySettings(RecordingInfo[][] recording,
                          int[] windowSize,
                          double[] windowOverlap,
                          double[] samplingRate,
                          boolean[] normalise,
                          boolean[] perWindow,
                          boolean[] overall,
                          java.lang.String[] destinationFK,
                          java.lang.String[] destinationFV,
                          int[] outputType)
apply this batch against info needed for a datamodel so that it can be executed.

Parameters:
recording - list of files to be analyzed
windowSize - size of the analysis window in samples
windowOverlap - percent overlap as a value between 0 and 1.
samplingRate - number of samples per second
normalise - should the file be normalized before execution
perWindow - should features be extracted on a window bby window basis
overall - should global features be extracted
destinationFK - location of the feature declaration file
destinationFV - location where extracted features should be stored
outputType - what output format should extracted features be stored in.

getAttributes

public java.util.HashMap<java.lang.String,java.lang.String[]> getAttributes()

getActivated

public java.util.HashMap<java.lang.String,java.lang.Boolean> getActivated()

setAttributes

public void setAttributes(java.util.HashMap<java.lang.String,java.lang.String[]> attributes)

getDestinationFK

public java.lang.String getDestinationFK()

setDestinationFK

public void setDestinationFK(java.lang.String destinationFK)

getDestinationFV

public java.lang.String getDestinationFV()

setDestinationFV

public void setDestinationFV(java.lang.String destinationFV)

isNormalise

public boolean isNormalise()

setNormalise

public void setNormalise(boolean normalise)

getOutputType

public int getOutputType()

setOutputType

public void setOutputType(int outputType)

isOverall

public boolean isOverall()

setOverall

public void setOverall(boolean overall)

isPerWindow

public boolean isPerWindow()

setPerWindow

public void setPerWindow(boolean perWindow)

getSamplingRate

public double getSamplingRate()

setSamplingRate

public void setSamplingRate(double samplingRate)

getWindowOverlap

public double getWindowOverlap()

setWindowOverlap

public void setWindowOverlap(double windowOverlap)

getWindowSize

public int getWindowSize()

setWindowSize

public void setWindowSize(int windowSize)

setRecording

public void setRecording(RecordingInfo[] recording)

getRecording

public RecordingInfo[] getRecording()

getDataModel

public DataModel getDataModel()

setAggregators

public void setAggregators(java.lang.String[] aggNames,
                           java.lang.String[][] aggFeatures,
                           java.lang.String[][] aggParam)

getAggregatorNames

public java.lang.String[] getAggregatorNames()

getAggregatorFeatures

public java.lang.String[][] getAggregatorFeatures()

getAggregatorParameters

public java.lang.String[][] getAggregatorParameters()