net.sourceforge.cilib.util.selection.weighing.entity
Class EntityWeighing<E extends Entity>

java.lang.Object
  extended by net.sourceforge.cilib.util.selection.weighing.entity.EntityWeighing<E>
Type Parameters:
E - The entity type.
All Implemented Interfaces:
Serializable, Cloneable, Weighing<E>

public class EntityWeighing<E extends Entity>
extends Object
implements Weighing<E>

Apply a weighing based on the Fitness of Entity instances.

Author:
Wiehann Matthysen
See Also:
Serialized Form

Constructor Summary
EntityWeighing()
          Create a new instance.
EntityWeighing(EntityFitness<E> entityFitness)
          Create a new instance with the provided EntityFitness strategy.
EntityWeighing(EntityWeighing copy)
          Create a copy of the provided instance.
 
Method Summary
 EntityWeighing getClone()
          Create a cloned copy of the current object and return it.
 boolean weigh(List<Selection.Entry<E>> entities)
          Perform a weighing on the provided list of entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityWeighing

public EntityWeighing()
Create a new instance.


EntityWeighing

public EntityWeighing(EntityFitness<E> entityFitness)
Create a new instance with the provided EntityFitness strategy.

Parameters:
entityFitness - The value to set.

EntityWeighing

public EntityWeighing(EntityWeighing copy)
Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public EntityWeighing getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Specified by:
getClone in interface Weighing<E extends Entity>
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

weigh

public boolean weigh(List<Selection.Entry<E>> entities)
Perform a weighing on the provided list of entries.

Specified by:
weigh in interface Weighing<E extends Entity>
Parameters:
entities - The entities to weigh.
Returns:
true if successful, false otherwise.


Copyright © 2009 CIRG. All Rights Reserved.