コード例 #1
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _compoundProcessRepository = IoC.Resolve <ICompoundProcessRepository>();
     _cloneManager                 = IoC.Resolve <ICloneManager>();
     _enzymeFactory                = IoC.Resolve <IIndividualEnzymeFactory>();
     _transporterFactory           = IoC.Resolve <IIndividualTransporterFactory>();
     _modelPropertiesTask          = IoC.Resolve <IModelPropertiesTask>();
     _modelConfigurationRepository = IoC.Resolve <IModelConfigurationRepository>();
     _compound   = DomainFactoryForSpecs.CreateStandardCompound();
     _individual = DomainFactoryForSpecs.CreateStandardIndividual();
     _protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();
     _enzyme     = _enzymeFactory.CreateFor(_individual).DowncastTo <IndividualEnzyme>().WithName("CYP");
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.Plasma).Value              = _relExpNormPls;
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.BloodCells).Value          = _relExpNormBloodCells;
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.VascularEndothelium).Value = _relExpVascEndo;
     _individual.AddMolecule(_enzyme);
     _hct = _individual.Organism.Parameter(CoreConstants.Parameters.HCT).Value;
     _metabolizationProcess      = _cloneManager.Clone(_compoundProcessRepository.ProcessByName(CoreConstantsForSpecs.Process.METABOLIZATION_SPECIFIC_FIRST_ORDER).DowncastTo <PartialProcess>());
     _metabolizationProcess.Name = "My Partial Process";
     _metabolizationProcess.Parameter(ConverterConstants.Parameter.CLspec).Value = 15;
     _compound.AddProcess(_metabolizationProcess);
     _simulationRunOptions = new SimulationRunOptions {
         RaiseEvents = false
     };
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _buildConfigurationTask = IoC.Resolve <IBuildConfigurationTask>();
            _entityPathResolver     = IoC.Resolve <IEntityPathResolver>();
            var enzymeFactory             = IoC.Resolve <IIndividualEnzymeFactory>();
            var compoundProcessRepository = IoC.Resolve <ICompoundProcessRepository>();
            var cloneManager = IoC.Resolve <ICloneManager>();

            _compound              = DomainFactoryForSpecs.CreateStandardCompound();
            _individual            = DomainFactoryForSpecs.CreateStandardIndividual();
            _protocol              = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();
            _enzyme                = enzymeFactory.AddMoleculeTo(_individual, "CYP").DowncastTo <IndividualEnzyme>();
            _metabolizationProcess = cloneManager.Clone(compoundProcessRepository
                                                        .ProcessByName(CoreConstantsForSpecs.Process.METABOLIZATION_SPECIFIC_FIRST_ORDER).DowncastTo <PartialProcess>());
            _metabolizationProcess.Name = "My Partial Process";
            _metabolizationProcess.Parameter(ConverterConstants.Parameters.CLspec).Value = 15;
            _compound.AddProcess(_metabolizationProcess);

            _simulation = DomainFactoryForSpecs.CreateModelLessSimulationWith(_individual, _compound, _protocol)
                          .DowncastTo <IndividualSimulation>();

            _simulation.CompoundPropertiesList.First()
            .Processes
            .MetabolizationSelection
            .AddPartialProcessSelection(new EnzymaticProcessSelection {
                ProcessName = _metabolizationProcess.Name, MoleculeName = _enzyme.Name
            });

            DomainFactoryForSpecs.AddModelToSimulation(_simulation);
        }