public class TravellingSalesmanProblem extends Problem
parseData() must be used to load the desired city
coordinates in the standard .tsp format.TravellingSalesmanFunctions| Constructor and Description |
|---|
TravellingSalesmanProblem(Resources resources)
Construct a new instance of TravellingSalesmanProblem.
|
| Modifier and Type | Method and Description |
|---|---|
void |
evaluate(Population population,
Resources resources)
The most important method of the problem type.
|
boolean |
isImprovement(Chromosome fittest)
Used to assert whether a given chromosome is an improvement over
the current best chromosome.
|
boolean |
isPerfectSolution(Chromosome fittest)
Used to assert whether a given chromosome is a perfect solution
to the problem.
|
void |
parseProblemData(java.io.File file,
ModifiableResources resources)
Parses the specified file and uses the parsed data to
set up the problem type instance appropriately.
|
getBestFitness, getFileExtension, getFunctionSet, resetgetLocalParameters, toStringpublic TravellingSalesmanProblem(Resources resources)
resources - a reference to the experiment's resources.public void evaluate(Population population, Resources resources)
Problempublic boolean isPerfectSolution(Chromosome fittest)
ProblemisPerfectSolution in class Problemfittest - the potentially perfect chromosome.public void parseProblemData(java.io.File file,
ModifiableResources resources)
ProblemModifiableResources
instance.
parseProblemData in class Problemfile - the data file to parse.resources - a modifiable reference to the experiment's resources.public boolean isImprovement(Chromosome fittest)
ProblemisImprovement in class Problemfittest - the potentially fitter chromosome.