public IMoleculeBuilder MapFrom(FlatMolecule flatMolecule, IFormulaCache formulaCache) { var molecule = _objectBaseFactory.Create <IMoleculeBuilder>(); molecule.Name = flatMolecule.Id; molecule.IsFloating = flatMolecule.IsFloating; molecule.QuantityType = flatMolecule.MoleculeType; molecule.DefaultStartFormula = _formulaFactory.RateFor(flatMolecule, new FormulaCache()); _parameterContainerTask.AddMoleculeParametersTo(molecule, formulaCache); return(molecule); }
private void addDrugParametersTo(IMoleculeBuilder molecule, IFormulaCache formulaCache) { var allExistingParameters = molecule.AllParameters().ToList(); molecule.Name = CoreConstants.Molecule.Drug; _parameterContainerTask.AddMoleculeParametersTo(molecule, formulaCache); foreach (var parameter in molecule.AllParameters().Where(p => !allExistingParameters.Contains(p))) { parameter.BuildingBlockType = PKSimBuildingBlockType.Simulation; parameter.Visible = false; parameter.CanBeVariedInPopulation = false; molecule.Add(parameter); } setDefaultParameterValues(molecule); //default value for floating in lumen should be 0 molecule.Parameter(CoreConstants.Parameter.IS_FLOATING_IN_LUMEN).Value = 0; }