yawn.envs.delve
Class DelveEnvironment

java.lang.Object
  extended by yawn.envs.Environment
      extended by yawn.envs.delve.DelveEnvironment

public class DelveEnvironment
extends Environment


Field Summary
protected static java.lang.String GUESS_FILE_NAME
           
protected  int inputSize
           
protected  int outputSize
           
protected  boolean parsed
           
protected  java.lang.String problemDirectory
           
protected  java.lang.String resultsDirectory
           
protected static java.lang.String TEST_FILE_NAME
           
protected static java.lang.String TRAIN_FILE_NAME
           
 
Constructor Summary
DelveEnvironment()
           
 
Method Summary
 int getNumberOfSystemRuns()
          Returns the number of times the system will be run.
 java.lang.String getProblemDirectory()
           
 java.lang.String getResultsDirectory()
           
 Pattern[] getTestDatasetInputs(int runNumber)
          Reads a test data file from a DELVE directory.
 InputOutputPattern[] getTrainingDataset(int runNumber)
          Reads a train file from a DELVE directory.
protected  void init()
           
 int inputSize()
           
protected  InputOutputPattern[] loadInputOutputFile(java.lang.String fileName, int numberOfOutputs)
          Reads a file in DELVE format.
 int outputSize()
           
 void setNumberOfSystemRuns(int numberOfRuns)
           
 void setProblemDirectory(java.lang.String problemDirectory)
           
 void setResultsDirectory(java.lang.String resultsDirectory)
           
 void validate()
           
 void writeResults(Pattern[] results, int runNumber)
          Writes a DELVE cguess file representing the predictions of a neural network.
 
Methods inherited from class yawn.envs.Environment
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GUESS_FILE_NAME

protected static final java.lang.String GUESS_FILE_NAME
See Also:
Constant Field Values

TEST_FILE_NAME

protected static final java.lang.String TEST_FILE_NAME
See Also:
Constant Field Values

TRAIN_FILE_NAME

protected static final java.lang.String TRAIN_FILE_NAME
See Also:
Constant Field Values

inputSize

protected int inputSize

outputSize

protected int outputSize

parsed

protected boolean parsed

problemDirectory

protected java.lang.String problemDirectory

resultsDirectory

protected java.lang.String resultsDirectory
Constructor Detail

DelveEnvironment

public DelveEnvironment()
Method Detail

getNumberOfSystemRuns

public int getNumberOfSystemRuns()
Description copied from class: Environment
Returns the number of times the system will be run. Do not mistake the term "system run" with "epoch"

Specified by:
getNumberOfSystemRuns in class Environment
Returns:
total number of system runs
See Also:
Environment.getNumberOfSystemRuns()

outputSize

public int outputSize()
Specified by:
outputSize in class Environment

inputSize

public int inputSize()
Specified by:
inputSize in class Environment

getProblemDirectory

public java.lang.String getProblemDirectory()
Returns:
Returns the problemDirectory.

getResultsDirectory

public java.lang.String getResultsDirectory()
Returns:
Returns the resultsDirectory.

getTestDatasetInputs

public Pattern[] getTestDatasetInputs(int runNumber)
                               throws EnvironmentException
Reads a test data file from a DELVE directory. The test set is a input-only file.

Specified by:
getTestDatasetInputs in class Environment
Parameters:
runNumber - the number of the current system run
Returns:
Test set
Throws:
EnvironmentException
See Also:
Environment.getTestDatasetInputs(int)

getTrainingDataset

public InputOutputPattern[] getTrainingDataset(int runNumber)
                                        throws EnvironmentException
Reads a train file from a DELVE directory.

Specified by:
getTrainingDataset in class Environment
Parameters:
runNumber - the number of the current system run
Returns:
the training set as an array of InputOutputPattern
Throws:
EnvironmentException
See Also:
Environment.getTrainingDataset(int)

init

protected void init()
             throws EnvironmentException
Throws:
EnvironmentException

loadInputOutputFile

protected InputOutputPattern[] loadInputOutputFile(java.lang.String fileName,
                                                   int numberOfOutputs)
                                            throws EnvironmentException
Reads a file in DELVE format. The last numberOfOutpus columns are selected as outputs.

Returns:
an array of InputOutputPattern loaded from the file.
Throws:
EnvironmentException

setNumberOfSystemRuns

public void setNumberOfSystemRuns(int numberOfRuns)
Specified by:
setNumberOfSystemRuns in class Environment

setProblemDirectory

public void setProblemDirectory(java.lang.String problemDirectory)
Parameters:
problemDirectory - The problemDirectory to set.

setResultsDirectory

public void setResultsDirectory(java.lang.String resultsDirectory)
Parameters:
resultsDirectory - The resultsDirectory to set.

validate

public void validate()
              throws ValidationException
Specified by:
validate in class Environment
Throws:
ValidationException
See Also:
Environment.validate()

writeResults

public void writeResults(Pattern[] results,
                         int runNumber)
                  throws EnvironmentException
Writes a DELVE cguess file representing the predictions of a neural network.

Specified by:
writeResults in class Environment
Parameters:
results - the results to be written
runNumber - the number of the current system run
Throws:
EnvironmentException


Copyright © 2003-2005 GIAA, Universidad Carlos III de Madrid. All Rights Reserved.