gpalta.core
Class ProblemData

java.lang.Object
  extended by gpalta.core.ProblemData
All Implemented Interfaces:
java.io.Serializable

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

Holds the problem's data and provides methods to access it.

See Also:
Serialized Form

Field Summary
 int nSamples
           
 int nVars
           
 double sigmaOpt2
           
 
Constructor Summary
ProblemData(double[][] data)
          Initialize the data from the given matrix.
ProblemData(java.lang.String fileName, java.lang.String separator)
          Initialize the data from a file
 
Method Summary
 double getAngleCurrentSample(int wAngle)
           
 double[] getAngles(int wAngle)
           
 double[] getCurrentSample()
          Get the current sample (all variables)
 double getData(int whichVar)
          Get the current value for a variable
 double[] getDataVect(int whichVar)
          Get all values (in all samples) for a variable
 double getMax(int whichVar)
          Get the maximum value of a certain variable
 double getMin(int whichVar)
          Get the minimum value of a certain variable
 double getNormCurrentSample()
           
 double[] getNorms()
           
 double getRange(int wVar)
          Get the range (maximum - minimum) of a certain variable
 double[] getSample(int wSample)
          Get a sample (all variables)
 void reset()
          reset() must be called every time a new tree is being evaluated (when using eval() instead of evalVect() )
 void update()
          update() must be called every time a new sample is required (when using eval() instead of evalVect() )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nSamples

public int nSamples

nVars

public int nVars

sigmaOpt2

public double sigmaOpt2
Constructor Detail

ProblemData

public ProblemData(java.lang.String fileName,
                   java.lang.String separator)
Initialize the data from a file


ProblemData

public ProblemData(double[][] data)
Initialize the data from the given matrix. Every row is a variable and every column is a sample

Method Detail

getData

public double getData(int whichVar)
Get the current value for a variable

Parameters:
whichVar - The variable (between 1 and nVars)
Returns:
The current value

getDataVect

public double[] getDataVect(int whichVar)
Get all values (in all samples) for a variable

Parameters:
whichVar - The variable (between 1 and nVars)
Returns:
an array with the values the variable takes for every sample

reset

public void reset()
reset() must be called every time a new tree is being evaluated (when using eval() instead of evalVect() )


update

public void update()
update() must be called every time a new sample is required (when using eval() instead of evalVect() )


getMin

public double getMin(int whichVar)
Get the minimum value of a certain variable

Parameters:
whichVar - The variable (between 1 and nVars)

getMax

public double getMax(int whichVar)
Get the maximum value of a certain variable

Parameters:
whichVar - The variable (between 1 and nVars)

getRange

public double getRange(int wVar)
Get the range (maximum - minimum) of a certain variable

Parameters:
wVar - The variable (between 1 and nVars)

getCurrentSample

public double[] getCurrentSample()
Get the current sample (all variables)

Returns:
an array with the whole sample

getSample

public double[] getSample(int wSample)
Get a sample (all variables)

Parameters:
wSample - Which sample (between 0 and nSamples)
Returns:
an array with the whole sample

getAngleCurrentSample

public double getAngleCurrentSample(int wAngle)

getAngles

public double[] getAngles(int wAngle)

getNormCurrentSample

public double getNormCurrentSample()

getNorms

public double[] getNorms()