private void addLocalParametersToMolecule(IModel model, IBuildConfiguration buildConfiguration)
        {
            // retrieve all molecules container defined int the spatial structure
            var allMoleculePropertiesContainer = model.Root.GetAllChildren <IContainer>(x => x.IsNamed(Constants.MOLECULE_PROPERTIES)).ToList();

            var allPresentMolecules = buildConfiguration.AllPresentXenobioticFloatingMoleculeNames().ToList();
            var allEndogenous       = buildConfiguration.AllPresentEndogenousStationaryMoleculeNames().ToList();

            foreach (var moleculePropertiesContainer in allMoleculePropertiesContainer)
            {
                addLocalStructureMoleculeParametersToMoleculeAmount(allPresentMolecules, moleculePropertiesContainer, buildConfiguration, model, x => !isEdogenousParameter(x));
                addLocalStructureMoleculeParametersToMoleculeAmount(allEndogenous, moleculePropertiesContainer, buildConfiguration, model, isEdogenousParameter);

                // remove the molecule properties container only used as template
                moleculePropertiesContainer.ParentContainer.RemoveChild(moleculePropertiesContainer);
            }
        }
        public IContainer MapFrom(IModel model, IBuildConfiguration buildConfiguration)
        {
            var moleculeNames = buildConfiguration.AllPresentFloatingMoleculeNames();

            var neighborhoodsParentContainer = _objectBaseFactory.Create <IContainer>()
                                               .WithMode(ContainerMode.Logical)
                                               .WithName(Constants.NEIGHBORHOODS);

            var startValuesForFloatingMolecules = presentMoleculesCachedByContainerPath(moleculeNames, buildConfiguration);

            var moleculeNamesCopyProperties = buildConfiguration.AllPresentXenobioticFloatingMoleculeNames();

            buildConfiguration.SpatialStructure.Neighborhoods.Each(nb =>
                                                                   neighborhoodsParentContainer.Add(_neighborhoodMapper.MapFrom(nb,
                                                                                                                                model,
                                                                                                                                buildConfiguration,
                                                                                                                                moleculeNamesFor(nb, startValuesForFloatingMolecules),
                                                                                                                                moleculeNamesCopyProperties)));

            return(neighborhoodsParentContainer);
        }