|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlio.LiOTask
lio.search.local.greedy.LiOGreedyTask
problems.permutation.SymmetricTSP
public class SymmetricTSP
Implements a Symmetric TSP task. It reads the instance from a file and codifies the solutions by means of a Permutation object. It works only with Symmetric instances. This task implements LiOGreedyTask so that it can be solved with greedy algorithms.
Constructor Summary | |
---|---|
SymmetricTSP()
|
Method Summary | |
---|---|
LiOBounds |
defineIndividuals()
In most cases, it is necessary to define some common features of a certain kind of individual such as upper and lower limits, size, etc. |
double |
evaluate(Individual individual)
Evaluates an individual and returns its fitness. |
Individual[] |
genCandidateSteps(Individual pSolution,
int pNCandidates)
Returns the best partial solutions that could be built in one step from the given one. |
Individual |
generateStartingPoint()
Generates a minimum partial solution randomly. |
LiOResourceDefinition |
getDefinition()
Return a LiOResDescription object with the information of each object. |
java.lang.String |
getFile()
Getter for property file. |
int |
getNumCities()
Getter for property numCities. |
boolean |
isComplete(Individual pSolution)
Determines whether solution is a complete one or not. |
static void |
main(java.lang.String[] args)
|
double |
optimum()
Returns the optimum of the function. |
void |
setFile(java.lang.String file)
Setter for property file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SymmetricTSP()
Method Detail |
---|
public LiOBounds defineIndividuals()
defineIndividuals
in class LiOTask
public double evaluate(Individual individual)
evaluate
in class LiOTask
individual
- The individual that is going to be evaluated.
public double optimum()
optimum
in class LiOTask
public Individual generateStartingPoint()
LiOGreedyTask
generateStartingPoint
in class LiOGreedyTask
public boolean isComplete(Individual pSolution)
LiOGreedyTask
isComplete
in class LiOGreedyTask
public Individual[] genCandidateSteps(Individual pSolution, int pNCandidates)
LiOGreedyTask
genCandidateSteps
in class LiOGreedyTask
pSolution
- Partial solution that is going to be expanded.pNCandidates
- Number partial solutions that must be generated.
public void setFile(java.lang.String file)
file
- New value of property file.public int getNumCities()
public LiOResourceDefinition getDefinition()
getDefinition
in interface LiOResource
getDefinition
in class LiOTask
public java.lang.String getFile()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |