Individuals are currently stored as a collections.namedtuple but it could be beneficial to move to having an Individual class so that the fitness of an individual can be stored as an attribute. This sort of behaviour can be done with a namedtuple but requires a new instance of an individual be made once the fitness is evaluated. Not preferable.
The alternative would be to use functools.lru_cache or similar to store the fitness in memory elsewhere. This could also be potentially useful when assessing an individual which has turned up before (though unlikely to happen).
Individuals are currently stored as a
collections.namedtuple
but it could be beneficial to move to having anIndividual
class so that the fitness of an individual can be stored as an attribute. This sort of behaviour can be done with anamedtuple
but requires a new instance of an individual be made once the fitness is evaluated. Not preferable.The alternative would be to use
functools.lru_cache
or similar to store the fitness in memory elsewhere. This could also be potentially useful when assessing an individual which has turned up before (though unlikely to happen).