com.rubecula.darwin.foundation
Class Evolvable_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.foundation.Evolvable_
All Implemented Interfaces:
Evolvable, Generational, Terminal, Theological, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString
Direct Known Subclasses:
Population_, Taxon_

public abstract class Evolvable_
extends net.sf.tostring0.AToString
implements Evolvable

Author:
Robin Hillyard

Field Summary
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Constructor Summary
protected Evolvable_(java.lang.String identifier)
          Primary protected constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getGeneration()
           
 java.lang.String getIdentifier()
           
protected  int getMaxGenerations()
           
 java.lang.Object getResult()
           
 int hashCode()
           
 boolean isFinished()
           
 boolean nextGeneration()
          Mutating method to invoke the next generation of a Evolvable object.
 void setMaxGenerations(int maxGenerations)
           
protected  void setResult(java.lang.Object result)
           
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.foundation.Theological
cullMembers, seedMembers
 

Constructor Detail

Evolvable_

protected Evolvable_(java.lang.String identifier)
Primary protected constructor.

Parameters:
identifier -
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getGeneration

public int getGeneration()
Specified by:
getGeneration in interface Evolvable
Returns:
the sequence number of the current generation.
See Also:
Evolvable.getGeneration()

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface net.sf.tostring0.Identifiable
Returns:
_identifier
See Also:
Identifiable.getIdentifier()

getResult

public java.lang.Object getResult()
Specified by:
getResult in interface Evolvable
Returns:
the result

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

isFinished

public boolean isFinished()
Specified by:
isFinished in interface Terminal
Returns:
true if generation is >= to maxGenerations. For a more complex condition, an evolvable could override this definition.
See Also:
Terminal.isFinished()

nextGeneration

public boolean nextGeneration()
Description copied from interface: Generational
Mutating method to invoke the next generation of a Evolvable object. This is where all the actual work is done.

Specified by:
nextGeneration in interface Generational
Returns:
true if the operation was successful. If the result is false, then something has gone wrong and the application should not expect subsequent generations to behave sensibly.
See Also:
Generational.nextGeneration()

setMaxGenerations

public void setMaxGenerations(int maxGenerations)
Parameters:
maxGenerations -

getMaxGenerations

protected int getMaxGenerations()

setResult

protected void setResult(java.lang.Object result)
Parameters:
result - the result to set


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