Hi
I need to access some data (which is not contained in Genome) to compute fitness. I looked in the documentation but didn't find a way to pass additional data to the Evaluate function. One option would be using global variables, but i think that is not the best way.
Do you have any ideas?
I'm trying to find the best schedulling of matches of a tournament based on some constraints. I have a **list of slots**, a **list of players** (and which slots they can play) and a **list of matches** (consisting of two players). I'm using the total number of times that the genome breaks the contraints as fitness value, and this depends on the highlighted data.
I got very good results using eaopt! But now i want to move this to a http server, so i need some way to pass these data to the Evaluate function.
I'm not sure I understand everything because I'm tired :). Typically I would proceed by adding properties to your genome. That is, the genome would have 3 properties which are your lists (in Go they're called slices).
Sorry for reopening, i just have one more question: i also need access to this data in GenomeFactory function, but it also doesn't accept additional parameters.
No worries mate! Well a solution would to create a struct with the parameters of your experiment. You could then assign a method to this struct which would create random `Genome`s. Do you see what I mean?
Normally that should not be an issue because each genome has a slice, which is a pointer to a data array. That is, the data is not duplicated. If you change one of the lists it will be modified across each genome.