Class RealScalarFunctionChromosome
- java.lang.Object
-
- dev.nm.solver.multivariate.geneticalgorithm.minimizer.simplegrid.RealScalarFunctionChromosome
-
- All Implemented Interfaces:
Chromosome
,Comparable<Chromosome>
- Direct Known Subclasses:
SimpleCellFactory.SimpleCell
public abstract class RealScalarFunctionChromosome extends Object implements Chromosome
This chromosome encodes a real valued function.
-
-
Constructor Summary
Constructors Constructor Description RealScalarFunctionChromosome(RealScalarFunction f, Vector x)
Construct an instance ofRealScalarFunctionChromosome
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Chromosome that)
RealScalarFunction
f()
Get the objective function.double
fitness()
This is the fitness to determine how good this chromosome is.String
toString()
ImmutableVector
x()
Get the candidate solution.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface dev.nm.solver.multivariate.geneticalgorithm.Chromosome
crossover, mutate
-
-
-
-
Constructor Detail
-
RealScalarFunctionChromosome
public RealScalarFunctionChromosome(RealScalarFunction f, Vector x)
Construct an instance ofRealScalarFunctionChromosome
.- Parameters:
f
- the objective functionx
- a candidate solution
-
-
Method Detail
-
f
public RealScalarFunction f()
Get the objective function.- Returns:
- the objective function
-
x
public ImmutableVector x()
Get the candidate solution.- Returns:
- the candidate solution
-
fitness
public double fitness()
Description copied from interface:Chromosome
This is the fitness to determine how good this chromosome is.- Specified by:
fitness
in interfaceChromosome
- Returns:
- the fitness
-
compareTo
public int compareTo(Chromosome that)
- Specified by:
compareTo
in interfaceComparable<Chromosome>
-
-