jeco.lib.problems.combinatorial
Class TSP
java.lang.Object
jeco.kernel.problem.Problem
jeco.lib.problems.combinatorial.TSP
public class TSP
- extends Problem
Class representing a TSP (Traveling Salesman Problem) problem.
Constructor Summary |
TSP(java.lang.String xmlFilePath)
Creates a new TSP problem instance. |
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
cityNames
public java.util.ArrayList<java.lang.String> cityNames
TSP
public TSP(java.lang.String xmlFilePath)
- 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 xmlFilePath)
throws java.lang.Exception
- Throws:
java.lang.Exception
newRandomSetOfSolutions
public Solutions newRandomSetOfSolutions(int size)
- Specified by:
newRandomSetOfSolutions
in class Problem
computeParetoOptimalFront
public Solutions computeParetoOptimalFront(int n)
- Overrides:
computeParetoOptimalFront
in class Problem