jmetal.problems.singleObjective
Class TSP

java.lang.Object
  extended by jmetal.core.Problem
      extended by jmetal.problems.singleObjective.TSP
All Implemented Interfaces:
java.io.Serializable

public class TSP
extends Problem

Class representing a TSP (Traveling Salesman Problem) problem.

See Also:
Serialized Form

Field Summary
 double[][] distanceMatrix_
           
 int numberOfCities_
           
 
Fields inherited from class jmetal.core.Problem
length_, lowerLimit_, numberOfConstraints_, numberOfObjectives_, numberOfVariables_, problemName_, solutionType_, upperLimit_
 
Constructor Summary
TSP(java.lang.String solutionType)
           
TSP(java.lang.String solutionType, java.lang.String filename)
          Creates a new TSP problem instance.
 
Method Summary
 void evaluate(Solution solution)
          Evaluates a solution
 void readProblem(java.lang.String fileName)
           
 
Methods inherited from class jmetal.core.Problem
evaluateConstraints, getLength, getLowerLimit, getName, getNumberOfBits, getNumberOfConstraints, getNumberOfObjectives, getNumberOfVariables, getPrecision, getPrecision, getSolutionType, getUpperLimit, setNumberOfVariables, setPrecision, setSolutionType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfCities_

public int numberOfCities_

distanceMatrix_

public double[][] distanceMatrix_
Constructor Detail

TSP

public TSP(java.lang.String solutionType)

TSP

public TSP(java.lang.String solutionType,
           java.lang.String filename)
Creates a new TSP problem instance. It accepts data files from TSPLIB

Parameters:
filename - The file containing the definition of the problem
Method Detail

evaluate

public void evaluate(Solution solution)
Evaluates a solution

Specified by:
evaluate in class Problem
Parameters:
solution - The solution to evaluate

readProblem

public void readProblem(java.lang.String fileName)
                 throws java.io.IOException
Throws:
java.io.IOException