navicatGA.helpers

Classes

Functions

check_error(func, *args, **kw)

concatenate_list()

Default chromosome manipulator: concatenates all elements of a list.

get_elapsed_time(start_time, end_time)

get_input_dimensions(lst[, n_dim])

make_array()

Default chromosome manipulator: turns list into array.

track_evaluations(iterable, total, desc, enabled)

Wraps the per-individual fitness loop in a tqdm bar when progress_bars is on.

Module Contents

Bases: tuple

Default chromosome manipulator: concatenates all elements of a list.

Default chromosome manipulator: turns list into array.

Wraps the per-individual fitness loop in a tqdm bar when progress_bars is on.

Fitness evaluation is the slow part of a generation (an external QM call can take minutes per individual), so the bar counts individuals, not generations. tqdm writes to stderr, leaving the stdout/file logs clean.

Parameters: :param iterable: the iterable driving the fitness loop :param total: number of individuals to be evaluated :param desc: label shown to the left of the bar :param enabled: whether to show the bar at all

Returns: :return: iterable, wrapped in a tqdm bar if enabled