|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlio.generators.GreedyConstructor
public class GreedyConstructor
This class constructs solutions with a greedy algorithm. In order to use it, current task must implement LiOGreedyTask. It's important pointing out that the object constructs an individual by carrying out greedy steps UNTIL A VALID INDIVIDUAL IS FOUND. That is the case of using permutations for solving problems such as TSP or Strip Packing problems.
GreedyConstruction| Constructor Summary | |
|---|---|
GreedyConstructor()
Constructor |
|
GreedyConstructor(int pNumCandidates)
Constructor |
|
| Method Summary | |
|---|---|
static Individual |
expandSolution(Individual individual,
int pNumCandidates)
Performs an step on the solution construction process. |
Individual[] |
generate(int nIndividuals)
Generates a number of individuals. |
static Individual |
generateSolution(int pNumCandidates)
Generates an individual by means of a greedy construction. |
static Individual |
generateStartingPoint()
Generates the starting point of a solution. |
LiOResourceDefinition |
getDefinition()
Return a LiOResDescription object which holds the name and all parameters that describe the resource. |
int |
getNumCandidates()
Getter for property numCandidates. |
static boolean |
isComplete(Individual individual)
Determines whether solution is a complete one or not. |
static void |
main(java.lang.String[] args)
Main class that allows testing the class. |
void |
setNumCandidates(int numCandidates)
Setter for property numCandidates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GreedyConstructor()
public GreedyConstructor(int pNumCandidates)
Number - of candidates that will be used in each step of the
construction of the solutions.| Method Detail |
|---|
public Individual[] generate(int nIndividuals)
generate in interface GeneratornIndividuals - Number of individuals that must be generated.
public static Individual generateSolution(int pNumCandidates)
pNumCandidates - Number of candidates considered at each step
of the construction.
public static Individual generateStartingPoint()
public static Individual expandSolution(Individual individual,
int pNumCandidates)
individual - The partial solution that is going to be
expandedThe - number of candidate steps considered to expand the
solution.public static boolean isComplete(Individual individual)
individual - Partial solution.
public LiOResourceDefinition getDefinition()
getDefinition in interface LiOResourcepublic static void main(java.lang.String[] args)
args - Arguments passed by command linepublic int getNumCandidates()
public void setNumCandidates(int numCandidates)
numCandidates - New value of property numCandidates.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||