I am doing a genetic algorithm my individual have various immutable characteristics, one of them being their fitness. The problem I have with it is that fitness is somewhat expensive and can be requested zero (the individual will undergo some transformation and the fitness of the intermediary state is not required), one or many times (possibly in parallel).
I do not want to compute unnecessary fitnesses. How can I have my fitness computation be triggered on first access and reused afterward? I thought of a get-fitness fonction that would be memoized but since individuals are short-lived in genetic algorithms and a lot of them are created, that function would have a huge cache of obsolete fitnesses. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---