jmetal.core
Class Problem

java.lang.Object
  extended by jmetal.core.Problem
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Binh2, ConstrEx, DTLZ1, DTLZ2, DTLZ3, DTLZ4, DTLZ5, DTLZ6, DTLZ7, EBEs, Fonseca, FourBarTruss, Golinski, Griewank, IntRealProblem, Kursawe, LZ09_F1, LZ09_F2, LZ09_F3, LZ09_F4, LZ09_F5, LZ09_F6, LZ09_F7, LZ09_F8, LZ09_F9, mQAP, mTSP, OKA1, OKA2, OneMax, OneZeroMax, Osyczka2, Poloni, Rastrigin, Rosenbrock, Schaffer, Sphere, Srinivas, Tanaka, TSP, UF1, UF10, UF2, UF3, UF4, UF5, UF6, UF7, UF8, UF9, Viennet2, Viennet3, Viennet4, Water, WFG, ZDT1, ZDT2, ZDT3, ZDT4, ZDT5, ZDT6

public abstract class Problem
extends java.lang.Object
implements java.io.Serializable

Abstract class representing a multiobjective optimization problem

See Also:
Serialized Form

Field Summary
protected  int[] length_
          Stores the length of each encodings.variable when applicable (e.g., Binary and Permutation variables)
protected  double[] lowerLimit_
          Stores the lower bound values for each encodings.variable (only if needed)
protected  int numberOfConstraints_
          Stores the number of constraints of the problem
protected  int numberOfObjectives_
          Stores the number of objectives of the problem
protected  int numberOfVariables_
          Stores the number of variables of the problem
protected  java.lang.String problemName_
          Stores the problem name
protected  SolutionType solutionType_
          Stores the type of the solutions of the problem
protected  double[] upperLimit_
          Stores the upper bound values for each encodings.variable (only if needed)
 
Constructor Summary
Problem()
          Constructor.
Problem(SolutionType solutionType)
          Constructor.
 
Method Summary
abstract  void evaluate(Solution solution)
          Evaluates a Solution object.
 void evaluateConstraints(Solution solution)
          Evaluates the overall constraint violation of a Solution object.
 int getLength(int var)
          Returns the length of the encodings.variable.
 double getLowerLimit(int i)
          Gets the lower bound of the ith encodings.variable of the problem.
 java.lang.String getName()
          Returns the problem name
 int getNumberOfBits()
          Returns the number of bits of the solutions of the problem
 int getNumberOfConstraints()
          Gets the number of side constraints in the problem.
 int getNumberOfObjectives()
          Gets the the number of objectives of the problem.
 int getNumberOfVariables()
          Gets the number of decision variables of the problem.
 int[] getPrecision()
          Returns array containing the number of bits that must be used to encode binary-real variables.
 int getPrecision(int var)
          Returns the number of bits that must be used to encode binary-real variables
 SolutionType getSolutionType()
          Returns the type of the variables of the problem.
 double getUpperLimit(int i)
          Gets the upper bound of the ith encodings.variable of the problem.
 void setNumberOfVariables(int numberOfVariables)
          Sets the number of decision variables of the problem.
 void setPrecision(int[] precision)
          Sets the array containing the number of bits that must be used to encode binary-real variables.
 void setSolutionType(SolutionType type)
          Sets the type of the variables of the problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfVariables_

protected int numberOfVariables_
Stores the number of variables of the problem


numberOfObjectives_

protected int numberOfObjectives_
Stores the number of objectives of the problem


numberOfConstraints_

protected int numberOfConstraints_
Stores the number of constraints of the problem


problemName_

protected java.lang.String problemName_
Stores the problem name


solutionType_

protected SolutionType solutionType_
Stores the type of the solutions of the problem


lowerLimit_

protected double[] lowerLimit_
Stores the lower bound values for each encodings.variable (only if needed)


upperLimit_

protected double[] upperLimit_
Stores the upper bound values for each encodings.variable (only if needed)


length_

protected int[] length_
Stores the length of each encodings.variable when applicable (e.g., Binary and Permutation variables)

Constructor Detail

Problem

public Problem()
Constructor.


Problem

public Problem(SolutionType solutionType)
Constructor.

Method Detail

getNumberOfVariables

public int getNumberOfVariables()
Gets the number of decision variables of the problem.

Returns:
the number of decision variables.

setNumberOfVariables

public void setNumberOfVariables(int numberOfVariables)
Sets the number of decision variables of the problem.


getNumberOfObjectives

public int getNumberOfObjectives()
Gets the the number of objectives of the problem.

Returns:
the number of objectives.

getLowerLimit

public double getLowerLimit(int i)
Gets the lower bound of the ith encodings.variable of the problem.

Parameters:
i - The index of the encodings.variable.
Returns:
The lower bound.

getUpperLimit

public double getUpperLimit(int i)
Gets the upper bound of the ith encodings.variable of the problem.

Parameters:
i - The index of the encodings.variable.
Returns:
The upper bound.

evaluate

public abstract void evaluate(Solution solution)
                       throws JMException
Evaluates a Solution object.

Parameters:
solution - The Solution to evaluate.
Throws:
JMException

getNumberOfConstraints

public int getNumberOfConstraints()
Gets the number of side constraints in the problem.

Returns:
the number of constraints.

evaluateConstraints

public void evaluateConstraints(Solution solution)
                         throws JMException
Evaluates the overall constraint violation of a Solution object.

Parameters:
solution - The Solution to evaluate.
Throws:
JMException

getPrecision

public int getPrecision(int var)
Returns the number of bits that must be used to encode binary-real variables

Returns:
the number of bits.

getPrecision

public int[] getPrecision()
Returns array containing the number of bits that must be used to encode binary-real variables.

Returns:
the number of bits.

setPrecision

public void setPrecision(int[] precision)
Sets the array containing the number of bits that must be used to encode binary-real variables.

Parameters:
precision - The array

getLength

public int getLength(int var)
Returns the length of the encodings.variable.

Returns:
the encodings.variable length.

setSolutionType

public void setSolutionType(SolutionType type)
Sets the type of the variables of the problem.

Parameters:
type - The type of the variables

getSolutionType

public SolutionType getSolutionType()
Returns the type of the variables of the problem.

Returns:
type of the variables of the problem.

getName

public java.lang.String getName()
Returns the problem name

Returns:
The problem name

getNumberOfBits

public int getNumberOfBits()
Returns the number of bits of the solutions of the problem

Returns:
The number of bits solutions of the problem