Closed constructor-igor closed 5 years ago
Part of the loop is performed here: https://github.com/giacomelli/GeneticSharp/blob/master/src/GeneticSharp.Domain/GeneticAlgorithm.cs#L315
However, I did not understand why you cannot use the solution from #45, because as you can see here every generation evolved calls the Population.CreateNewGeneration(newGenerationChromosomes)
.
Please, could you explain better why you cannot use CreateNewGeneration
?
thank you for information. I'll investigate it. Because design of our system, I cannot inject "fitness calculator" inside ExternalEvaluationPopulation. External loop should get population, calculate fitness outside of any "genetic classes" and inject calculate fitness inside genetic to generate new population.
while (geneticAlgoritm.InProgress){
population = geneticAlgoritm.GetPopulation(); // get population
CalculateFitness(population) // [our code] calculate and set Fitness value to each chromosome
geneticAlgoritm.SetFitness(population) // set fitness
}
I investigated code in your suggestion. Now, I better understand how can I change code for our integration. Thank you!
Nice! Let me know if you will need any advice in the future and whether your integration worked.
Please, could you help me to understand next issue: I cannot compile class GeneticAlgorithm, because a error in line: https://github.com/giacomelli/GeneticSharp/blob/ac17144427e31f2a073cac87a79ae14a4912e013/src/GeneticSharp.Domain/GeneticAlgorithm.cs#L427
Hi,
We made feasibility of GeneticSharp and now we investigate how GeneticSharp can be integrated with our system and found a next issue: our system manages external loop and requires to get population to calculate Fitness and set calcualted Fitness values to algorithm. So, I cannot calculate fitness in CreateNewGeneration (as suggested in #45).
sample of pseudo code:
Looks, I need find loop inside GeneticSharp and, somehow, to re-implement for our control. Please, could you help me to understand what is the easiest way to implement the feature and I'll try to do it.
thank you, Igor.