com.rubecula.darwin.foundation
Interface Best<T extends net.sf.tostring0.Identifiable>

Type Parameters:
T -
All Superinterfaces:
net.sf.tostring0.Identifiable, Valuable
All Known Implementing Classes:
Best_, Best_Organism

public interface Best<T extends net.sf.tostring0.Identifiable>
extends net.sf.tostring0.Identifiable, Valuable

This interface defines the methods available on an object which keeps track of the "best" of an (unrelated) group of Identifiable objects. The objects may or may not be part of some Collection. By best, we actually mean the largest value (as a double).

Author:
Robin Hillyard

Method Summary
 T getObject()
           
 ProcessBest<T> getProcessor()
           
 void reset()
          Reset this Best object as if it had been newly constructed.
 boolean update(java.util.Collection<T> candidates)
          This method updates this Best object for each of the candidates in the given collection.
 boolean update(T candidate, boolean override)
          Method to conditionally update the best value.
 
Methods inherited from interface com.rubecula.darwin.foundation.Valuable
getValue
 
Methods inherited from interface net.sf.tostring0.Identifiable
getIdentifier
 

Method Detail

getObject

T getObject()
Returns:
the object which has the best value.

getProcessor

ProcessBest<T> getProcessor()
Returns:
the processor

reset

void reset()
Reset this Best object as if it had been newly constructed.


update

boolean update(java.util.Collection<T> candidates)
               throws ValueException
This method updates this Best object for each of the candidates in the given collection.

Parameters:
candidates -
Returns:
true if we actually did update the best value (i.e. candidates was not empty).
Throws:
ValueException

update

boolean update(T candidate,
               boolean override)
               throws ValueException
Method to conditionally update the best value.

Parameters:
candidate - the T which is the new proposal for best object. Note that a new candidate may or may not have a different value from previous objects. That's to say if two candidates are the same, they will have the same value, but not vice versa.
override - this is only referenced if this Best object has a non-zero value for convergence. If the override is true, then an equivalent object will always trigger the processor and return true, regardless of whether convergence has been achieved.
Returns:
true if the update is "complete", i.e. the best object has converged and (if any) the processor has been invoked.
Throws:
ValueException


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.