You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the implementation introduced in #180 , we check for alternative permissible values for each gene every time we call the mutate method. This is wasteful since we can just do this once in the __init__ of Genome and store the results in a data structure.
This ticket is therefore about investigating this and implementing the change if deemed feasible.
The text was updated successfully, but these errors were encountered:
As a side note: We can not directly initialize the alternative permissible value, but only all permissible values for a gene, since the former depends on the current allele (basically: alternative_permissible_values = all_permissible_values \ {current_value})
this might save quite some computation time at the expense of increased memory usage and slower instantiation of Genome objects. as always, the root of all evil is premature optimization, so i wouldn't implement this without profiling and finding that this is indeed a bottleneck. maybe a more lightweight compromise would be some kind of memoization, e.g., decorating the function determining all permissible values with the lru cache decorator.
Given that the memory footprint of the data structure to be stored is probably very small, and that the function determining all permissible value is always called with the same argument (the configuration of the dna, if it it determine all permissible value as suggested by @HenrikMettler above), I think that memoization is not a good alternative.
In the implementation introduced in #180 , we check for alternative permissible values for each gene every time we call the mutate method. This is wasteful since we can just do this once in the
__init__
ofGenome
and store the results in a data structure.This ticket is therefore about investigating this and implementing the change if deemed feasible.
The text was updated successfully, but these errors were encountered: