Thanks for the feedback. I'm leaning towards your option 2. For now
I've added a 'Peek' property to the Uint32IdGenerator class and made
the following changes:
363: genomeFactory.GenomeIdGenerator.Reset(Math.Max(genomeFactory.GenomeIdGenerator.Peek,
maxGenomeId+1));
363: genomeFactory.InnovationIdGenerator.Reset(Math.Max(genomeFactory.InnovationIdGenerator.Peek,
maxInnovationId+1));
I /think/ this addresses your problem, but would be interested in your
thoughts. I think I was intending that the genome factory would be a
new factory, but in terms of the API you are of course correct that
this isn't enforced, hence the other option is to simply enforce it
(e.g. throw an exception if the Id generators aren't set to zero).
I've checked these changes into SVN for now. I Suppose I'm a bit
concerned that re-using a factory probably means you have genome in
memory already and that therefore you could be loading genomes with
overlapping IDs, so you could be back to the same problem via a
different route. As a general rule I've tried to put debug assertions
to pick up stuff like this when running in debug mode - but it's not
really practical to test for everything.
Regards,
Colin.