Package adams.opt.genetic
Class AbstractGeneticAlgorithm.FitnessContainer
- java.lang.Object
-
- adams.opt.genetic.AbstractGeneticAlgorithm.FitnessContainer
-
- All Implemented Interfaces:
Serializable
,Comparable<AbstractGeneticAlgorithm.FitnessContainer>
- Enclosing class:
- AbstractGeneticAlgorithm
public static class AbstractGeneticAlgorithm.FitnessContainer extends Object implements Serializable, Comparable<AbstractGeneticAlgorithm.FitnessContainer>
For storing the fitness parameters.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FitnessContainer(double fitness, Object setup, int[] weights)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AbstractGeneticAlgorithm.FitnessContainer other)
Compares itself with the other container using the fitness.double
getFitness()
Returns the fitness.Object
getSetup()
Returns the setup.int[]
getWeights()
Returns the weights.String
toString()
Returns a short string description.
-
-
-
Field Detail
-
m_Fitness
protected double m_Fitness
the fitness score.
-
m_Setup
protected Object m_Setup
the setup.
-
m_Weights
protected int[] m_Weights
the weights.
-
-
Constructor Detail
-
FitnessContainer
public FitnessContainer(double fitness, Object setup, int[] weights)
Initializes the container.- Parameters:
fitness
- the fitnesssetup
- the setupweights
- the weights
-
-
Method Detail
-
getFitness
public double getFitness()
Returns the fitness.- Returns:
- the fitness
-
getSetup
public Object getSetup()
Returns the setup.- Returns:
- the setup
-
getWeights
public int[] getWeights()
Returns the weights.- Returns:
- the weights
-
compareTo
public int compareTo(AbstractGeneticAlgorithm.FitnessContainer other)
Compares itself with the other container using the fitness.- Specified by:
compareTo
in interfaceComparable<AbstractGeneticAlgorithm.FitnessContainer>
- Parameters:
other
- the other container- Returns:
- less than zero, equal to zero, or greater than zero, if this container's fitness is less, equal to, or greater than the other's
-
-