net.sourceforge.cilib.util.selection.ordering
Class ProportionalOrdering<E>

java.lang.Object
  extended by net.sourceforge.cilib.util.selection.ordering.ProportionalOrdering<E>
Type Parameters:
E - The selection type.
All Implemented Interfaces:
Ordering<E>

public class ProportionalOrdering<E>
extends Object
implements Ordering<E>

Apply a proportionate ordering. Proportionate ordering is done by determining the total maximum weight and then determining the percentage share for each entry.

Some more information

Author:
Wiehann Matthysen

Constructor Summary
ProportionalOrdering()
          Create a new instance with an internal MersenneTwister.
ProportionalOrdering(Random generator)
          Create a new instance with the provided Random.
 
Method Summary
 boolean order(List<Selection.Entry<E>> elements)
          Apply the ordering on the provided list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProportionalOrdering

public ProportionalOrdering()
Create a new instance with an internal MersenneTwister.


ProportionalOrdering

public ProportionalOrdering(Random generator)
Create a new instance with the provided Random.

Parameters:
generator - The generator to use.
Method Detail

order

public boolean order(List<Selection.Entry<E>> elements)
Apply the ordering on the provided list.

This method will apply the proportionate ordering on the provided list of elements.

Specified by:
order in interface Ordering<E>
Parameters:
elements - The list to be ordered.
Returns:
true if successful, false otherwise.


Copyright © 2009 CIRG. All Rights Reserved.