edu.udo.cs.yale.operator.features.weighting
Class SimpleWeighting
java.lang.Object
edu.udo.cs.yale.operator.features.IndividualOperator
edu.udo.cs.yale.operator.features.weighting.SimpleWeighting
- All Implemented Interfaces:
- PopulationOperator
public class SimpleWeighting
- extends IndividualOperator
This PopulationOperator realises a simple weighting, i.e. creates a list of
clones of each individual and weights one attribute in each of the clones
with some different weights.
- Version:
- $Id: SimpleWeighting.java,v 1.16 2006/08/03 14:39:35 ingomierswa Exp $
- Author:
- Ingo Mierswa
Field Summary |
private double |
compareWeight
If a weight is equal to this compare weight, all weights are used for
building a new individual.
|
private double[] |
weights
These weights are used for building new individuals.
|
Constructor Summary |
SimpleWeighting(double compareWeight,
double[] weights)
Creates a simple weighting.
|
Method Summary |
java.util.List<Individual> |
operate(Individual individual)
Subclasses must implement this method providing a list of new
individuals.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
compareWeight
private double compareWeight
- If a weight is equal to this compare weight, all weights are used for
building a new individual.
weights
private double[] weights
- These weights are used for building new individuals.
SimpleWeighting
public SimpleWeighting(double compareWeight,
double[] weights)
- Creates a simple weighting.
operate
public java.util.List<Individual> operate(Individual individual)
- Description copied from class:
IndividualOperator
- Subclasses must implement this method providing a list of new
individuals. individual will be removed from the population so
it might be useful to return a list of size 1 containing only the
modified individual. If the original individual should also
be part of the new population it must also be added to the result list.
- Specified by:
operate
in class IndividualOperator
Copyright © 2001-2006