public IParameterValueCache CreatePopulation(PopulationSettings matlabPopulationSettings, IEnumerable <MoleculeOntogeny> moleculeOntogenies) { var populationSettings = _populationSettingsMapper.MapFrom(matlabPopulationSettings); var population = _randomPopulationFactory.CreateFor(populationSettings, new CancellationToken()).Result; foreach (var moleculeOntogeny in moleculeOntogenies) { var allOntogeniesForSpecies = _ontogenyRepository.AllFor(matlabPopulationSettings.Individual.OriginData.Species).ToList(); if (!allOntogeniesForSpecies.Any()) { continue; } var ontogeny = allOntogeniesForSpecies.FindByName(moleculeOntogeny.Ontogeny); if (ontogeny == null) { continue; } var molecule = _individualEnzymeFactory.CreateEmpty().WithName(moleculeOntogeny.Molecule); molecule.Ontogeny = ontogeny; population.AddMolecule(molecule); } _ontogenyVariabilityUpdater.UpdateAllOntogenies(population); return(population.IndividualPropertiesCache); }
public IParameterValueCache CreatePopulation(PopulationSettings matlabPopulationSettings, IEnumerable <string> moleculeNames) { var populationSettings = _populationSettingsMapper.MapFrom(matlabPopulationSettings); var population = _randomPopulationFactory.CreateFor(populationSettings, new CancellationToken()).Result; return(population.IndividualPropertiesCache); }