Exemple #1
0
 protected override void Context()
 {
     base.Context();
     _popSim1 = new PopulationSimulation {
         IsLoaded = true
     }.WithId("PopSim1");
     _popSim2 = new PopulationSimulation {
         IsLoaded = true
     }.WithId("PopSim2");
     _objectBaseRepository = IoC.Resolve <IWithIdRepository>();
     _objectBaseRepository.Register(_popSim1);
     _objectBaseRepository.Register(_popSim2);
     _populationSimulationComparison = new PopulationSimulationComparison();
     _populationSimulationComparison.AddSimulation(_popSim1);
     _populationSimulationComparison.AddSimulation(_popSim2);
     _populationSimulationComparison.ReferenceSimulation = _popSim1;
     _groupingItem = new GroupingItem {
         Color = Color.Black, Label = "Reference", Symbol = Symbols.Circle
     };
     _populationSimulationComparison.ReferenceGroupingItem = _groupingItem;
     _populationSimulationComparison.SelectedDistributions.Add(new ParameterDistributionSettings {
         ParameterPath = "P1", Settings = new DistributionSettings {
             AxisCountMode = AxisCountMode.Percent
         }
     });
 }
Exemple #2
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _idRepository = IoC.Resolve <IWithIdRepository>();
            var baseGrid = new BaseGrid("base", Constants.Dimension.NO_DIMENSION);

            _dataColumn = new DataColumn("Col", Constants.Dimension.NO_DIMENSION, baseGrid);
            _dataColumn.DataInfo.Origin = ColumnOrigins.Observation;
            _dataRepository             = new DataRepository();
            _dataRepository.Add(_dataColumn);
            _idRepository.Register(_dataRepository);
        }
Exemple #3
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _withIdRepository    = IoC.Resolve <IWithIdRepository>();
     _simulation          = new IndividualSimulation().WithId("Sim");
     _simulation.IsLoaded = true;
     _withIdRepository.Register(_simulation);
     _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Ind", PKSimBuildingBlockType.Individual)
     {
         BuildingBlock = DomainHelperForSpecs.CreateIndividual()
     });
     _transporter = new IndividualTransporter().WithName("Trans");
     _enzyme      = new IndividualEnzyme().WithName("Enz");
     _simulation.Individual.AddMolecule(_transporter);
     _simulation.Individual.AddMolecule(_enzyme);
 }
 private void register <TObject>(TObject objectToRegister) where TObject : IWithId
 {
     _withIdRepository.Register(objectToRegister);
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _observedData = DomainHelperForSpecs.ObservedData();
            _sim1         = new IndividualSimulation
            {
                Id       = "Sim1",
                Name     = "Sim1",
                IsLoaded = true,
                Model    = new Model {
                    Root = new Container()
                }
            };
            _sim1.Model.Root.Add(new Container {
                new Parameter().WithName("P")
            }.WithName("Liver"));
            _sim2 = new IndividualSimulation
            {
                Id       = "Sim2",
                Name     = "Sim2",
                IsLoaded = true,
                Model    = new Model {
                    Root = new Container()
                }
            };
            _sim2.Model.Root.Add(new Container {
                new Parameter().WithName("P")
            }.WithName("Liver"));

            _objectBaseRepository = IoC.Resolve <IWithIdRepository>();
            var workspace = IoC.Resolve <ICoreWorkspace>();

            _project          = IoC.Resolve <PKSimProject>();
            workspace.Project = _project;
            _objectBaseRepository.Register(_sim1);
            _objectBaseRepository.Register(_sim2);
            _project.AddObservedData(_observedData);
            _project.AddBuildingBlock(_sim1);
            _project.AddBuildingBlock(_sim2);

            _parameterIdentification = new ParameterIdentification();
            _parameterIdentification.AddSimulation(_sim1);
            _parameterIdentification.AddSimulation(_sim2);

            _outputMapping = new OutputMapping
            {
                WeightedObservedData = new WeightedObservedData(_observedData),
                OutputSelection      = new SimulationQuantitySelection(_sim1, new QuantitySelection("A|B", QuantityType.Metabolite)),
                Weight  = 5,
                Scaling = Scalings.Log
            };

            _outputMapping.WeightedObservedData.Weights[1] = 10;
            _parameterIdentification.AddOutputMapping(_outputMapping);

            _identificationParameter = DomainHelperForSpecs.IdentificationParameter(min: 1, max: 10, startValue: 5);

            _parameterSelection1 = new ParameterSelection(_sim1, new QuantitySelection("Liver|P", QuantityType.Parameter));
            _parameterSelection2 = new ParameterSelection(_sim2, new QuantitySelection("Liver|P", QuantityType.Parameter));
            _identificationParameter.AddLinkedParameter(_parameterSelection1);
            _identificationParameter.AddLinkedParameter(_parameterSelection2);
            _parameterIdentification.AddIdentificationParameter(_identificationParameter);
            _identificationParameter.Scaling = Scalings.Linear;

            _parameterIdentification.Configuration.AlgorithmProperties = new OptimizationAlgorithmProperties("AA");
            _parameterIdentification.AlgorithmProperties.Add(new ExtendedProperty <double> {
                Name = "Toto", Value = 5
            });

            _runResult = new ParameterIdentificationRunResult();

            _parameterIdentification.AddResult(_runResult);

            _parameterIdentification.AddAnalysis(new ParameterIdentificationPredictedVsObservedChart());
            _parameterIdentification.AddAnalysis(new ParameterIdentificationTimeProfileChart());
            _parameterIdentification.AddAnalysis(new ParameterIdentificationResidualHistogram());
            _parameterIdentification.AddAnalysis(new ParameterIdentificationResidualVsTimeChart());

            GlobalBecause();
        }
Exemple #6
0
 public void Visit(IObjectBase objToVisit)
 {
     _withIdRepository.Register(objToVisit);
 }