lio.selectors
Class KTournament

java.lang.Object
  extended by lio.selectors.KTournament
All Implemented Interfaces:
LiOResource, Selector

public class KTournament
extends java.lang.Object
implements Selector

This class implements the K-Tournement selection


Constructor Summary
KTournament()
           
 
Method Summary
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object which holds the name and all parameters that describe the resource.
 int getK()
          Getter for property k.
static void main(java.lang.String[] args)
          Main class that allows testing the class.
 Individual[] select(Individual[] individuals, int number)
          Returns an array of individuals selected from those passed as parameter.
 void setK(int k)
          Setter for property k.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KTournament

public KTournament()
Method Detail

select

public Individual[] select(Individual[] individuals,
                           int number)
Returns an array of individuals selected from those passed as parameter.

Specified by:
select in interface Selector
Parameters:
individuals - set of individuals
number - number of individual that must be selected
Returns:
selected individuals

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object which holds the name and all parameters that describe the resource.

Specified by:
getDefinition in interface LiOResource
Returns:
A definition of the resource.

getK

public int getK()
Getter for property k.

Returns:
Value of property k.

setK

public void setK(int k)
Setter for property k.

Parameters:
k - New value of property k.

main

public static void main(java.lang.String[] args)
Main class that allows testing the class.

Parameters:
args - Arguments passed by command line