jmetal.encodings.variable
Class ArrayReal

java.lang.Object
  extended by jmetal.core.Variable
      extended by jmetal.encodings.variable.ArrayReal
All Implemented Interfaces:
java.io.Serializable

public class ArrayReal
extends Variable

Class implementing a decision encodings.variable representing an array of real values. The real values of the array have their own bounds.

See Also:
Serialized Form

Field Summary
 java.lang.Double[] array_
          Stores an array of real values
 
Constructor Summary
ArrayReal()
          Constructor
ArrayReal(int size, Problem problem)
          Constructor
 
Method Summary
 Variable deepCopy()
          Creates an exact copy of a Variable object.
 int getLength()
          Returns the length of the arrayReal.
 double getLowerBound(int index)
          Get the lower bound of a value
 double getUpperBound(int index)
          Get the upper bound of a value
 double getValue(int index)
          getValue
 void setValue(int index, double value)
          setValue
 java.lang.String toString()
          Returns a string representing the object
 
Methods inherited from class jmetal.core.Variable
getLowerBound, getUpperBound, getValue, getVariableType, setLowerBound, setUpperBound, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

array_

public java.lang.Double[] array_
Stores an array of real values

Constructor Detail

ArrayReal

public ArrayReal()
Constructor


ArrayReal

public ArrayReal(int size,
                 Problem problem)
Constructor

Parameters:
size - Size of the array
Method Detail

deepCopy

public Variable deepCopy()
Description copied from class: Variable
Creates an exact copy of a Variable object.

Specified by:
deepCopy in class Variable
Returns:
the copy of the object.

getLength

public int getLength()
Returns the length of the arrayReal.

Returns:
The length

getValue

public double getValue(int index)
                throws JMException
getValue

Parameters:
index - Index of value to be returned
Returns:
the value in position index
Throws:
JMException

setValue

public void setValue(int index,
                     double value)
              throws JMException
setValue

Parameters:
index - Index of value to be returned
value - The value to be set in position index
Throws:
JMException

getLowerBound

public double getLowerBound(int index)
                     throws JMException
Get the lower bound of a value

Parameters:
index - The index of the value
Returns:
the lower bound
Throws:
JMException

getUpperBound

public double getUpperBound(int index)
                     throws JMException
Get the upper bound of a value

Parameters:
index - The index of the value
Returns:
the upper bound
Throws:
JMException

toString

public java.lang.String toString()
Returns a string representing the object

Overrides:
toString in class java.lang.Object
Returns:
The string