jmetal.encodings.variable
Class ArrayInt

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

public class ArrayInt
extends Variable

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

See Also:
Serialized Form

Field Summary
 int[] array_
          Stores an array of integer values
 
Constructor Summary
ArrayInt()
          Constructor
ArrayInt(int size)
          Constructor
ArrayInt(int size, double[] lowerBounds, double[] upperBounds)
          Constructor
ArrayInt(int size, Problem problem)
          Constructor
 
Method Summary
 Variable deepCopy()
          Creates an exact copy of a Variable object.
 int getLength()
          Returns the length of the arrayInt.
 double getLowerBound(int index)
          Get the lower bound of a value
 double getUpperBound(int index)
          Get the upper bound of a value
 int getValue(int index)
          getValue
 void setValue(int index, int 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 int[] array_
Stores an array of integer values

Constructor Detail

ArrayInt

public ArrayInt()
Constructor


ArrayInt

public ArrayInt(int size)
Constructor

Parameters:
size - Size of the array

ArrayInt

public ArrayInt(int size,
                Problem problem)
Constructor

Parameters:
size - Size of the array

ArrayInt

public ArrayInt(int size,
                double[] lowerBounds,
                double[] upperBounds)
Constructor

Parameters:
size - The size of the array
lowerBounds - Lower bounds
upperBounds - Upper bounds
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 arrayInt.

Returns:
The length

getValue

public int 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,
                     int 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