yawn.envs.synthetic
Class SyntheticDataEnvironment

java.lang.Object
  extended by yawn.envs.Environment
      extended by yawn.envs.synthetic.SyntheticDataEnvironment
Direct Known Subclasses:
CircleInTheSquareEnvironment, XOrDataEnvironment

public abstract class SyntheticDataEnvironment
extends Environment

An abstract class that represents a Synthetic environment . A synthetic environment is one that produces the data by sampling an apriori known function. These type of environments are most usefull for automated testing.
$Id: SyntheticDataEnvironment.java,v 1.4 2005/04/07 17:28:26 supermarti Exp $

Version:
$Revision: 1.4 $
Author:
Luis Martí (luis dot marti at uc3m dot es)

Field Summary
protected static org.apache.commons.logging.Log log
           
protected  int numberOfSystemRuns
           
protected  int testSetSize
           
protected  java.util.ArrayList testSetsList
           
protected  int trainSetSize
           
protected  java.util.ArrayList trainSetsList
           
 
Constructor Summary
SyntheticDataEnvironment()
           
 
Method Summary
protected abstract  Pattern generateRandomInput()
           
protected  InputOutputPattern[] generateSet(int setSize)
           
 InputOutputPattern[] getFullTestDataset(int runNumber)
           
 int getNumberOfSystemRuns()
          Returns the number of times the system will be run.
 InputOutputPattern[] getTestDataset(int runNumber)
           
 Pattern[] getTestDatasetInputs(int runNumber)
          Reads a test dataset from the environment.
 Pattern[] getTestExpectedOutputsSet(int runNumber)
           
 int getTestSetSize()
           
 InputOutputPattern[] getTrainingDataset(int runNumber)
          Reads a train file from the environment.
 int getTrainSetSize()
           
 void init()
           
 int inputSize()
           
 int outputSize()
           
 void setNumberOfSystemRuns(int numberOfRuns)
           
 void setTestSetSize(int testSetSize)
           
 void setTrainSetSize(int trainSetSize)
           
protected abstract  Pattern synthetizeOutput(Pattern input)
           
 void validate()
           
 void writeResults(Pattern[] results, int runNumber)
           
 
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

log

protected static final org.apache.commons.logging.Log log

trainSetSize

protected int trainSetSize

testSetSize

protected int testSetSize

numberOfSystemRuns

protected int numberOfSystemRuns

trainSetsList

protected java.util.ArrayList trainSetsList

testSetsList

protected java.util.ArrayList testSetsList
Constructor Detail

SyntheticDataEnvironment

public SyntheticDataEnvironment()
Method Detail

getTestSetSize

public int getTestSetSize()

setTestSetSize

public void setTestSetSize(int testSetSize)

getTrainSetSize

public int getTrainSetSize()

setTrainSetSize

public void setTrainSetSize(int trainSetSize)

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

setNumberOfSystemRuns

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

init

public void init()

getTrainingDataset

public InputOutputPattern[] getTrainingDataset(int runNumber)
                                        throws EnvironmentException
Description copied from class: Environment
Reads a train file from the environment.

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

generateSet

protected InputOutputPattern[] generateSet(int setSize)

generateRandomInput

protected abstract Pattern generateRandomInput()

synthetizeOutput

protected abstract Pattern synthetizeOutput(Pattern input)

getTestDatasetInputs

public Pattern[] getTestDatasetInputs(int runNumber)
                               throws EnvironmentException
Description copied from class: Environment
Reads a test dataset from the environment. 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

getTestDataset

public InputOutputPattern[] getTestDataset(int runNumber)
                                    throws EnvironmentException
Throws:
EnvironmentException

getTestExpectedOutputsSet

public Pattern[] getTestExpectedOutputsSet(int runNumber)
                                    throws EnvironmentException
Throws:
EnvironmentException

getFullTestDataset

public InputOutputPattern[] getFullTestDataset(int runNumber)

writeResults

public void writeResults(Pattern[] results,
                         int runNumber)
                  throws EnvironmentException
Specified by:
writeResults in class Environment
Throws:
EnvironmentException

validate

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

inputSize

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

outputSize

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


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