private CombinedOperator CreateReseeder() { var reseeder = new CombinedOperator() { Name = "Reseed Layer Zero if needed" }; var reseedingController = new ReseedingController() { Name = "Reseeding needed (Generation % AgeGap == 0)?" }; var removeIndividuals = new SubScopesRemover(); var createIndividuals = new SolutionsCreator(); var initializeAgeProsessor = new UniformSubScopesProcessor(); var initializeAge = new VariableCreator() { Name = "Initialize Age" }; var incrEvaluatedSolutionsAfterReseeding = new SubScopesCounter() { Name = "Update EvaluatedSolutions" }; reseeder.OperatorGraph.InitialOperator = reseedingController; reseedingController.GenerationsParameter.ActualName = "Generations"; reseedingController.AgeGapParameter.ActualName = AgeGapParameter.Name; reseedingController.FirstLayerOperator = removeIndividuals; reseedingController.Successor = null; removeIndividuals.Successor = createIndividuals; createIndividuals.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; createIndividuals.Successor = initializeAgeProsessor; initializeAgeProsessor.Operator = initializeAge; initializeAgeProsessor.Successor = incrEvaluatedSolutionsAfterReseeding; initializeAge.CollectedValues.Add(new ValueParameter <DoubleValue>(AgeParameter.Name, new DoubleValue(0))); incrEvaluatedSolutionsAfterReseeding.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; incrEvaluatedSolutionsAfterReseeding.AccumulateParameter.Value = new BoolValue(true); return(reseeder); }
private CombinedOperator CreateReseeder() { var reseeder = new CombinedOperator() { Name = "Reseed Layer Zero if needed" }; var reseedingController = new ReseedingController() { Name = "Reseeding needed (Generation % AgeGap == 0)?" }; var removeIndividuals = new SubScopesRemover(); var createIndividuals = new SolutionsCreator(); var initializeAgeProsessor = new UniformSubScopesProcessor(); var initializeAge = new VariableCreator() { Name = "Initialize Age" }; var incrEvaluatedSolutionsAfterReseeding = new SubScopesCounter() { Name = "Update EvaluatedSolutions" }; reseeder.OperatorGraph.InitialOperator = reseedingController; reseedingController.GenerationsParameter.ActualName = "Generations"; reseedingController.AgeGapParameter.ActualName = AgeGapParameter.Name; reseedingController.FirstLayerOperator = removeIndividuals; reseedingController.Successor = null; removeIndividuals.Successor = createIndividuals; createIndividuals.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; createIndividuals.Successor = initializeAgeProsessor; initializeAgeProsessor.Operator = initializeAge; initializeAgeProsessor.Successor = incrEvaluatedSolutionsAfterReseeding; initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>(AgeParameter.Name, new DoubleValue(0))); incrEvaluatedSolutionsAfterReseeding.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; incrEvaluatedSolutionsAfterReseeding.AccumulateParameter.Value = new BoolValue(true); return reseeder; }
private ReseedingController(ReseedingController original, Cloner cloner) : base(original, cloner) { }