jmetal.problems.singleObjective
Class TSP
java.lang.Object
jmetal.core.Problem
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
Constructor Summary |
TSP(java.lang.String solutionType)
|
TSP(java.lang.String solutionType,
java.lang.String filename)
Creates a new TSP problem instance. |
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 |
numberOfCities_
public int numberOfCities_
distanceMatrix_
public double[][] distanceMatrix_
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
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