lio.search.local.greedy
Class LiOGreedyTask

java.lang.Object
  extended by lio.LiOTask
      extended by lio.search.local.greedy.LiOGreedyTask
All Implemented Interfaces:
LiOResource
Direct Known Subclasses:
SymmetricTSP

public abstract class LiOGreedyTask
extends LiOTask

This class extends LiOTask in order to provide some methods needed to perform greedy based construction of solutions.


Constructor Summary
LiOGreedyTask()
           
 
Method Summary
abstract  Individual[] genCandidateSteps(Individual pSolution, int nCandidates)
          Returns the best partial solutions that could be built in one step from the given one.
abstract  Individual generateStartingPoint()
          Generates a minimum partial solution randomly.
abstract  boolean isComplete(Individual pSolution)
          Determines whether solution is a complete one or not.
 
Methods inherited from class lio.LiOTask
defineIndividuals, evaluate, getDefinition, optimum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiOGreedyTask

public LiOGreedyTask()
Method Detail

generateStartingPoint

public abstract Individual generateStartingPoint()
Generates a minimum partial solution randomly. For instance, in a permutation representing a tour, it would be the first city.


genCandidateSteps

public abstract Individual[] genCandidateSteps(Individual pSolution,
                                               int nCandidates)
Returns the best partial solutions that could be built in one step from the given one. For instance, in the tsp problem, it would return the nCandidates cities with the minimum distance to the last one but if there aren't so many left to be visited, it would only return the non visited. In the case of forward feature subset selection in machine learning, it would return nCandidates individual each one of them resulting of adding a variable to the current solution.

Parameters:
pSolution - Partial solution that is going to be expanded.
nCandidates - Number partial solutions that must be generated.
Returns:
An array containing the best possible changes.

isComplete

public abstract boolean isComplete(Individual pSolution)
Determines whether solution is a complete one or not. For instance, with a permutation, representing a tour, it would return true only if the tour is complete.

Parameters:
individual - Partial solution.
Returns:
If it is a complete solution.