MATLAB compatibility#

Compatibility with the EASY-IEC MATLAB toolbox (Madár, Abonyi and Szeifert, 2005).

The MATLAB toolbox represented a population by a structure popu with the fields nvar (number of variables), nind (population size), LB and UB (bounds), devi (strategy parameters, one row per individual) and chrom (real-coded chromosomes, one row per individual). The user wrote a user function that drew each individual into a column of subplots, and popu = ies_main(popu, subfigrows, 'userfun') ran the interactive loop. This module offers the same workflow in Python:

>>> import numpy as np
>>> from easyiec.compat import popu_init, ies_main, UserFunctionProblem
>>> popu = popu_init([0, 0, -1], [5, 10, 1], nind=9, init_chrom=[2.5, 5, 0], seed=0)
>>> popu["chrom"].shape
(9, 3)

The popu workflow of the EASY-IEC MATLAB toolbox.

Classes#

UserFunctionProblem(LB, UB, userfun[, ...])

Wrap a MATLAB-style user function userfun(chrom, axes) as a problem.

Functions#

popu_init(LB, UB[, nind, init_chrom, seed])

Initialize a population structure as in the EASY-IEC help.

ies_main(popu, subfigrows, userfun, *[, ...])

Run the interactive loop on a popu structure; returns the resulting population.

popu_from_strategy(strategy, generation)