gov.sandia.cognition.learning.algorithm.genetic
Class EvaluatedGenome<GenomeType>

java.lang.Object
  extended by gov.sandia.cognition.learning.algorithm.genetic.EvaluatedGenome<GenomeType>
Type Parameters:
GenomeType - Type of genome used to represent a single element in the genetic population, such as a Vector, for example.
All Implemented Interfaces:
Pair<GenomeType,Double>, Serializable

@CodeReviews(reviews={@CodeReview(reviewer="Kevin R. Dixon",date="2008-07-23",changesNeeded=true,comments={"I think this class should be replaced by InputOutputPair","It doesn\'t really serve a useful purpose anymore.","Replaced previous code review with CodeReview annotation."},response=@CodeReviewResponse(respondent="Justin Basilico",date="2008-09-15",moreChangesNeeded=false,comments={"InputOutputPair is meant for supervised learning","I added the Pair interface to the class, since it is a pair.","I prefer having a some semantically meaningful class name and properties rather than using the vague Pair or InputOutputPair."})),@CodeReview(reviewer="Justin Basilico",date="2006-10-02",changesNeeded=false,comments="This simple container class looks fine.")})
public class EvaluatedGenome<GenomeType>
extends Object
implements Pair<GenomeType,Double>, Serializable

The EvaluatedGenome class wraps together a Genome and its cost score.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
EvaluatedGenome(double cost, GenomeType genome)
          Creates a new instance of EvaluatedGenome.
 
Method Summary
 double getCost()
          Gets the cost of the genome.
 GenomeType getFirst()
          The first entry in the pair is the genome.
 GenomeType getGenome()
          Gets the genome.
 Double getSecond()
          The second entry in the pair is the cost.
 void setCost(double cost)
          Sets the cost of the genome.
 void setGenome(GenomeType genome)
          Sets the genome.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvaluatedGenome

public EvaluatedGenome(double cost,
                       GenomeType genome)
Creates a new instance of EvaluatedGenome.

Parameters:
genome - The genome.
cost - The cost associated with the genome.
Method Detail

getGenome

public GenomeType getGenome()
Gets the genome.

Returns:
The genome.

getCost

public double getCost()
Gets the cost of the genome.

Returns:
The cost.

setGenome

public void setGenome(GenomeType genome)
Sets the genome.

Parameters:
genome - The new genome.

setCost

public void setCost(double cost)
Sets the cost of the genome.

Parameters:
cost - The new cost.

getFirst

public GenomeType getFirst()
The first entry in the pair is the genome.

Specified by:
getFirst in interface Pair<GenomeType,Double>
Returns:
The genome.

getSecond

public Double getSecond()
The second entry in the pair is the cost.

Specified by:
getSecond in interface Pair<GenomeType,Double>
Returns:
The cost.