DistributedPopulation

DistributedPopulation - specific Population of Chromosome for DistributedGA. Organizes access to subpopulations of child GAs as one general population. Tightly tied to the owner's children (DistributedGA.children).

V - value of Chromosome

F - fitness value of Chromosome

This population supports:

Creates with population functions.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val <V, F> Population<V, F>.best: Chromosome<V, F>?

The best Chromosome in Population by fitness.

Link copied to clipboard
abstract var factory: PopulationFactory<V, F>

PopulationFactory for this population. Creates new Chromosome.

Link copied to clipboard
Link copied to clipboard

Return indices range for Population

Link copied to clipboard
abstract override val initialized: Boolean

DistributedPopulation is considered initialized if there is at least one linked subpopulation and all subpopulations are initialized.

Link copied to clipboard
Link copied to clipboard
abstract val name: String

Name of population, default value = DEFAULT_POPULATION_NAME

Link copied to clipboard
abstract val size: Int

Current size of population.

Link copied to clipboard
abstract val subpopulations: List<Population<V, F>>

Populations, the totality of which determines the DistributedPopulation. A subpopulation of a distributed population can be any population, including another distributed population.

Link copied to clipboard
val <V, F> Population<V, F>.worst: Chromosome<V, F>?

The worst Chromosome in Population by fitness.

Functions

Link copied to clipboard
abstract fun addPopulation(population: Population<V, F>)

Adds a population to the end of subpopulations.

abstract fun addPopulation(index: Int, population: Population<V, F>)

Inserts a population into the subpopulations at the specified index.

Link copied to clipboard
abstract override fun clone(newName: String): DistributedPopulation<V, F>

Override clone method to return DistributedPopulation.

Link copied to clipboard
inline fun <V, F> Population<V, F>.cloneOf(index: Int): Chromosome<V, F>

Return clone of Chromosome with index in Population

Link copied to clipboard
abstract fun copyOf(): Array<Chromosome<V, F>>

Creates array with chromosomes copied from Population.

Link copied to clipboard
inline fun <V, F> Population<V, F>.copyOfRange(fromIndex: Int, toIndex: Int): Array<Chromosome<V, F>>

Creates copy of Population as an array by range

Link copied to clipboard
abstract operator fun get(index: Int): Chromosome<V, F>
abstract fun get(): Array<Chromosome<V, F>>

Get population as an array.

Link copied to clipboard
inline fun Population<*, *>.isEmpty(): Boolean

Returns true if the population is empty (contains no chromosomes), false otherwise.

Link copied to clipboard
abstract operator fun iterator(): Iterator<Chromosome<V, F>>
Link copied to clipboard
inline fun <V, F> Population<V, F>.randomWithIndices(count: Int, random: Random): Pair<Array<Chromosome<V, F>>, IntArray>

Creates Array with randomly selected chromosomes from source array

Link copied to clipboard
abstract fun removePopulationAt(index: Int): Population<V, F>

Removes a Population at the specified index from the list.

Link copied to clipboard
inline fun <V, F> Population<V, F>.reset(random: Random, start: Int = 0, end: Int = size)

Reset population with factory.

Link copied to clipboard
abstract operator fun set(index: Int, chromosome: Chromosome<V, F>)

Set Chromosome with index