what about memoizing the fitness function? call fitness on your
structs, and if it's memoized, it will return the cached value as long
as the struct is the same value. if it's changed, then it will
recompute. somebody correct me if this doesn't account for something,
but it sounds like the right approach.

On Mar 5, 7:47 pm, Dan <redalas...@gmail.com> wrote:
> Thanks for the advice, I never noticed delay existed!
>
> It turns out I cannot put the fitness directly into the struct that
> contains individuals. It would mean that every mutating function would
> need to "reset" the fitness computation to avoid propagating a
> misleading fitness and that's clearly not their job. I can put it in
> the metadata and then it will not be carried on when I assoc and
> dissoc things in the struct. However, adding meta returns a new object
> that's the same as the old but with the meta added so I cannot add the
> fitness function to the metadata just before computation because other
> threads holding the data would keep their old objects.
>
> Beside burdening my mutation functions with keeping the fitness up to
> date, I don't see what I can do. Is there something I'm missing?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to