Individuals inheritance fix
Created by: MorrisNein
These changes elaborate the PR #700.
- Python objects change list:
-
IndividualandParentOperatorclasses are now frozen data classes; - Every uid now normally exists in a single Individual object. This is a soft restriction, though, and any violation will be noticed with warning;
-
fitnessandgraphofIndividualnow can be updated only once - during its evaluation; -
Individualhas a new attribute callednative_generation. It points to the number of generation in which the individual is obtained; -
parent_operatorsof individuals are not cleaned in every generation any more; -
Individual.parent_operatorsandParentOperator.parent_individualsare now tuples; - Side change: Moved
SingletonMetafromfedot.core.logtofedot.core.utilities.singleton_meta - Bug fix:
OptNodenow acceptscontentwithparams, not replacing parameters with default stub. - Minor:
indargument ofmutate()now has explicit nameindividual; - Minor: many typing fixes.
-
OptHitsoryserialization change list:
- Serialized
OptHistorynow has an attribute calledindividuals_pool. It contains all unique individuals from the history; - In history JSON,
individualsandarchive_historynow contain only uids that point to the elements ofindividuals_pool; - Any intermediate parent, that is not represented in any generation, is placed to
individuals_pool. Its children point to it via its uid; - As a bonus, newly-saved history JSONs now take much less size (about 10+ times lesser);
- All individuals not found in loaded histories now are re-created with the same uid. Their metadata contains an explicit message explaining that they are missing;
- Added support for relatively recent histories;
- Improved
OptHistorytests to guarantee stability and backward compatibility; - Updated the histories stored in Git repo.