lio.replacement
Class SelectionReplacement

java.lang.Object
  extended by lio.replacement.SelectionReplacement
All Implemented Interfaces:
LiOResource, Replacement

public class SelectionReplacement
extends java.lang.Object
implements Replacement

This replacement strategy uses a selector to choose individuals from both the current and the former population.


Field Summary
(package private)  Selector selector
          Selector used to choose individuals from both populations.
 
Constructor Summary
SelectionReplacement()
           
 
Method Summary
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object which holds the name and all parameters that describe the resource.
 Selector getSelector()
           
static void main(java.lang.String[] args)
          Main class that allows testing the class.
 Individual[] replace(Population current, Population former)
          Generates a new population from the current and the former one.
 void setSelector(Selector selector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selector

Selector selector
Selector used to choose individuals from both populations.

Constructor Detail

SelectionReplacement

public SelectionReplacement()
Method Detail

replace

public Individual[] replace(Population current,
                            Population former)
Generates a new population from the current and the former one. The returned population can have either fixed or variable size depending on the value of the variable varSize

Specified by:
replace in interface Replacement
Parameters:
former - The former population.
current - The current population.

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.

main

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

Parameters:
args - Arguments passed by command line

getSelector

public Selector getSelector()

setSelector

public void setSelector(Selector selector)