MGSurvE.optimization

Operators to calculate fitness and perform operations to search through optimization space.

Functions

calcFitness(chromosome[, landscape, ...])

Calculates the fitness function of the landscape given a chromosome (in place, so not thread-safe).

calcSexFitness(chromosome[, landscapeMale, ...])

Calculates the fitness function of a Male/Female set of landscapes with a weighted sum of the time-to catch between them.

cxBlend(ind1, ind2, fixedTrapsMask[, alpha])

Mates two chromosomes by "blend" based on the provided mask (in place).

exportLog(logbook, outPath, filename)

Dumps a dataframe with the report of the GA's history.

genFixedTrapsMask(trapsFixed[, dims])

Creates a mask for the fixed traps (non-movable).

getDaysTillTrapped(landscape[, fitFuns])

Gets the number of timesteps until a walker falls into a trap.

getFundamentalFitness(fundamentalMatrix[, ...])

Get fitness from Markov's fundamental matrix.

getFundamentalMatrix(tau, sitesN, trapsN)

Get Markov's fundamental matrix.

getMarkovAbsorbing(tauCan, trapsN)

Get Markov's absorbing states (deprecated).

importLog(inPath, filename)

Gets the number of timesteps until a walker falls into a trap.

initChromosome(trapsCoords, fixedTrapsMask, ...)

Generates a random uniform chromosome for GA optimization.

mutateChromosome(chromosome, fixedTrapsMask)

Mutates a chromosome with a probability distribution based on the mutation mask (in place).

mutateChromosomeAsymmetric(chromosome, ...)

Mutates a chromosome with a probability distribution based on the mutation mask with different probabilities for XY elements (in place).

reshapeInCanonicalForm(tau, sitesN, trapsN)

Reshapes a migration matrix into canonical form (deprecated).