/* * Copyright (c) 2006 Thomas Weise * * E-Mail : tweise@gmx.de * Creation Date : 2006-04-10 15:39:13 * Original Filename: org.dgpf.search.algorithms.ga.selection.OrderedSelection.java * Version : 2.0.2 * Last modification: 2006-05-31 * by: Thomas Weise * * License : GNU LESSER GENERAL PUBLIC LICENSE * Version 2.1, February 1999 * You should have received a copy of this license along * with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307, USA or download the license under * http://www.gnu.org/copyleft/lesser.html. * * Warranty : This software is provided "as is" without any * warranty; without even the implied warranty of * merchantability or fitness for a particular purpose. * See the Gnu Lesser General Public License for more * details. */ package org.dgpf.search.algorithms.ga.selection; import java.io.Serializable; import org.dgpf.search.algorithms.ga.SelectionAlgorithm; import org.dgpf.search.algorithms.ga.SortingAlgorithm; import org.dgpf.search.api.Individual; import org.sfc.math.stochastic.Randomizer; import org.sfc.text.Text; /** *
* The ordered selection algorithm works sets the probability of an
* individual being chosen for reproduction somehow related to its
* rank in the population. Basically, all individuals are ordered by
* their fitness. A uniform distributed random number is then raised to the
* power of o
and multplied with the list length. The
* individual at the resulting index is then chosen for reproduction.
*
* The selection algorithm parameter o
represts the some
* amount of overselection. The bigger it gets, the high the probability
* of good individuals for being chosen for reproduction. An o
* value of 1 means random selection, a value 0<=o<1
means
* selecting only weak individuals. Values o>1
favour
* strong individuals.
0
* and the worst at index p_count-1
.
* @param p_random The randomizer to be used for the selection.
* @param p_individuals The population of individuals after being
* preprocessed.
* @param p_count The count of valid items inside the population
* array.
* @param equals()
.
* @param p_object The object to compare with.
* @return true
if and only if this object equals to the other
* one.
*/
@Override
protected final boolean is_equal (final Object p_object)
{
return ((p_object instanceof OrderedSelection) &&
(Double.compare(((OrderedSelection)p_object).m_power,
this.m_power) == 0));
}
}