示例#1
0
 public SolutionStrategyFactory(
     IRandomSolutionGenerator randomSolutionGenerator,
     IParentSelection parentSelection,
     IRecombination recombination,
     IBestSolutionFinder bestSolutionFinder,
     IMutation mutation,
     ISolutionEvaluator solutionEvaluator,
     IAdptiveChanceAdjuster adptiveChanceAdjuster,
     ICSVFileWriter csvFileWriter
     )
 {
     this.randomSolutionGenerator = randomSolutionGenerator;
     this.parentSelection         = parentSelection;
     this.recombination           = recombination;
     this.bestSolutionFinder      = bestSolutionFinder;
     this.mutation              = mutation;
     this.solutionEvaluator     = solutionEvaluator;
     this.adptiveChanceAdjuster = adptiveChanceAdjuster;
     this.csvFileWriter         = csvFileWriter;
 }
        public EvolutionarySolution(
            IRandomSolutionGenerator randomSolutionGenerator,
            IParentSelection parentSelection,
            IRecombination recombination,
            IBestSolutionFinder bestSolutionFinder,
            IMutation mutation,
            ISolutionEvaluator solutionEvaluator,
            IAdptiveChanceAdjuster adptiveChanceAdjuster
            )
        {
            this.randomSolutionGenerator = randomSolutionGenerator;
            this.parentSelection         = parentSelection;
            this.recombination           = recombination;
            this.bestSolutionFinder      = bestSolutionFinder;
            this.mutation              = mutation;
            this.solutionEvaluator     = solutionEvaluator;
            this.adptiveChanceAdjuster = adptiveChanceAdjuster;

            solutions = new Dictionary <int, Solution>();

            parentPopulation    = new List <Solution>();
            offspringPopulation = new List <Solution>();
        }