public DietController(RequirementsProvider requirementsProvider, NsgaSolverFactory nsgaSolverFactory, IRecipeProvider recipeProvider) { _requirementsProvider = requirementsProvider; _nsgaSolverFactory = nsgaSolverFactory; _recipeProvider = recipeProvider; RInvoker.Path = HostingEnvironment.MapPath(@"~/Content"); }
private static List <PersonalData> GetPersonalData() { var rp = new RequirementsProvider(); var pd = new List <PersonalData> { new PersonalData { Age = 25, Gender = Gender.M, Height = 185, Weight = 85, Pal = 1.5, Id = 0, }, new PersonalData { Age = 22, Gender = Gender.K, Height = 160, Weight = 50, Pal = 1.8, Id = 1 }, new PersonalData { Age = 35, Gender = Gender.M, Height = 220, Weight = 110, Pal = 1.9, Id = 2, }, new PersonalData { Age = 44, Gender = Gender.K, Height = 170, Weight = 65, Pal = 1.3, Id = 3 } }; var preferences = Getpreferences(); pd.ForEach(d => d.Requirements = rp.GetRequirements(d, 5)); pd.ForEach(d => d.Preferences = preferences); return(pd); }