Esempio n. 1
0
        protected override void Context()
        {
            base.Context();
            var otherParameterRate = new PKSimParameter().WithFormula(new ExplicitFormula("another formula")).WithName(_paramRate1.Name);

            _organ.Add(otherParameterRate);
        }
Esempio n. 2
0
        protected override void Context()
        {
            base.Context();
            _newName = "TOTO";
            _f1      = new ExplicitFormula("A+B");
            _f2      = new ExplicitFormula("A+B");
            _f3      = new ExplicitFormula("A+B");
            _f1.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "Liver", "Cell"));
            _f1.AddObjectPath(new FormulaUsablePath("Drug", "LogP"));
            _f2.AddObjectPath(new FormulaUsablePath("SU", "Liver", "Cell"));
            _f2.AddObjectPath(new FormulaUsablePath("Drug", "LogP"));
            _f3.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "Liver", "Cell"));
            _f3.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "LogP"));

            var p1 = new PKSimParameter().WithName("P1").WithFormula(_f1);
            var p2 = new PKSimParameter().WithName("P2").WithFormula(_f2);
            var p3 = new PKSimParameter().WithName("P3").WithFormula(_f3);
            var c1 = new Container().WithName("C1");

            c1.Add(p3);
            _root.Add(p1);
            _root.Add(p2);
            _root.Add(c1);

            var results = new SimulationResults {
                Time = new QuantityValues {
                    ColumnId = "0", QuantityPath = "baseGrid"
                }
            };

            _individualResults = new IndividualResults {
                IndividualId = 1
            };
            results.Add(_individualResults);

            var quantityCache = new PathCacheForSpecs <IQuantity>
            {
                { "Liver|Cell|Drug", new MoleculeAmount {
                      QuantityType = QuantityType.Drug
                  } },
                { "Liver|Cell|Meta", new MoleculeAmount {
                      QuantityType = QuantityType.Metabolite
                  } },
            };

            _individualResults.Add(new QuantityValues {
                PathList = new[] { "Liver", "Cell", "Drug" }.ToList()
            });
            _individualResults.Add(new QuantityValues {
                PathList = new[] { "Liver", "Cell", "Meta" }.ToList()
            });

            _individualSimulation.Results            = results;
            _individualSimulation.DataRepository     = new DataRepository();
            _individualSimulation.Reactions          = new ReactionBuildingBlock();
            _individualSimulation.SimulationSettings = new SimulationSettings();
            A.CallTo(_containerTask).WithReturnType <PathCache <IQuantity> >().Returns(quantityCache);

            A.CallTo(() => _curveNamer.RenameCurvesWithOriginalNames(_individualSimulation, A <Action> ._, true)).Invokes(x => x.Arguments[1].DowncastTo <Action>()());
        }
Esempio n. 3
0
        protected override void Context()
        {
            _view                        = A.Fake <IFavoriteParametersView>();
            _parameterTask               = A.Fake <IParameterTask>();
            _favoriteRepository          = A.Fake <IFavoriteRepository>();
            _multiParameterEditPresenter = A.Fake <IMultiParameterEditPresenter>();
            _favoriteTask                = A.Fake <IFavoriteTask>();

            sut = new FavoriteParametersPresenter(_view, _multiParameterEditPresenter, _parameterTask, _favoriteRepository, _favoriteTask);

            _par1       = new PKSimParameter().WithName("par1");
            _par2       = new PKSimParameter().WithName("par2");
            _par3       = new PKSimParameter().WithName("par3");
            _parameters = new List <IParameter> {
                _par1, _par2, _par3
            };
            var pathCache = new PathCache <IParameter>(A.Fake <IEntityPathResolver>())
            {
                { "par1", _par1 }, { "par2", _par2 }, { "par3", _par3 }
            };

            A.CallTo(() => _parameterTask.PathCacheFor(_parameters)).Returns(pathCache);
            _favorites = new List <string>();
            A.CallTo(() => _favoriteRepository.All()).Returns(_favorites);

            A.CallTo(() => _multiParameterEditPresenter.Edit(A <IEnumerable <IParameter> > ._))
            .Invokes(x => _allEditedParameters = x.GetArgument <IEnumerable <IParameter> >(0));
        }
Esempio n. 4
0
        public static IDistributedParameter NormalDistributedParameter(double defaultMean = 0, double defaultDeviation = 1, double defaultPercentile = 0.5)
        {
            var parameter = new PKSimDistributedParameter().WithId("P1");
            var pathFactory = new ObjectPathFactoryForSpecs();
            var meanParameter = new PKSimParameter {
                Name = Constants.Distribution.MEAN
            }.WithFormula(new ConstantFormula(defaultMean).WithId("MeanFormula")).WithId("Mean");

            addDimensionTo(meanParameter);
            var stdParameter = new PKSimParameter {
                Name = Constants.Distribution.DEVIATION
            }.WithFormula(new ConstantFormula(defaultDeviation).WithId("DeviationFormula")).WithId("Deviation");

            addDimensionTo(stdParameter);
            var percentileParameter = new PKSimParameter {
                Name = Constants.Distribution.PERCENTILE
            }.WithFormula(new ConstantFormula(defaultPercentile).WithId("PercentileFormula")).WithId("Percentile");

            addDimensionTo(percentileParameter);
            parameter.Add(meanParameter);
            parameter.Add(stdParameter);
            parameter.Add(percentileParameter);
            parameter.Formula = new NormalDistributionFormula().WithId("NormalDistributionFormula");
            parameter.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(parameter, meanParameter));
            parameter.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(parameter, stdParameter));
            addDimensionTo(parameter);
            return(parameter);
        }
        protected override void Context()
        {
            _view = A.Fake <IMultiParameterEditView>();
            _scaleParameterPresenter    = A.Fake <IScaleParametersPresenter>();
            _parameterTask              = A.Fake <IParameterTask>();
            _contextMenuFactory         = A.Fake <IParameterContextMenuFactory>();
            _favoriteRepository         = A.Fake <IFavoriteRepository>();
            _parameterDTOMapper         = A.Fake <IParameterToParameterDTOMapper>();
            _editParameterPresenterTask = A.Fake <IEditParameterPresenterTask>();
            sut         = new FavoriteParametersPresenter(_view, _scaleParameterPresenter, _editParameterPresenterTask, _parameterTask, _parameterDTOMapper, _contextMenuFactory, _favoriteRepository);
            _par1       = new PKSimParameter().WithName("par1");
            _par2       = new PKSimParameter().WithName("par2");
            _par3       = new PKSimParameter().WithName("par3");
            _parameters = new List <IParameter> {
                _par1, _par2, _par3
            };
            var pathCache = new PathCache <IParameter>(A.Fake <IEntityPathResolver>())
            {
                { "par1", _par1 }, { "par2", _par2 }, { "par3", _par3 }
            };

            A.CallTo(() => _parameterTask.PathCacheFor(_parameters)).Returns(pathCache);
            _par1DTO = new ParameterDTO(_par1);
            _par2DTO = new ParameterDTO(_par2);
            A.CallTo(() => _parameterDTOMapper.MapFrom(_par1)).Returns(_par1DTO);
            A.CallTo(() => _parameterDTOMapper.MapFrom(_par2)).Returns(_par2DTO);
            _favorites = new List <string>();
            A.CallTo(() => _favoriteRepository.All()).Returns(_favorites);
        }
Esempio n. 6
0
        protected override void Context()
        {
            base.Context();
            var otherParameterRate = new PKSimParameter().WithFormula(_paramRate1.Formula).WithName(_paramRate1.Name);

            _organ.Add(otherParameterRate);
        }
        protected override void Context()
        {
            _formulaCache      = A.Fake <IFormulaCache>();
            _repository        = A.Fake <IRepository <IInteractionKineticUpdaterSpecification> >();
            _objectBaseFactory = A.Fake <IObjectBaseFactory>();
            A.CallTo(() => _objectBaseFactory.Create <ExplicitFormula>()).ReturnsLazily(x => new ExplicitFormula());
            A.CallTo(() => _repository.All()).Returns(_allKineticUpdaterSpecifications);
            sut = new InteractionKineticUpdater(_repository, _objectBaseFactory);

            _reaction = new ReactionBuilder();
            _transporterMoleculeContainer = new TransporterMoleculeContainer();
            _simulation            = A.Fake <Simulation>();
            _interactionProperties = new InteractionProperties();

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _enzymeName, ProcessName = _processName
            });
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);


            _kmFactor   = new PKSimParameter().WithName(CoreConstants.Parameter.KM_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));
            _vmaxFactor = new PKSimParameter().WithName(CoreConstants.Parameter.KCAT_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));

            _reaction.Add(_kmFactor);
            _reaction.Add(_vmaxFactor);

            _transporterMoleculeContainer.Add(_kmFactor);
            _transporterMoleculeContainer.Add(_vmaxFactor);
        }
        protected override void Context()
        {
            _randomGenerator = new RandomGenerator();
            sut               = new PKSimDistributedParameter().WithName("P");
            _minValue         = 5;
            _maxValue         = 10;
            sut.Info.MinValue = _minValue;
            sut.Info.MaxValue = _maxValue;

            _pathFactory      = new ObjectPathFactoryForSpecs();
            _minimumParameter = new PKSimParameter {
                Name = Constants.Distribution.MINIMUM
            }.WithFormula(new ExplicitFormula("0"));
            _maximumParameter = new PKSimParameter {
                Name = Constants.Distribution.MAXIMUM
            }.WithFormula(new ExplicitFormula("1"));
            _percentileParameter = new PKSimParameter {
                Name = Constants.Distribution.PERCENTILE
            }.WithFormula(new ExplicitFormula("0.5"));
            sut.Add(_minimumParameter);
            sut.Add(_maximumParameter);
            sut.Add(_percentileParameter);
            _distributedFormula = new UniformDistributionFormula();
            _distributedFormula.AddObjectPath(_pathFactory.CreateRelativeFormulaUsablePath(sut, _minimumParameter).WithAlias(Constants.Distribution.MINIMUM));
            _distributedFormula.AddObjectPath(_pathFactory.CreateRelativeFormulaUsablePath(sut, _maximumParameter).WithAlias(Constants.Distribution.MAXIMUM));
            sut.Formula = _distributedFormula;
        }
 protected override void Context()
 {
     base.Context();
     _parameterNode = A.Fake <ITreeNode <IParameter> >();
     sut.ParameterNodeDoubleClicked += (o, e) => { _parameterNodeDoubleClicked = true; };
     _parameter = new PKSimParameter();
     A.CallTo(() => _parameterNode.Tag).Returns(_parameter);
 }
Esempio n. 10
0
        protected override void Context()
        {
            base.Context();
            _formulation.FormulationType = CoreConstants.Formulation.TABLE;
            var tableParameter = new PKSimParameter().WithName(CoreConstants.Parameters.FRACTION_DOSE).WithFormula(new TableFormula());

            _formulation.Add(tableParameter);
        }
Esempio n. 11
0
        public static IParameter ConstantParameterWithValue(double value)
        {
            var parameter = new PKSimParameter().WithFormula(new ConstantFormula(value).WithId("constantFormulaId"));

            parameter.Visible = true;
            addDimensionTo(parameter);
            parameter.IsFixedValue = true;
            return(parameter);
        }
        protected override void Context()
        {
            base.Context();
            _relativeVMaxValue = 25;
            _containerName     = "C1";
            var relExp = new PKSimParameter();

            relExp.Formula = new ConstantFormula();
            A.CallTo(() => _executionContext.BuildingBlockContaining(relExp)).Returns(_individual);
        }
        protected override void Context()
        {
            base.Context();
            _newName = "TOTO";
            _f1      = new ExplicitFormula("A+B");
            _f2      = new ExplicitFormula("A+B");
            _f3      = new ExplicitFormula("A+B");
            _f1.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "Liver", "Cell"));
            _f1.AddObjectPath(new FormulaUsablePath("Drug", "LogP"));
            _f2.AddObjectPath(new FormulaUsablePath("SU", "Liver", "Cell"));
            _f2.AddObjectPath(new FormulaUsablePath("Drug", "LogP"));
            _f3.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "Liver", "Cell"));
            _f3.AddObjectPath(new FormulaUsablePath(_initialSimulationName, "LogP"));

            var p1 = new PKSimParameter().WithName("P1").WithFormula(_f1);
            var p2 = new PKSimParameter().WithName("P2").WithFormula(_f2);
            var p3 = new PKSimParameter().WithName("P3").WithFormula(_f3);
            var c1 = new Container().WithName("C1");

            c1.Add(p3);
            _root.Add(p1);
            _root.Add(p2);
            _root.Add(c1);

            var results = new SimulationResults {
                Time = new QuantityValues {
                    ColumnId = "0", QuantityPath = "baseGrid"
                }
            };

            _individualResults = new IndividualResults {
                IndividualId = 1
            };
            results.Add(_individualResults);

            var quantityCache = new PathCacheForSpecs <IQuantity>
            {
                { "Liver|Cell|Drug", new MoleculeAmount {
                      QuantityType = QuantityType.Drug
                  } },
                { "Liver|Cell|Meta", new MoleculeAmount {
                      QuantityType = QuantityType.Metabolite
                  } },
            };

            _individualResults.Add(new QuantityValues {
                PathList = new[] { "Liver", "Cell", "Drug" }.ToList()
            });
            _individualResults.Add(new QuantityValues {
                PathList = new[] { "Liver", "Cell", "Meta" }.ToList()
            });

            _individualSimulation.Results = results;
            A.CallTo(_containerTask).WithReturnType <PathCache <IQuantity> >().Returns(quantityCache);
        }
Esempio n. 14
0
 protected override void Context()
 {
     base.Context();
     _entityPathResolver = A.Fake <IEntityPathResolver>();
     _parameter          = new PKSimParameter();
     _parameterPath      = "TOTO";
     sut = new ParameterTask(_entityPathResolver, _executionContext, _favoriteTask);
     A.CallTo(() => _entityPathResolver.PathFor(_parameter)).Returns(_parameterPath);
     A.CallTo(() => _executionContext.PublishEvent(A <AddParameterToFavoritesEvent> ._))
     .Invokes(x => _event = x.GetArgument <AddParameterToFavoritesEvent>(0));
 }
Esempio n. 15
0
 protected override void Context()
 {
     base.Context();
     _fat       = new Container().WithName(CoreConstants.Organ.Fat);
     _muscle    = new Container().WithName(CoreConstants.Organ.Muscle);
     _liver     = new Container().WithName(CoreConstants.Organ.Liver);
     _duodenum  = new Container().WithName(CoreConstants.Compartment.Duodenum);
     _parameter = new PKSimParameter {
         BuildingBlockType = PKSimBuildingBlockType.Individual
     };
 }
Esempio n. 16
0
        protected override void Context()
        {
            base.Context();
            _targetIndividual  = A.Fake <PKSim.Core.Model.Individual>();
            _sourceIndividual  = A.Fake <PKSim.Core.Model.Individual>();
            _parameterScaling1 = A.Fake <ParameterScaling>();
            _parameterScaling2 = A.Fake <ParameterScaling>();
            var volume = new PKSimParameter().WithName(CoreConstants.Parameter.VOLUME).WithParentContainer(new Organ());
            var p2     = new PKSimParameter().WithName("P2").WithParentContainer(new Container());

            A.CallTo(() => _individualScalingTask.AllParameterScalingsFrom(_sourceIndividual, _targetIndividual)).Returns(new[] { _parameterScaling1, _parameterScaling2 });
            A.CallTo(() => _parameterScaling1.SourceParameter).Returns(volume);
            A.CallTo(() => _parameterScaling2.SourceParameter).Returns(p2);
        }
Esempio n. 17
0
        protected override void Context()
        {
            base.Context();
            _fullPathForParameter = "BLA BLA BLA";
            var parameter = new PKSimParameter();

            _validationResult.AddMessage(NotificationType.Warning, parameter, "warning");
            A.CallTo(_fullPathDisplayResolver).WithReturnType <string>().Returns(_fullPathForParameter);

            A.CallTo(() => _dialogCreator.MessageBoxInfo(A <string> ._))
            .Invokes(x => _message = x.GetArgument <string>(0));

            sut.ConfigureSimulation(_originalSimulation);
        }
Esempio n. 18
0
        protected override void Context()
        {
            base.Context();
            var parameter = new PKSimParameter {
                IsDefault = true
            }.WithName("toto").WithFormula(new ExplicitFormula("2*3"));

            parameter.ValueOrigin.Id     = 5;
            parameter.ValueOrigin.Method = ValueOriginDeterminationMethods.InVitro;
            var alternative = new ParameterAlternative {
                parameter
            };

            _nanConstantFormula = new ConstantFormula();
            A.CallTo(() => _objectBaseFactory.Create <ParameterAlternative>()).Returns(alternative);
            A.CallTo(() => _formulaFactory.ValueFor(double.NaN, parameter.Dimension)).Returns(_nanConstantFormula);
            _compoundParameterGroup.Name = CoreConstants.Groups.COMPOUND_PERMEABILITY;
        }
Esempio n. 19
0
        protected override void Context()
        {
            base.Context();
            var dimension = new Dimension(new BaseDimensionRepresentation(), "none", "l/f");

            _newUnit = new Unit("kl/f", 1000, 0);
            dimension.AddUnit(_newUnit);

            _pkSimParameter = new PKSimParameter {
                Dimension = dimension
            };

            _allPKanalysis.First().PKAnalysis.Add(_pkSimParameter);
            _settings = new DefaultPresentationSettings();
            A.CallTo(() => _presenterSettingsTask.PresentationSettingsFor <DefaultPresentationSettings>(A <IPresenterWithSettings> ._, A <IWithId> ._)).Returns(_settings);
            _settings.SetSetting(_pkSimParameter.Name, "kl/f");
            A.CallTo(() => _populationDataCollector.Name).Returns("TOTO");
            sut.LoadSettingsForSubject(A.Fake <IWithId>());
        }
 protected override void Context()
 {
     sut            = new PKSimDistributedParameter();
     _pathFactory   = new ObjectPathFactoryForSpecs();
     _meanParameter = new PKSimParameter {
         Name = Constants.Distribution.MEAN
     }.WithFormula(new ExplicitFormula("10"));
     _stdParameter = new PKSimParameter {
         Name = Constants.Distribution.DEVIATION
     }.WithFormula(new ExplicitFormula("10"));
     _percentileParameter = new PKSimParameter {
         Name = Constants.Distribution.PERCENTILE
     }.WithFormula(new ExplicitFormula("0.5"));
     sut.Add(_meanParameter);
     sut.Add(_stdParameter);
     sut.Add(_percentileParameter);
     sut.Formula = new NormalDistributionFormula();
     sut.Formula.AddObjectPath(_pathFactory.CreateRelativeFormulaUsablePath(sut, _meanParameter));
     sut.Formula.AddObjectPath(_pathFactory.CreateRelativeFormulaUsablePath(sut, _stdParameter));
 }
        protected override void Context()
        {
            base.Context();
            _parameter1            = new PKSimParameter().WithName("P1");
            _parameter2            = new PKSimParameter().WithName("P2");
            _parameter3            = new PKSimParameter().WithName("P3");
            _parameter4            = new PKSimParameter().WithName("P4");
            _parameterNotDisplayed = new PKSimParameter().WithName("P4");

            _parameterList.Add(_parameter1);
            _parameterList.Add(_parameter2);
            _parameterList.Add(_parameter3);
            _parameterList.Add(_parameter4);

            A.CallTo(() => _mapper.MapFrom(A <IParameter> ._)).ReturnsLazily(x => new ParameterDTO(x.GetArgument <IParameter>(0)));
            A.CallTo(() => _view.BindTo(A <IEnumerable <ParameterDTO> > ._))
            .Invokes(x => _allParameterDTO = x.GetArgument <IEnumerable <ParameterDTO> >(0).ToList());

            sut.Edit(_parameterList);
        }
Esempio n. 22
0
        protected override void Context()
        {
            _originValue = 15;
            var container         = new Container();
            var otherParameter    = DomainHelperForSpecs.ConstantParameterWithValue(10).WithName("P");
            var objectPathFactory = new ObjectPathFactoryForSpecs();

            sut = new PKSimParameter().WithName("toto");
            container.Add(otherParameter);
            container.Add(sut);
            sut.Formula = new ExplicitFormula(_originValue.ToString(new NumberFormatInfo()));
            sut.Formula.AddObjectPath(objectPathFactory.CreateRelativeFormulaUsablePath(sut, otherParameter));
            sut.PropertyChanged += (o, e) =>
            {
                if (e.PropertyName.Equals("Value"))
                {
                    _valueChangedEventRaised = true;
                }
            };
        }
Esempio n. 23
0
        protected override void Context()
        {
            base.Context();
            _process = new EnzymaticProcess().WithName("tralala");
            _process.InternalName = "internalNAme";
            _drug         = new MoleculeBuilder().WithName("drug");
            _metabolite   = new MoleculeBuilder().WithName("metabolite");
            _enzymeName   = "enzyme";
            _formulaCache = new FormulaCache();
            _kinetic      = new ExplicitFormula().WithId("trala").WithName("KINETIC");
            _kinetic.AddObjectPath(new FormulaUsablePath(new[] { "Organism", CoreConstants.KeyWords.Molecule }));
            _kinetic.AddObjectPath(new FormulaUsablePath(new[] { "Organism", CoreConstants.KeyWords.Protein }));
            _parameterFormula = new ExplicitFormula();
            _parameterFormula.AddObjectPath(new FormulaUsablePath(new[] { "Liver", CoreConstants.KeyWords.Molecule }));

            _parameterInReaction = new PKSimParameter().WithName("p").WithFormula(_parameterFormula);
            var pkSimReaction = new PKSimReaction().WithName("template");

            pkSimReaction.AddParameter(_parameterInReaction);

            A.CallTo(() => _simulationActiveProcessRepository.ProcessFor <PKSimReaction>(_process.InternalName)).Returns(pkSimReaction);
            pkSimReaction.Formula = _kinetic;
            A.CallTo(() => _cloneManager.Clone <IReactionBuilder>(pkSimReaction)).Returns(pkSimReaction);
        }
 protected override void Context()
 {
     base.Context();
     _parameter    = new PKSimParameter();
     _parameterDTO = new ParameterDTO(_parameter);
 }
Esempio n. 25
0
        public static Individual CreateIndividual(string speciesName = "Species")
        {
            var originData = new OriginData
            {
                SubPopulation = new SubPopulation(),
                Species       = new Species {
                    DisplayName = speciesName, Id = speciesName
                }.WithName(speciesName),
                Gender     = new Gender().WithName("Gender"),
                Population = new SpeciesPopulation().WithName("Population"),
            };

            var pvv      = new ParameterValueVersion().WithName("PVVName");
            var category = new ParameterValueVersionCategory().WithName("CategoryName");

            category.Add(pvv);
            originData.SubPopulation.AddParameterValueVersion(pvv);
            var organism   = new Organism().WithName(Constants.ORGANISM).WithId("OrganismId");
            var organLiver = new Organ().WithName(CoreConstants.Organ.LIVER).WithId("LiverId");

            organLiver.OrganType = OrganType.TissueOrgansNotInGiTract;
            var periportal = new Compartment().WithName(CoreConstants.Compartment.PERIPORTAL).WithId("PeriportalId");

            periportal.Add(new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithId("PeriportalIntracellular"));
            var pericentral = new Compartment().WithName(CoreConstants.Compartment.PERICENTRAL).WithId("PericentralId");

            pericentral.Add(new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithId("PericentralIntracellular"));
            organLiver.Add(periportal);
            organLiver.Add(pericentral);

            var organKidney = new Organ().WithName(CoreConstants.Organ.KIDNEY).WithId("KidneyId");

            organKidney.OrganType = OrganType.TissueOrgansNotInGiTract;
            organKidney.Add(new Compartment {
                Visible = true
            }.WithName(CoreConstants.Compartment.PLASMA).WithId("KidneyPlasma"));
            var lumen = new Organ().WithName("GiTract").WithId("GiTract");

            lumen.OrganType = OrganType.Lumen;

            var duodenum  = new Compartment().WithName("Duodenum").WithId("Duodenum");
            var caecum    = new Compartment().WithName("Caecum").WithId("Caecum");
            var dimension = Constants.Dimension.NO_DIMENSION;

            var parameterLiver = new PKSimParameter().WithName("PLiver").WithId("PLiverId").WithFormula(new ExplicitFormula("1").WithId("1")).WithDimension(dimension);

            parameterLiver.Info = new ParameterValueMetaData {
                DefaultValue = 1
            };
            var parameterKidney = new PKSimParameter().WithName("PKidney").WithId("PKidneyId").WithFormula(new ExplicitFormula("2").WithId("2")).WithDimension(dimension);

            parameterKidney.Info = new ParameterValueMetaData {
                DefaultValue = 2
            };
            var parameterOrganism = new PKSimParameter().WithName(ParameterInOrganism).WithId("POrganismId").WithFormula(new ExplicitFormula("3").WithId("3")).WithDimension(dimension);

            parameterOrganism.Info = new ParameterValueMetaData {
                DefaultValue = 3
            };
            organLiver.Add(parameterLiver);
            organKidney.Add(parameterKidney);
            organism.Add(organLiver);
            organism.Add(organKidney);
            organism.Add(lumen);
            organism.Add(parameterOrganism);
            lumen.Add(duodenum);
            lumen.Add(caecum);

            var individual = new Individual {
                OriginData = originData
            }.WithName("Individual").WithId("IndividualId");

            individual.Add(organism);

            return(individual);
        }
Esempio n. 26
0
        public static Individual CreateIndividual()
        {
            var originData = new OriginData();

            originData.SubPopulation     = new SubPopulation();
            originData.Species           = new Species().WithName("Species");
            originData.Gender            = new Gender().WithName("Gender");
            originData.SpeciesPopulation = new SpeciesPopulation().WithName("Population");
            var pvv      = new ParameterValueVersion().WithName("PVVName");
            var category = new ParameterValueVersionCategory().WithName("CategoryName");

            category.Add(pvv);
            originData.SubPopulation.AddParameterValueVersion(pvv);
            var organism   = new Organism().WithName("Organism").WithId("OrganismId");
            var organLiver = new Organ().WithName(CoreConstants.Organ.Liver).WithId("LiverId");

            organLiver.OrganType = OrganType.Liver;
            var periportal = new Compartment().WithName(CoreConstants.Compartment.Periportal).WithId("PeriportalId");

            periportal.Add(new Container().WithName(CoreConstants.Compartment.Intracellular).WithId("PeriportalIntracellular"));
            var pericentral = new Compartment().WithName(CoreConstants.Compartment.Pericentral).WithId("PericentralId");

            pericentral.Add(new Container().WithName(CoreConstants.Compartment.Intracellular).WithId("PericentralIntracellular"));
            organLiver.Add(periportal);
            organLiver.Add(pericentral);

            var organKidney = new Organ().WithName(CoreConstants.Organ.Kidney).WithId("KidneyId");

            organKidney.OrganType = OrganType.Kidney;
            organKidney.Add(new Compartment {
                Visible = true
            }.WithName(CoreConstants.Compartment.Plasma).WithId("KidneyPlasma"));
            var lumen = new Organ().WithName("GiTract").WithId("GiTract");

            lumen.OrganType = OrganType.Lumen;

            var duodenum  = new Compartment().WithName("Duodenum").WithId("Duodenum");
            var caecum    = new Compartment().WithName("Caecum").WithId("Caecum");
            var dimension = Constants.Dimension.NO_DIMENSION;

            var parameterLiver = new PKSimParameter().WithName("PLiver").WithId("PLiverId").WithFormula(new ExplicitFormula("1").WithId("1")).WithDimension(dimension);

            parameterLiver.Info = new ParameterValueMetaData {
                DefaultValue = 1
            };
            var parameterKidney = new PKSimParameter().WithName("PKidney").WithId("PKidneyId").WithFormula(new ExplicitFormula("2").WithId("2")).WithDimension(dimension);

            parameterKidney.Info = new ParameterValueMetaData {
                DefaultValue = 2
            };
            var parameterOrganism = new PKSimParameter().WithName(ParameterInOrganism).WithId("POrganismId").WithFormula(new ExplicitFormula("3").WithId("3")).WithDimension(dimension);

            parameterOrganism.Info = new ParameterValueMetaData {
                DefaultValue = 3
            };
            organLiver.Add(parameterLiver);
            organKidney.Add(parameterKidney);
            organism.Add(organLiver);
            organism.Add(organKidney);
            organism.Add(lumen);
            organism.Add(parameterOrganism);
            lumen.Add(duodenum);
            lumen.Add(caecum);

            var individual = new Individual {
                OriginData = originData
            }.WithName("Individual").WithId("IndividualId");

            individual.Add(organism);

            return(individual);
        }
 protected override void Context()
 {
     base.Context();
     _source = new PKSimParameter();
     A.CallTo(() => _idGenerator.NewId()).Returns("tralala");
 }
Esempio n. 28
0
 protected override void Context()
 {
     base.Context();
     _parameter = new PKSimParameter().WithFormula(new ConstantFormula(1)).WithName(CoreConstants.Parameter.EHC_ENABLED);
 }