コード例 #1
0
ファイル: Entity.cs プロジェクト: Yuri05/OSPSuite.Core
        public override void UpdatePropertiesFrom(IUpdatable source, ICloneManager cloneManager)
        {
            base.UpdatePropertiesFrom(source, cloneManager);
            var sourceEntity = source as IEntity;

            sourceEntity?.Tags.Each(t => AddTag(t.Value));
        }
コード例 #2
0
        public CheckNameVisitor(IObjectTypeResolver objectTypeResolver, IAliasCreator aliasCreator, IParameterStartValuePathTask psvPathTask, IMoleculeStartValuePathTask msvPathTask, ICloneManager cloneManager)
        {
            _objectTypeResolver = objectTypeResolver;
            _aliasCreator       = aliasCreator;
            _psvPathTask        = psvPathTask;
            _msvPathTask        = msvPathTask;
            _cloneManager       = cloneManager;

            Expression <Func <IObjectBase, string> > nameString = x => x.Name;

            _namePropertyName = nameString.Name();

            Expression <Func <IApplicationBuilder, string> > appBuilderMoleculeName = x => x.MoleculeName;

            _appBuilderMoleculeNamePropertyName = appBuilderMoleculeName.Name();

            Expression <Func <IReactionPartnerBuilder, string> > reactionPartnerMoleculeName = x => x.MoleculeName;

            _reactionPartnerMoleculeNamePropertyName = reactionPartnerMoleculeName.Name();

            Expression <Func <IEventAssignmentBuilder, IObjectPath> > eventObjectPath = x => x.ObjectPath;

            _eventObjectPathPropertyName = eventObjectPath.Name();
            Expression <Func <TransporterMoleculeContainer, string> > tranportName = x => x.TransportName;

            _tranportNamePropertyName = tranportName.Name();
        }
コード例 #3
0
        public virtual ObserverSetProperties Clone(ICloneManager cloneManager)
        {
            var clone = new ObserverSetProperties();

            clone.AddObserverSetMappings(ObserverSetMappings.Select(x => x.Clone(cloneManager)));
            return(clone);
        }
コード例 #4
0
 public DistributedParameterToTableParameterConverter(
     IFormulaFactory formulaFactory,
     IEntityPathResolver entityPathResolver,
     IParameterFactory parameterFactory,
     ICloneManager cloneManager,
     IParameterQuery parameterQuery,
     IDimensionRepository dimensionRepository,
     IOntogenyRepository ontogenyRepository,
     IFullPathDisplayResolver fullPathDisplayResolver,
     IInterpolation interpolation,
     IParameterStartValuesCreator parameterStartValuesCreator,
     IObjectPathFactory objectPathFactory,
     IGenderRepository genderRepository)
 {
     _formulaFactory              = formulaFactory;
     _entityPathResolver          = entityPathResolver;
     _parameterFactory            = parameterFactory;
     _cloneManager                = cloneManager;
     _parameterQuery              = parameterQuery;
     _dimensionRepository         = dimensionRepository;
     _ontogenyRepository          = ontogenyRepository;
     _fullPathDisplayResolver     = fullPathDisplayResolver;
     _interpolation               = interpolation;
     _parameterStartValuesCreator = parameterStartValuesCreator;
     _objectPathFactory           = objectPathFactory;
     _genderRepository            = genderRepository;
     _timeDimension               = dimensionRepository.Time;
     _yearUnit = _timeDimension.Unit(dimensionRepository.AgeInYears.BaseUnit.Name);
 }
コード例 #5
0
        public virtual InteractionProperties Clone(ICloneManager cloneManager)
        {
            var clone = new InteractionProperties();

            Interactions.Each(x => clone.AddInteraction(x.Clone(cloneManager)));
            return(clone);
        }
コード例 #6
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
     };
 }
コード例 #7
0
 public ExecutionContext(IPKSimProjectRetriever projectRetriever, IWithIdRepository withIdRepository,
                         ILazyLoadTask lazyLoadTask, IRegistrationTask registrationTask,
                         IEventPublisher eventPublisher, IObjectTypeResolver objectTypeResolver,
                         IBuildingBlockRetriever buildingBlockRetriever, ICompressedSerializationManager serializationManager,
                         IBuildingBlockVersionUpdater buildingBlockVersionUpdater, IProjectChangedNotifier projectChangedNotifier,
                         ICloner cloner, IContainer container,
                         IReportGenerator reportGenerator,
                         IFullPathDisplayResolver fullPathDisplayResolver,
                         IParameterChangeUpdater parameterChangeUpdater)
 {
     _projectRetriever            = projectRetriever;
     _withIdRepository            = withIdRepository;
     _lazyLoadTask                = lazyLoadTask;
     _registrationTask            = registrationTask;
     _eventPublisher              = eventPublisher;
     _objectTypeResolver          = objectTypeResolver;
     _buildingBlockRetriever      = buildingBlockRetriever;
     _serializationManager        = serializationManager;
     _buildingBlockVersionUpdater = buildingBlockVersionUpdater;
     _projectChangedNotifier      = projectChangedNotifier;
     CloneManager             = cloner;
     _container               = container;
     _reportGenerator         = reportGenerator;
     _fullPathDisplayResolver = fullPathDisplayResolver;
     _parameterChangeUpdater  = parameterChangeUpdater;
 }
コード例 #8
0
        public virtual EventProperties Clone(ICloneManager cloneManager)
        {
            var clone = new EventProperties();

            clone.AddEventMappings(EventMappings.Select(x => x.Clone(cloneManager)));
            return(clone);
        }
コード例 #9
0
        public override void UpdatePropertiesFrom(IUpdatable source, ICloneManager cloneManager)
        {
            base.UpdatePropertiesFrom(source, cloneManager);
            var valueMapping = source as ValueMappingGroupingDefinition;

            valueMapping?.Mapping.KeyValues.Each(kv => Mapping.Add(kv.Key, cloneManager.Clone(kv.Value)));
        }
コード例 #10
0
 protected override void Context()
 {
     _view         = A.Fake <IModalChartTemplateManagerView>();
     _cloneManager = A.Fake <ICloneManager>();
     _chartTemplateManagerPresenter = A.Fake <IChartTemplateManagerPresenter>();
     sut = new ModalChartTemplateManagerPresenter(_view, _chartTemplateManagerPresenter, _cloneManager);
 }
コード例 #11
0
        public virtual EventProperties Clone(ICloneManager cloneManager)
        {
            var clone = new EventProperties();

            EventMappings.Each(em => clone.AddEventMapping(em.Clone(cloneManager)));
            return(clone);
        }
コード例 #12
0
ファイル: SchemaSpecs.cs プロジェクト: valdiman/PK-Sim
        protected override void Context()
        {
            _cloneManager = new DummyCloneManager();
            sut           = new Schema();
            //2 hours delay
            sut.Add(DomainHelperForSpecs.ConstantParameterWithValue(120).WithName(Constants.Parameters.START_TIME));
            //6hours between repetitions
            sut.Add(DomainHelperForSpecs.ConstantParameterWithValue(360).WithName(CoreConstants.Parameter.TIME_BETWEEN_REPETITIONS));
            //repeat the schema 4 times
            sut.Add(DomainHelperForSpecs.ConstantParameterWithValue(4).WithName(CoreConstants.Parameter.NUMBER_OF_REPETITIONS));


            var schemaItem1 = new SchemaItem().WithName("SchemaItem1");

            schemaItem1.Add(DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(Constants.Parameters.START_TIME));
            schemaItem1.Add(DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(CoreConstants.Parameter.INPUT_DOSE));
            schemaItem1.ApplicationType = ApplicationTypes.Intravenous;

            var schemaItem2 = new SchemaItem().WithName("SchemaItem2");

            schemaItem2.Add(DomainHelperForSpecs.ConstantParameterWithValue(180).WithName(Constants.Parameters.START_TIME));
            schemaItem2.Add(DomainHelperForSpecs.ConstantParameterWithValue(2).WithName(CoreConstants.Parameter.INPUT_DOSE));
            schemaItem2.ApplicationType = ApplicationTypes.Intravenous;


            sut.AddSchemaItem(schemaItem1);
            sut.AddSchemaItem(schemaItem2);
        }
コード例 #13
0
ファイル: ProcessSelection.cs プロジェクト: yvkashyap/PK-Sim
        public virtual ProcessSelection Clone(ICloneManager cloneManager)
        {
            var clone = new ProcessSelection();

            clone.UpdatePropertiesFrom(this, cloneManager);
            return(clone);
        }
コード例 #14
0
        public override ProcessSelection Clone(ICloneManager cloneManager)
        {
            var clone = new EnzymaticProcessSelection();

            clone.UpdatePropertiesFrom(this, cloneManager);
            return(clone);
        }
コード例 #15
0
ファイル: ModelProperties.cs プロジェクト: yvkashyap/PK-Sim
 public virtual ModelProperties Clone(ICloneManager cloneManager)
 {
     return(new ModelProperties
     {
         ModelConfiguration = ModelConfiguration,
         CalculationMethodCache = CalculationMethodCache.Clone()
     });
 }
コード例 #16
0
 public ChartFromTemplateService(IDimensionFactory dimensionFactory, IKeyPathMapper keyPathMapper, IDialogCreator dialogCreator, ICloneManager cloneManager, IChartUpdater chartUpdater)
 {
     _dimensionFactory = dimensionFactory;
     _keyPathMapper    = keyPathMapper;
     _dialogCreator    = dialogCreator;
     _cloneManager     = cloneManager;
     _chartUpdater     = chartUpdater;
 }
コード例 #17
0
 public ModalChartTemplateManagerPresenter(IModalChartTemplateManagerView view, IChartTemplateManagerPresenter chartTemplateManagerPresenter, ICloneManager cloneManager)
     : base(view)
 {
     _chartTemplateManagerPresenter = chartTemplateManagerPresenter;
     _cloneManager = cloneManager;
     AddSubPresenters(_chartTemplateManagerPresenter);
     view.SetBaseView(_chartTemplateManagerPresenter.BaseView);
 }
コード例 #18
0
        public ProcessSelectionGroup Clone(ICloneManager cloneManager)
        {
            var clone = new ProcessSelectionGroup(ProductNameTemplate);

            _partialProcesses.Each(x => clone.AddPartialProcessSelection(x.Clone(cloneManager)));
            _systemicProcesses.Each(x => clone.AddSystemicProcessSelection(x.Clone(cloneManager)));
            return(clone);
        }
コード例 #19
0
 public DisplayUnitsPresenter(IDisplayUnitsView view, IDimensionFactory dimensionFactory,
                              IDialogCreator dialogCreator, ISerializationTask serializationTask, ICloneManagerForModel cloneManager)
     : base(view)
 {
     _dimensionFactory  = dimensionFactory;
     _dialogCreator     = dialogCreator;
     _serializationTask = serializationTask;
     _cloneManager      = cloneManager;
 }
コード例 #20
0
 public CompoundProcessesSelection Clone(ICloneManager cloneManager)
 {
     return(new CompoundProcessesSelection
     {
         MetabolizationSelection = MetabolizationSelection.Clone(cloneManager),
         TransportAndExcretionSelection = TransportAndExcretionSelection.Clone(cloneManager),
         SpecificBindingSelection = SpecificBindingSelection.Clone(cloneManager)
     });
 }
コード例 #21
0
 protected override void Context()
 {
     base.Context();
     _cloneManager             = A.Fake <ICloneManager>();
     _simulationDiagramManager = A.Fake <ISimulationDiagramManager>();
     _moBiSimulation           = new MoBiSimulation {
         DiagramManager = _simulationDiagramManager
     };
 }
コード例 #22
0
 protected override void Context()
 {
     base.Context();
     _cloneManager     = A.Fake <ICloneManager>();
     _diagramManager   = A.Fake <ISpatialStructureDiagramManager>();
     _spatialStructure = new MoBiSpatialStructure {
         DiagramManager = _diagramManager
     };
 }
コード例 #23
0
 protected override void Context()
 {
     base.Context();
     _cloneManager = A.Fake <ICloneManager>();
     _sourceParameterIdentification = new IdentificationParameter {
         Name = "TOTO", IsFixed = true, UseAsFactor = false
     };
     _sourceParameterIdentification.AddLinkedParameter(_parameterSelection);
 }
コード例 #24
0
 protected override void Context()
 {
     base.Context();
     _cloneManager = A.Fake <ICloneManager>();
     _sourceFixedLimitDefinition = new FixedLimitsGroupingDefinition("Field");
     _sourceFixedLimitDefinition.SetLimits(new [] { 1.5, 2.5 }.OrderBy(x => x));
     _sourceFixedLimitDefinition.Dimension   = DomainHelperForSpecs.TimeDimensionForSpecs();
     _sourceFixedLimitDefinition.DisplayUnit = _sourceFixedLimitDefinition.Dimension.Unit("h");
 }
コード例 #25
0
 protected override void Context()
 {
     base.Context();
     _cloneManager   = A.Fake <ICloneManager>();
     _sourceMolecule = new IndividualEnzyme {
         Ontogeny = new UserDefinedOntogeny()
     };
     _clonedOntogeny = new UserDefinedOntogeny();
     A.CallTo(() => _cloneManager.Clone(_sourceMolecule.Ontogeny)).Returns(_clonedOntogeny);
 }
コード例 #26
0
 public UserDisplayUnitsPresenter(IUserDisplayUnitsView view, IDisplayUnitsPresenter displayUnitsPresenter, IUserSettings userSettings, ICloneManager cloneManager)
     : base(view)
 {
     _displayUnitsPresenter = displayUnitsPresenter;
     _userSettings          = userSettings;
     _cloneManager          = cloneManager;
     AddSubPresenters(_displayUnitsPresenter);
     _view.AddView(_displayUnitsPresenter.View);
     _settingsToEdit = cloneManager.Clone(_userSettings.DisplayUnits);
 }
コード例 #27
0
        public ImportPopulationSettings Clone(ICloneManager cloneManager)
        {
            var settings = new ImportPopulationSettings
            {
                BaseIndividual = cloneManager.Clone(BaseIndividual)
            };

            _allFiles.Each(f => settings.AddFile(f.Clone()));
            return(settings);
        }
コード例 #28
0
        public void UpdatePropertiesFrom(IUpdatable source, ICloneManager cloneManager)
        {
            var originalChart = source as SummaryChart;

            if (originalChart == null)
            {
                return;
            }
            UpdateFrom(originalChart);
        }
コード例 #29
0
        public RandomPopulationSettings Clone(ICloneManager cloneManager)
        {
            var clone = new RandomPopulationSettings {
                BaseIndividual = cloneManager.Clone(BaseIndividual), NumberOfIndividuals = NumberOfIndividuals
            };

            _genderRatios.Each(gr => clone.AddGenderRatio(gr.Clone()));
            _parameterRanges.Each(pr => clone.AddParameterRange(pr.Clone()));
            return(clone);
        }
コード例 #30
0
        public void UpdatePropertiesFrom(IUpdatable source, ICloneManager cloneManager)
        {
            var originalChart = source as IndividualSimulationComparison;

            if (originalChart == null)
            {
                return;
            }
            UpdateFrom(originalChart);
        }