Esempio n. 1
0
        private void createReceptorOccupancyObserver(IObserverBuildingBlock observerBuildingBlock, IMoleculeBuilder protein, IMoleculeBuilder complex)
        {
            var observerName = CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.RECEPTOR_OCCUPANCY, complex.Name);
            var observer     = createFractionObserver(observerName, observerBuildingBlock, () => getReceptorOccupancyFormula(observerBuildingBlock, protein, complex));

            observer.AddMoleculeName(complex.Name);
        }
Esempio n. 2
0
        private void createFractionOfDoseObserverForCompound(Simulation simulation, IObserverBuildingBlock observerBuildingBlock, Compound compound)
        {
            var compoundProperties = simulation.CompoundPropertiesFor(compound);
            var processes          = compoundProperties.Processes;

            if (!compoundProperties.IsAdministered)
            {
                return;
            }

            if (_interactionTask.IsMetabolite(compound, simulation))
            {
                return;
            }

            //always add complex molecules if any
            var moleculeNames = processes.SpecificBindingSelection.AllEnabledPartialProcesses().Select(x => x.ProductName(CoreConstants.Molecule.Complex)).ToList();

            //Add sink metabolite
            moleculeNames.AddRange(processes.MetabolizationSelection.AllEnabledPartialProcesses().OfType <EnzymaticProcessSelection>()
                                   .Where(x => x.IsSink)
                                   .Select(x => x.ProductName()));

            if (!moleculeNames.Any())
            {
                return;
            }

            var observerName     = CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.FRACTION_OF_DOSE, compound.Name);
            var fractionObserver = createFractionObserver(observerName, observerBuildingBlock, () => getFractionOfDoseFormula(observerBuildingBlock, compound));

            moleculeNames.Each(fractionObserver.AddMoleculeName);
            addLiverZoneObserversBasedOn(fractionObserver, observerBuildingBlock, compound);
        }
Esempio n. 3
0
        private IFormula getReceptorOccupancyFormula(IObserverBuildingBlock observerBuildingBlock, IMoleculeBuilder protein, IMoleculeBuilder complex)
        {
            string receptorOccupancyObserver = $"ReceptorOccupancyObserver_{complex.Name}";

            if (observerBuildingBlock.FormulaCache.Contains(receptorOccupancyObserver))
            {
                return(observerBuildingBlock.FormulaCache[receptorOccupancyObserver]);
            }

            var receptorOccupancy = _objectBaseFactory.Create <ExplicitFormula>()
                                    .WithName(receptorOccupancyObserver)
                                    .WithFormulaString("Complex/(Protein + Complex)")
                                    .WithDimension(_dimensionRepository.Fraction);


            receptorOccupancy.AddObjectPath(_objectPathFactory.CreateFormulaUsablePathFrom(ObjectPath.PARENT_CONTAINER)
                                            .WithAlias("Complex")
                                            .WithDimension(_dimensionRepository.Amount));

            receptorOccupancy.AddObjectPath(_objectPathFactory.CreateFormulaUsablePathFrom(ObjectPath.PARENT_CONTAINER, ObjectPath.PARENT_CONTAINER, protein.Name)
                                            .WithAlias("Protein")
                                            .WithDimension(_dimensionRepository.Amount));

            observerBuildingBlock.FormulaCache.Add(receptorOccupancy);

            //reference to protein concentration has to be added for each receptor
            return(receptorOccupancy);
        }
Esempio n. 4
0
        public void Visit(IObserverBuildingBlock objToVisit)
        {
            var oldDrugMassPath = new ObjectPath(new[] { Applications, TotalDrugmassOld });

            updateTotalDrugMassReferences(objToVisit, oldDrugMassPath);
            _converted = true;
        }
 protected override void Context()
 {
     base.Context();
     _observer = new ObserverBuilder().WithName("NNNNNN");
     _observer.ContainerCriteria.Add(new MatchTagCondition(_changedName));
     _observerBuildingBlock = new ObserverBuildingBlock().WithName("Observer").WithId("Observer");
     _observerBuildingBlock.Add(_observer);
 }
Esempio n. 6
0
        private void createSimpleFractionObserver(Simulation simulation, IObserverBuildingBlock observerBuildingBlock, string observerName, string criteria)
        {
            var observer      = createFractionObserver(observerName, observerBuildingBlock, () => getFractionFormula(observerBuildingBlock));
            var compoundNames = simulation.Compounds.Where(x => !_interactionTask.IsMetabolite(x, simulation)).AllNames().ToList();

            compoundNames.Each(observer.AddMoleculeName);
            observer.ContainerCriteria = Create.Criteria(x => x.With(criteria));
        }
        public void TestComplexObserverBB()
        {
            ObserverBuildingBlock x1 = _buildConfiguration.Observers as ObserverBuildingBlock;

            Assert.IsNotNull(x1);

            IObserverBuildingBlock x2 = SerializeAndDeserialize(x1);

            AssertForSpecs.AreEqualBuildingBlock(x2, x1);
        }
 protected override void Context()
 {
     base.Context();
     _buildConfiguration               = A.Fake <IMoBiBuildConfiguration>();
     _templateBuildingBlock            = new ObserverBuildingBlock().WithId("TOTO").WithName("TOTO");
     _buildConfiguration.ObserversInfo = new ObserverBuildingBlockInfo
     {
         TemplateBuildingBlock = _templateBuildingBlock,
         SimulationChanges     = 1
     };
 }
Esempio n. 9
0
        protected override void Context()
        {
            base.Context();
            var monitor  = new ExplicitFormula("TotalDrugMass");
            var observer = new ContainerObserverBuilder().WithName("Tralala").WithFormula(monitor);

            _totalDrugMassReference = new FormulaUsablePath(new[] { "Applications", "TotalDrugMass" }).WithAlias("TotalDrugMass");
            monitor.AddObjectPath(_totalDrugMassReference);
            _observerBuildingBlock = new ObserverBuildingBlock();
            _observerBuildingBlock.Add(observer);
        }
Esempio n. 10
0
        private IAmountObserverBuilder createFractionObserver(string observerName, IObserverBuildingBlock observerBuildingBlock, Func <IFormula> getFormula)
        {
            var observer = _objectBaseFactory.Create <IAmountObserverBuilder>()
                           .WithName(observerName)
                           .WithDimension(_dimensionRepository.Fraction)
                           .WithFormula(getFormula());

            observer.ContainerCriteria.Add(new MatchAllCondition());

            observerBuildingBlock.Add(observer);
            return(observer);
        }
 protected override void Context()
 {
     _spatialStructureFactory      = A.Fake <IPKSimSpatialStructureFactory>();
     _modelObserverQuery           = A.Fake <IModelObserverQuery>();
     _modelPassiveTransportQuery   = A.Fake <IModelPassiveTransportQuery>();
     _parameterStartValueCreator   = A.Fake <IPKSimParameterStartValuesCreator>();
     _moleculesAndReactionsCreator = A.Fake <IMoleculesAndReactionsCreator>();
     _eventBuildingBlockCreator    = A.Fake <IEventBuildingBlockCreator>();
     _moleculeStartValueCreator    = A.Fake <IPKSimMoleculeStartValuesCreator>();
     _moleculeCalculationRetriever = A.Fake <IMoleculeCalculationRetriever>();
     _distributedTableConverter    = A.Fake <IDistributedParameterToTableParameterConverter>();
     _parameterDefaultStateUpdater = A.Fake <IParameterDefaultStateUpdater>();
     _cm1        = new CoreCalculationMethod();
     _cm2        = new CoreCalculationMethod();
     _simulation = new IndividualSimulation {
         Properties = new SimulationProperties()
     };
     _simulation.SimulationSettings = new SimulationSettings();
     _simulation.ModelConfiguration = new ModelConfiguration();
     _individual                      = new Individual().WithName("MyIndividuyal");
     _compound                        = A.Fake <Compound>().WithName("MyCompound");
     _protocol                        = new SimpleProtocol().WithName("MyProtocol");
     _spatialStructure                = A.Fake <ISpatialStructure>();
     _passiveTransportBuilingBlock    = A.Fake <IPassiveTransportBuildingBlock>();
     _observerBuildingBlock           = A.Fake <IObserverBuildingBlock>();
     _eventBuildingBlock              = A.Fake <IEventGroupBuildingBlock>();
     _parameterValuesBuildingBlock    = A.Fake <IParameterStartValuesBuildingBlock>();
     _moleculeStartValueBuildingBlock = A.Fake <IMoleculeStartValuesBuildingBlock>();
     _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Individual", PKSimBuildingBlockType.Individual)
     {
         BuildingBlock = _individual
     });
     _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Compound", PKSimBuildingBlockType.Compound)
     {
         BuildingBlock = _compound
     });
     _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Protocol", PKSimBuildingBlockType.Protocol)
     {
         BuildingBlock = _protocol
     });
     A.CallTo(() => _moleculeCalculationRetriever.AllMoleculeCalculationMethodsUsedBy(_simulation)).Returns(new[] { _cm1, _cm2 });
     A.CallTo(() => _spatialStructureFactory.CreateFor(_individual, _simulation)).Returns(_spatialStructure);
     A.CallTo(() => _modelPassiveTransportQuery.AllPassiveTransportsFor(_simulation)).Returns(_passiveTransportBuilingBlock);
     A.CallTo(() => _modelObserverQuery.AllObserversFor(A <IMoleculeBuildingBlock> .Ignored, _simulation)).Returns(_observerBuildingBlock);
     A.CallTo(() => _eventBuildingBlockCreator.CreateFor(_simulation)).Returns(_eventBuildingBlock);
     A.CallTo(() => _parameterStartValueCreator.CreateFor(A <IBuildConfiguration> .Ignored, A <Simulation> .Ignored)).Returns(_parameterValuesBuildingBlock);
     A.CallTo(() => _moleculeStartValueCreator.CreateFor(A <IBuildConfiguration> .Ignored, A <Simulation> .Ignored)).Returns(_moleculeStartValueBuildingBlock);
     sut = new BuildConfigurationTask(_spatialStructureFactory, _modelObserverQuery, _modelPassiveTransportQuery, _parameterStartValueCreator,
                                      _moleculesAndReactionsCreator, _eventBuildingBlockCreator, _moleculeStartValueCreator, _moleculeCalculationRetriever,
                                      _distributedTableConverter, _parameterDefaultStateUpdater);
 }
Esempio n. 12
0
        protected override void Context()
        {
            _buildingBlock = new ObserverBuildingBlock();
            _context       = A.Fake <IMoBiContext>();
            _newDimension  = DimensionFactoryForSpecs.Factory.Dimension(DimensionFactoryForSpecs.DimensionNames.Mass);
            _oldDimension  = DimensionFactoryForSpecs.Factory.Dimension(DimensionFactoryForSpecs.DimensionNames.Concentration);

            _observedBuilder = new ObserverBuilder
            {
                Dimension = _oldDimension,
                Formula   = new ConstantFormula(5).WithDimension(_oldDimension)
            }.WithId("5");

            sut = new UpdateDimensionInObserverBuilderCommand(_observedBuilder, _newDimension, _buildingBlock);
        }
Esempio n. 13
0
        private void createFractionOfDoseObserverForCompound(Simulation simulation, IObserverBuildingBlock observerBuildingBlock, Compound compound)
        {
            var compoundProperties = simulation.CompoundPropertiesFor(compound);
            var processes          = compoundProperties.Processes;

            if (!compoundProperties.IsAdministered)
            {
                return;
            }

            if (_interactionTask.IsMetabolite(compound, simulation))
            {
                return;
            }

            //always add complex molecules if any
            var moleculeNames = processes.SpecificBindingSelection.AllEnabledPartialProcesses().Select(x => x.ProductName(CoreConstants.Molecule.Complex)).ToList();

            //Add sink metabolites
            var enzymaticProcessProductNames = processes.MetabolizationSelection.AllEnabledPartialProcesses().OfType <EnzymaticProcessSelection>()
                                               .Where(x => x.IsSink)
                                               .Select(x => x.ProductName()).ToList();

            moleculeNames.AddRange(enzymaticProcessProductNames);

            if (!moleculeNames.Any())
            {
                return;
            }

            //Local fraction of dose observer defined per instance of the metabolization or specific binding process
            var observerName     = CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.FRACTION_OF_DOSE, compound.Name);
            var fractionObserver = createAmountFractionObserver(observerName, observerBuildingBlock, () => getFractionOfDoseFormula(observerBuildingBlock, compound));

            moleculeNames.Each(fractionObserver.AddMoleculeName);

            //Add liver zone specific observers based on this observer
            addLiverZoneObserversBasedOn(fractionObserver, observerBuildingBlock, compound);

            //Global fraction of dose observers. One per complex or binding process defined globally under organism
            var totalFractionObserverName = CoreConstants.Observer.ObserverNameFrom(CoreConstants.Observer.TOTAL_FRACTION_OF_DOSE, compound.Name);
            var totalFractionObserver     = createContainerFractionObserver(totalFractionObserverName, observerBuildingBlock, () => getTotalFractionOfDoseFormula(observerBuildingBlock, compound, observerName));

            totalFractionObserver.ContainerCriteria = Create.Criteria(x => x.With(Constants.ORGANISM));
            moleculeNames.Each(totalFractionObserver.AddMoleculeName);
        }
Esempio n. 14
0
        private void addStandardObserversTo(Simulation simulation, IObserverBuildingBlock observerBuildingBlock, IMoleculeBuildingBlock moleculeBuildingBlock)
        {
            var allMoleculesNeedingConcentrationObservers = moleculeBuildingBlock.Where(concentrationIsNeeded).Select(x => x.Name).ToList();
            var compoundNames = simulation.CompoundNames;

            foreach (var observerTemplate in _observerBuilderRepository.AllFor(simulation.ModelProperties))
            {
                if (isDrugFcRnObserver(observerTemplate))
                {
                    //special case: protein model observer for drug and its FcRn complex.
                    //Observer must be created separately for every drug because complexname can not be referenced in generic way by now
                    //E.g.: for drug C1, Observer is f("C1", "C1-FcRn_Complex"))
                    foreach (var compoundName in compoundNames)
                    {
                        var observer = _cloneManager.Clone(observerTemplate.ObserverBuilder, observerBuildingBlock.FormulaCache);
                        observer.Name = CoreConstants.Observer.ObserverNameFrom(observer.Name, compoundName);

                        observer.Formula.ReplaceKeywordsInObjectPaths(
                            new[] { CoreConstants.Molecule.DrugFcRnComplexTemplate },
                            new[] { CoreConstants.Molecule.DrugFcRnComplexName(compoundName) }
                            );

                        observer.AddMoleculeName(compoundName);

                        observerBuildingBlock.Add(observer);
                    }
                }
                else
                {
                    var observer = _cloneManager.Clone(observerTemplate.ObserverBuilder, observerBuildingBlock.FormulaCache);

                    compoundNames.Each(observer.AddMoleculeName);

                    if (observer.IsConcentration())
                    {
                        allMoleculesNeedingConcentrationObservers.Each(observer.AddMoleculeName);
                    }

                    observerBuildingBlock.Add(observer);
                }
            }
        }
        protected override void Context()
        {
            _observerMapper        = A.Fake <IObserverBuilderToObserverMapper>();
            _buildConfiguration    = A.Fake <IBuildConfiguration>();
            _observerBuildingBlock = new ObserverBuildingBlock();
            _model = A.Fake <IModel>();
            _buildConfiguration.Observers = _observerBuildingBlock;
            A.CallTo(() => _buildConfiguration.AllPresentMolecules()).Returns(new[] { A.Fake <IMoleculeBuilder>().WithName(_molecule1), A.Fake <IMoleculeBuilder>().WithName(_molecule2) });
            _rootContainer = new Container();

            _organism = new Container().WithName("Organism");
            _organism.AddTag(new Tag("Organism"));
            _rootContainer.Add(_organism);

            _rootNeihgborhood    = new Container();
            _model.Root          = _rootContainer;
            _model.Neighborhoods = _rootNeihgborhood;
            _keywordReplacerTask = A.Fake <IKeywordReplacerTask>();
            _containerTask       = A.Fake <IContainerTask>();
            sut = new ObserverBuilderTask(_observerMapper, _containerTask, _keywordReplacerTask);
        }
Esempio n. 16
0
        private IFormula getFractionFormula(IObserverBuildingBlock observerBuildingBlock, string formulaName, string pathToDrugMass)
        {
            if (observerBuildingBlock.FormulaCache.Contains(formulaName))
            {
                return(observerBuildingBlock.FormulaCache[formulaName]);
            }

            var fractionFormula = _objectBaseFactory.Create <ExplicitFormula>()
                                  .WithName(formulaName)
                                  .WithFormulaString($"{TOTAL_DRUG_MASS_ALIAS}>0 ? M/{TOTAL_DRUG_MASS_ALIAS} : 0")
                                  .WithDimension(_dimensionRepository.Fraction);

            fractionFormula.AddObjectPath(_objectPathFactory.CreateFormulaUsablePathFrom(ObjectPath.PARENT_CONTAINER)
                                          .WithAlias("M")
                                          .WithDimension(_dimensionRepository.Amount));

            fractionFormula.AddObjectPath(createTotalDrugMassObjectPath(pathToDrugMass));

            observerBuildingBlock.AddFormula(fractionFormula);
            return(fractionFormula);
        }
        protected override void Context()
        {
            _buildConfiguration           = new MoBiBuildConfiguration();
            _moleculeBuidingBlock         = new MoleculeBuildingBlock().WithName("M");
            _buildConfiguration.Molecules = _moleculeBuidingBlock;

            _reactionBuildingBlock = new MoBiReactionBuildingBlock().WithName("R");
            _reactionBuildingBlock.Add(new ReactionBuilder().WithName("R1"));
            _buildConfiguration.Reactions = _reactionBuildingBlock;

            _passiveTransportBuildingBlock = new PassiveTransportBuildingBlock().WithName("PT");
            _passiveTransportBuildingBlock.Add(new TransportBuilder().WithName("PT2"));
            _passiveTransportBuildingBlock.Add(new TransportBuilder().WithName("PT1"));
            _buildConfiguration.PassiveTransports = _passiveTransportBuildingBlock;

            _eventGroupBuildingBlock        = new EventGroupBuildingBlock().WithName("EG");
            _buildConfiguration.EventGroups = _eventGroupBuildingBlock;

            _msvBuildingBlock = new MoleculeStartValuesBuildingBlock().WithName("MSV");
            _buildConfiguration.MoleculeStartValues = _msvBuildingBlock;

            _psvBuildingBlock = new ParameterStartValuesBuildingBlock().WithName("PSV");
            _buildConfiguration.ParameterStartValues = _psvBuildingBlock;

            _spatialStructure = new MoBiSpatialStructure().WithName("SPST");
            _buildConfiguration.SpatialStructure = _spatialStructure;

            _observerBuildingBlock        = new ObserverBuildingBlock().WithName("O");
            _buildConfiguration.Observers = _observerBuildingBlock;

            _objectPathFactory  = new ObjectPathFactory(new AliasCreator());
            _entityPathResolver = new EntityPathResolver(_objectPathFactory);
            sut = new AffectedBuildingBlockRetriever(_entityPathResolver);

            //common setup
            _simulation = new MoBiSimulation {
                BuildConfiguration = _buildConfiguration
            };
        }
Esempio n. 18
0
        private IFormula getTotalFractionOfDoseFormula(IObserverBuildingBlock observerBuildingBlock, Compound compound, string fractionOfDoseObserverName)
        {
            var formulaName = $"TotalFractionOfDose_{compound.Name}";

            if (observerBuildingBlock.FormulaCache.Contains(formulaName))
            {
                return(observerBuildingBlock.FormulaCache[formulaName]);
            }

            var sumFormula = _objectBaseFactory.Create <SumFormula>()
                             .WithName(formulaName)
                             .WithDimension(_dimensionRepository.Fraction);

            //This will collect all observer named 'fractionOfDoseObserverName' for the molecule where the observer is defined.
            sumFormula.Criteria = Create.Criteria(x => x.With(ObjectPathKeywords.MOLECULE));
            sumFormula.Variable = "M";
            sumFormula.AddObjectPath(createTotalDrugMassObjectPath(compound.Name));
            sumFormula.FormulaString = $"({TOTAL_DRUG_MASS_ALIAS} > 0 ? {sumFormula.VariablePattern}/{TOTAL_DRUG_MASS_ALIAS} : 0)";

            observerBuildingBlock.AddFormula(sumFormula);
            return(sumFormula);
        }
Esempio n. 19
0
 protected override void Context()
 {
     base.Context();
     _project = A.Fake <IMoBiProject>();
     _objectBaseRepository      = A.Fake <IWithIdRepository>();
     _spatialStructure          = A.Fake <IMoBiSpatialStructure>();
     _simulationSettings        = A.Fake <ISimulationSettings>();
     _moBiReactionBuildingBlock = A.Fake <IMoBiReactionBuildingBlock>();
     _moleculeBuildingBlock     = A.Fake <IMoleculeBuildingBlock>();
     A.CallTo(() => _context.CurrentProject).Returns(_project);
     A.CallTo(() => _context.Create <IMoleculeBuildingBlock>()).Returns(_moleculeBuildingBlock);
     A.CallTo(() => _context.Create <IMoBiReactionBuildingBlock>()).Returns(_moBiReactionBuildingBlock);
     A.CallTo(() => _spatialStructureFactory.CreateDefault(AppConstants.DefaultNames.SpatialStructure)).Returns(_spatialStructure);
     A.CallTo(() => _simulationSettingsFactory.CreateDefault()).Returns(_simulationSettings);
     _topContainer = A.Fake <IContainer>();
     A.CallTo(() => _context.Create <IContainer>()).Returns(_topContainer);
     _passiveTransportBuildingBlock = A.Fake <IPassiveTransportBuildingBlock>();
     A.CallTo(() => _context.Create <IPassiveTransportBuildingBlock>()).Returns(_passiveTransportBuildingBlock);
     _observerBuildingBlock = A.Fake <IObserverBuildingBlock>();
     A.CallTo(() => _context.Create <IObserverBuildingBlock>()).Returns(_observerBuildingBlock);
     _eventGroupBuildingBlock = A.Fake <IEventGroupBuildingBlock>();
     A.CallTo(() => _context.Create <IEventGroupBuildingBlock>()).Returns(_eventGroupBuildingBlock);
     A.CallTo(() => _context.ObjectRepository).Returns(_objectBaseRepository);
 }
Esempio n. 20
0
        private IFormula getFractionOfDoseFormula(IObserverBuildingBlock observerBuildingBlock, Compound compound)
        {
            var formulaName = $"FractionOfDose_{compound.Name}";

            return(getFractionFormula(observerBuildingBlock, formulaName, compound.Name));
        }
Esempio n. 21
0
 private IFormula getFractionFormula(IObserverBuildingBlock observerBuildingBlock)
 {
     return(getFractionFormula(observerBuildingBlock, "FractionObserver", ObjectPathKeywords.MOLECULE));
 }
Esempio n. 22
0
        private void addLiverZoneCompartmentObserver(IObserverBuilder observerBuilder, string compartment, IObserverBuildingBlock observerBuildingBlock, Compound compound)
        {
            var observerName = CoreConstants.CompositeNameFor(observerBuilder.Name, CoreConstants.Organ.Liver, compartment);

            if (observerBuildingBlock.ExistsByName(observerName))
            {
                return;
            }

            var observer = _objectBaseFactory.Create <IContainerObserverBuilder>()
                           .WithName(observerName)
                           .WithDimension(_dimensionRepository.Fraction);

            observer.ForAll = false;
            observerBuilder.MoleculeNames().Each(observer.AddMoleculeName);

            observer.ContainerCriteria = Create.Criteria(x => x.With(CoreConstants.Organ.Liver)
                                                         .And.With(compartment)
                                                         .And.Not(CoreConstants.Compartment.Pericentral)
                                                         .And.Not(CoreConstants.Compartment.Periportal));

            var formula = _objectBaseFactory.Create <ExplicitFormula>()
                          .WithName(observerName)
                          .WithFormulaString("(M_periportal + M_pericentral)/" + TOTAL_DRUG_MASS_ALIAS)
                          .WithDimension(_dimensionRepository.Fraction);

            formula.AddObjectPath(createZoneAmoutPath(compartment, CoreConstants.Compartment.Periportal, "M_periportal"));
            formula.AddObjectPath(createZoneAmoutPath(compartment, CoreConstants.Compartment.Pericentral, "M_pericentral"));
            formula.AddObjectPath(createTotalDrugMassObjectPath(compound.Name));

            observer.Formula = formula;
            observerBuildingBlock.Add(observer);
            observerBuildingBlock.AddFormula(formula);
        }
Esempio n. 23
0
 private void addLiverZoneObserversBasedOn(IObserverBuilder observerBuilder, IObserverBuildingBlock observerBuildingBlock, Compound compound)
 {
     CoreConstants.Compartment.LiverCompartments.Each(compartment => addLiverZoneCompartmentObserver(observerBuilder, compartment, observerBuildingBlock, compound));
 }
Esempio n. 24
0
        public void UpdateObserverForAllFlag(IObserverBuildingBlock observerBuildingBlock)
        {
            var allObserversForAll = observerBuildingBlock.Where(x => x.NameIsOneOf(CoreConstants.Observer.MoBiForAll));

            allObserversForAll.Each(x => x.ForAll = true);
        }
Esempio n. 25
0
 private void createFractionOfDoseObserver(Simulation simulation, IObserverBuildingBlock observerBuildingBlock)
 {
     simulation.Compounds.Each(c => createFractionOfDoseObserverForCompound(simulation, observerBuildingBlock, c));
 }
Esempio n. 26
0
 protected override void Because()
 {
     _observers = sut.AllObserversFor(_moleculeBuildingBlock, _simulation);
 }
Esempio n. 27
0
 private void createFractionExcretedToUrineObserver(Simulation simulation, IObserverBuildingBlock observerBuildingBlock)
 {
     createSimpleFractionObserver(simulation, observerBuildingBlock, CoreConstants.Observer.FRACTION_EXCRETED_TO_URINE, CoreConstants.Compartment.URINE);
 }
Esempio n. 28
0
 private void createFractionOfDoseExcretedToFecesObserver(Simulation simulation, IObserverBuildingBlock observerBuildingBlock)
 {
     createSimpleFractionObserver(simulation, observerBuildingBlock, CoreConstants.Observer.FRACTION_EXCRETED_TO_FECES, CoreConstants.Compartment.FECES);
 }
Esempio n. 29
0
 public void Visit(IObserverBuildingBlock observerBuildingBlock)
 {
     convert(observerBuildingBlock);
     _converted = true;
 }
Esempio n. 30
0
 private void createFractionOfDoseExcretedToBileObserver(Simulation simulation, IObserverBuildingBlock observerBuildingBlock)
 {
     createSimpleFractionObserver(simulation, observerBuildingBlock, CoreConstants.Observer.FRACTION_EXCRETED_TO_BILE, CoreConstants.Organ.Gallbladder);
 }