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, reset
getLocalParameters, toString
public TravellingSalesmanProblem(Resources resources)
resources
- a reference to the experiment's resources.public void evaluate(Population population, Resources resources)
Problem
public boolean isPerfectSolution(Chromosome fittest)
Problem
isPerfectSolution
in class Problem
fittest
- the potentially perfect chromosome.public void parseProblemData(java.io.File file, ModifiableResources resources)
Problem
ModifiableResources
instance.
parseProblemData
in class Problem
file
- the data file to parse.resources
- a modifiable reference to the experiment's resources.public boolean isImprovement(Chromosome fittest)
Problem
isImprovement
in class Problem
fittest
- the potentially fitter chromosome.