public GroupDietPopulationInitializer(Random random, List <Recipe> recipes, int numberOfMealsPerDay, List <PersonalData> personalData, GroupDietAnalyzer dietAnalyzer) { _random = random; _recipes = recipes; _numberOfMealsPerDay = numberOfMealsPerDay; _personalData = personalData; _dietAnalyzer = dietAnalyzer; InitializeRecipesForMealType(); }
public NsgaSolver GetGroupDietSolver(List <Recipe> recipes, List <PersonalData> personalData, Configuration configuration) { var groupDietAnalyzer = new GroupDietAnalyzer(); return(new NsgaSolver( new Sorter(), new GroupDietPopulationInitializer(new Random(), recipes, 5, personalData, groupDietAnalyzer), new GroupDietEvaluator(personalData, groupDietAnalyzer), new TournamentSelector(new CrowdedDistanceComparer(), TournamentSize, new Random()), new GroupDietCrossOver(new Random()), new GroupDietMutator(new Random(), recipes, personalData.Count, new GroupDietCorrector(groupDietAnalyzer, personalData, recipes)), configuration)); }
public GroupDietViewModel CreateGroupDietViewModel(GroupDietIndividual individual, List <PersonalData> personalDataList) { var groupDietViewModel = new GroupDietViewModel(); var dietAnalizer = new GroupDietAnalyzer(); groupDietViewModel.Evaluations = individual.Evaluations; foreach (var personalData in personalDataList) { var personDiet = new PersonDietViewModel(); personDiet.DietSummary = dietAnalizer.SummarizeForPerson(individual.GroupDiet, personalData.Id); personDiet.Meals = GetMealsViewModel(personDiet.DietSummary, individual, personalData); groupDietViewModel.PersonDietViewModels.Add(personDiet); } return(groupDietViewModel); }
public GroupDietEvaluator(List <PersonalData> personalData, GroupDietAnalyzer dietAnalyzer) { _dietAnalyzer = dietAnalyzer; _personalData = personalData; }
public GroupDietCorrector(GroupDietAnalyzer dietAnalyzer, List <PersonalData> personalData, List <Recipe> recipes) { _dietAnalyzer = dietAnalyzer; _personalData = personalData; _recipes = recipes; }