navicatGA.helpers¶
Classes¶
Functions¶
|
|
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. |
Module Contents¶
- class navicatGA.helpers.GAResult¶
Bases:
tuple- best_fitness¶
- best_individual¶
- best_pfitness¶
- fitness¶
- generations¶
- population¶
- runtime¶
- navicatGA.helpers.check_error(func, *args, **kw)¶
- navicatGA.helpers.concatenate_list()¶
Default chromosome manipulator: concatenates all elements of a list.
- navicatGA.helpers.get_elapsed_time(start_time, end_time)¶
- navicatGA.helpers.get_input_dimensions(lst, n_dim=0)¶
- navicatGA.helpers.make_array()¶
Default chromosome manipulator: turns list into array.
- navicatGA.helpers.track_evaluations(iterable, total, desc, enabled)¶
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