ChromosomeMutableList

data class ChromosomeMutableList<T, F : Comparable<F>>(var value: MutableList<T>, var fitness: F? = null, clone: ChromosomeMutableList<T, F>.() -> ChromosomeMutableList<T, F>? = null) : Chromosome<MutableList<T>, F>

Base instance for Chromosome with value as MutableList of something

Use mutableList function to easily create ChromosomeMutableList

Constructors

Link copied to clipboard
constructor(value: MutableList<T>, fitness: F? = null, clone: ChromosomeMutableList<T, F>.() -> ChromosomeMutableList<T, F>? = null)

Properties

Link copied to clipboard
open override var fitness: F?

Calculated value by fitness function for a specific individual

Link copied to clipboard
open override var value: MutableList<T>

Combination of genes for a Chromosome (individual) (Often an array or string)

Functions

Link copied to clipboard
open override fun clone(): Chromosome<MutableList<T>, F>

Clone function to create deap copied Chromosome with the same value and fitness

Link copied to clipboard
open operator override fun compareTo(other: Chromosome<MutableList<T>, F>): Int
Link copied to clipboard
inline fun <V, F> Chromosome<V, F>.evaluate(fitnessFunction: (V) -> F)

Base evaluates function for Chromosome by fitnessFunction