jeco.lib.problems.combinatorial
Class TSP

java.lang.Object
  extended by jeco.kernel.problem.Problem
      extended by jeco.lib.problems.combinatorial.TSP

public class TSP
extends Problem

Class representing a TSP (Traveling Salesman Problem) problem.


Field Summary
 java.util.ArrayList<java.lang.String> cityNames
           
 double[][] distanceMatrix
           
 int numberOfCities
           
 
Fields inherited from class jeco.kernel.problem.Problem
INFINITY, name, numberOfObjectives, numberOfVariables
 
Constructor Summary
TSP(java.lang.String xmlFilePath)
          Creates a new TSP problem instance.
 
Method Summary
 Solutions computeParetoOptimalFront(int n)
           
 void evaluate(Solution solution)
          Evaluates a solution
 Solutions newRandomSetOfSolutions(int size)
           
 void readProblem(java.lang.String xmlFilePath)
           
 
Methods inherited from class jeco.kernel.problem.Problem
evaluateConstraints, getName, getNumberOfObjectives, getNumberOfVariables
 
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

cityNames

public java.util.ArrayList<java.lang.String> cityNames
Constructor Detail

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
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 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