Exemplo n.º 1
0
        protected override void Context()
        {
            _dataFactory               = A.Fake <IDataFactory>();
            _simModelExporter          = A.Fake <ISimModelExporter>();
            _simModelSimulationFactory = A.Fake <ISimModelSimulationFactory>();
            _simModelSimulation        = A.Fake <ISimulation>();

            sut = new SimModelBatch(_simModelExporter, _simModelSimulationFactory, _dataFactory);

            A.CallTo(() => _simModelSimulationFactory.Create()).Returns(_simModelSimulation);
            _modelCoreSimulation = A.Fake <IModelCoreSimulation>();
            _simModelXmlString   = "SimModelXml";
            A.CallTo(() => _simModelExporter.Export(_modelCoreSimulation, SimModelExportMode.Optimized)).Returns(_simModelXmlString);

            _parameterProperties1 = A.Fake <IParameterProperties>();
            _parameterProperties2 = A.Fake <IParameterProperties>();
            _parameterProperties3 = A.Fake <IParameterProperties>();

            A.CallTo(() => _parameterProperties1.Path).Returns("ParameterPath1");
            A.CallTo(() => _parameterProperties2.Path).Returns("ParameterPath2");
            A.CallTo(() => _parameterProperties3.Path).Returns("ParameterPath3");

            _allSimModelParameters = new List <IParameterProperties> {
                _parameterProperties1, _parameterProperties2, _parameterProperties3
            };
            A.CallTo(() => _simModelSimulation.ParameterProperties).Returns(_allSimModelParameters);

            _variableParameterPaths = new List <string> {
                _parameterProperties1.Path, _parameterProperties2.Path
            };
        }
Exemplo n.º 2
0
 public SimModelManagerFactory(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IMoBiContext context, IDataNamingService dataNamingService, IDisplayUnitRetriever displayUnitRetriever)
 {
     _simModelExporter          = simModelExporter;
     _simModelSimulationFactory = simModelSimulationFactory;
     _context              = context;
     _dataNamingService    = dataNamingService;
     _displayUnitRetriever = displayUnitRetriever;
 }
Exemplo n.º 3
0
 public SimModelManagerFactory(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IMoBiContext context, IDisplayUnitRetriever displayUnitRetriever, IDataRepositoryTask dataRepositoryTask)
 {
     _simModelExporter          = simModelExporter;
     _simModelSimulationFactory = simModelSimulationFactory;
     _context = context;
     _displayUnitRetriever = displayUnitRetriever;
     _dataRepositoryTask   = dataRepositoryTask;
 }
Exemplo n.º 4
0
 public SimModelManager(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IDataFactory dataFactory) : base(simModelExporter, simModelSimulationFactory)
 {
     _dataFactory        = dataFactory;
     _executionTimeLimit = 0;
     _timer = new Timer {
         Interval = 1000
     };
     _timer.Elapsed += onTimeElapsed;
 }
Exemplo n.º 5
0
 public PopulationRunner(
     ISimModelExporter simModelExporter,
     ISimModelSimulationFactory simModelSimulationFactory,
     IObjectPathFactory objectPathFactory,
     IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : base(simModelExporter, simModelSimulationFactory)
 {
     _objectPathFactory             = objectPathFactory;
     _entitiesInSimulationRetriever = entitiesInSimulationRetriever;
 }
Exemplo n.º 6
0
 public ParameterIdentificationExportTask(IDialogCreator dialogCreator, ISimModelExporter simModelExporter, ISimulationToModelCoreSimulationMapper simulationToModelCoreSimulationMapper,
                                          ILazyLoadTask lazyLoadTask, IParameterIdentificationExporter parameterIdentificationExporter, IExportDataTableToExcelTask exportToExcelTask)
 {
     _dialogCreator    = dialogCreator;
     _simModelExporter = simModelExporter;
     _simulationToModelCoreSimulationMapper = simulationToModelCoreSimulationMapper;
     _lazyLoadTask = lazyLoadTask;
     _parameterIdentificationExporter = parameterIdentificationExporter;
     _exportToExcelTask = exportToExcelTask;
 }
Exemplo n.º 7
0
        protected override void Context()
        {
            base.Context();

            _buildConfigurationFactory = IoC.Resolve <IBuildConfigurationFactory>();
            _modelConstructor          = IoC.Resolve <IModelConstructor>();
            _simModelExporter          = IoC.Resolve <ISimModelExporter>();
            _dateRepositoryTask        = IoC.Resolve <IDataRepositoryTask>();
            _directory = Path.Combine(Path.Combine(Path.Combine(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\.."), "Core", "SBML", "Testfiles", "SBMLTestSuite"))));
        }
Exemplo n.º 8
0
 public EditTasksForSimulation(IInteractionTaskContext interactionTaskContext, ISimulationPersistor simulationPersistor, IDialogCreator dialogCreator,
                               IForbiddenNamesRetriever forbiddenNamesRetriver, IDataRepositoryTask dataRepositoryTask,
                               IModelReportCreator reportCreator, ISimModelExporter simModelExporter, IDimensionFactory dimensionFactory) : base(interactionTaskContext)
 {
     _simulationPersistor    = simulationPersistor;
     _dialogCreator          = dialogCreator;
     _forbiddenNamesRetriver = forbiddenNamesRetriver;
     _dataRepositoryTask     = dataRepositoryTask;
     _reportCreator          = reportCreator;
     _simModelExporter       = simModelExporter;
     _dimensionFactory       = dimensionFactory;
 }
Exemplo n.º 9
0
 protected override void Context()
 {
     _context                 = A.Fake <IInteractionTaskContext>();
     _simulationPersitor      = A.Fake <ISimulationPersistor>();
     _dialogCreator           = A.Fake <IDialogCreator>();
     _forbiddenNamesRetriever = A.Fake <IForbiddenNamesRetriever>();
     _dataRepositoryTask      = A.Fake <IDataRepositoryTask>();
     _simulationModelExporter = A.Fake <ISimModelExporter>();
     _reportCreator           = A.Fake <IModelReportCreator>();
     _dimensionFactory        = A.Fake <IDimensionFactory>();
     sut = new EditTasksForSimulation(_context, _simulationPersitor, _dialogCreator, _forbiddenNamesRetriever, _dataRepositoryTask, _reportCreator, _simulationModelExporter, _dimensionFactory);
 }
Exemplo n.º 10
0
        protected override void Context()
        {
            _context                 = A.Fake <IInteractionTaskContext>();
            _simulationPersistor     = A.Fake <ISimulationPersistor>();
            _dialogCreator           = A.Fake <IDialogCreator>();
            _dataRepositoryTask      = A.Fake <IDataRepositoryExportTask>();
            _simulationModelExporter = A.Fake <ISimModelExporter>();
            _reportCreator           = A.Fake <IModelReportCreator>();
            _dimensionFactory        = A.Fake <IDimensionFactory>();
            _parameterIdentificationSimulationPathUpdater = A.Fake <IParameterIdentificationSimulationPathUpdater>();

            sut = new EditTasksForSimulation(_context, _simulationPersistor, _dialogCreator, _dataRepositoryTask, _reportCreator, _simulationModelExporter, _dimensionFactory, _parameterIdentificationSimulationPathUpdater);
        }
Exemplo n.º 11
0
 protected override void Context()
 {
     _quantityDisplayPathMapper             = A.Fake <IQuantityPathToQuantityDisplayPathMapper>();
     _buildingBlockTask                     = A.Fake <IBuildingBlockTask>();
     _dialogCreator                         = A.Fake <IDialogCreator>();
     _dataRepositoryTask                    = A.Fake <IDataRepositoryTask>();
     _stringSerializer                      = A.Fake <IStringSerializer>();
     _modelReportCreator                    = A.Fake <IModelReportCreator>();
     _simulationMapper                      = A.Fake <ISimulationToModelCoreSimulationMapper>();
     _simModelExporter                      = A.Fake <ISimModelExporter>();
     _simulationResultsToDataTableConverter = A.Fake <ISimulationResultsToDataTableConverter>();
     sut = new SimulationExportTask(_buildingBlockTask, _dialogCreator, _dataRepositoryTask, _quantityDisplayPathMapper,
                                    _stringSerializer, _modelReportCreator, _simulationMapper, _simModelExporter, _simulationResultsToDataTableConverter);
 }
Exemplo n.º 12
0
 public SimulationExportTask(IBuildingBlockTask buildingBlockTask, IDialogCreator dialogCreator, IDataRepositoryTask dataRepositoryTask,
                             IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IStringSerializer stringSerializer,
                             IModelReportCreator modelReportCreator, ISimulationToModelCoreSimulationMapper coreSimulationMapper, ISimModelExporter simModelExporter, ISimulationResultsToDataTableConverter simulationResultsToDataTableConverter)
 {
     _buildingBlockTask                     = buildingBlockTask;
     _dialogCreator                         = dialogCreator;
     _dataRepositoryTask                    = dataRepositoryTask;
     _quantityDisplayPathMapper             = quantityDisplayPathMapper;
     _stringSerializer                      = stringSerializer;
     _modelReportCreator                    = modelReportCreator;
     _coreSimulationMapper                  = coreSimulationMapper;
     _simModelExporter                      = simModelExporter;
     _simulationResultsToDataTableConverter = simulationResultsToDataTableConverter;
 }
 protected override void Context()
 {
     _deletedDirectories = new List <string>();
     _parameterIdentificationExporter = A.Fake <IParameterIdentificationExporter>();
     _lazyLoadTask = A.Fake <ILazyLoadTask>();
     _simulationToModelCoreSimulationMapper = A.Fake <ISimulationToModelCoreSimulationMapper>();
     _simModelExporter             = A.Fake <ISimModelExporter>();
     _dialogCreator                = A.Fake <IDialogCreator>();
     _exportToExcelTask            = A.Fake <IExportDataTableToExcelTask>();
     _parameterIdentification      = A.Fake <ParameterIdentification>();
     _writtenFileCache             = new Cache <string, string>();
     _parameterIdentification.Name = "name with spaces";
     _createdDirectories           = new List <string>();
     sut = new ParameterIdentificationExportTask(_dialogCreator, _simModelExporter, _simulationToModelCoreSimulationMapper, _lazyLoadTask, _parameterIdentificationExporter, _exportToExcelTask);
 }
Exemplo n.º 14
0
 public PopulationExportTask(IApplicationController applicationController, IEntityPathResolver entityPathResolver,
                             ILazyLoadTask lazyLoadTask, ISimModelExporter simModelExporter, ISimulationToModelCoreSimulationMapper modelCoreSimulationMapper,
                             IWorkspace workspace, IPKSimConfiguration configuration, ISimulationSettingsRetriever simulationSettingsRetriever,
                             IDialogCreator dialogCreator, ICloner cloner)
 {
     _applicationController     = applicationController;
     _entityPathResolver        = entityPathResolver;
     _lazyLoadTask              = lazyLoadTask;
     _simModelExporter          = simModelExporter;
     _modelCoreSimulationMapper = modelCoreSimulationMapper;
     _workspace     = workspace;
     _configuration = configuration;
     _simulationSettingsRetriever = simulationSettingsRetriever;
     _dialogCreator = dialogCreator;
     _cloner        = cloner;
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _simModelExporter     = IoC.Resolve <ISimModelExporter>();
            _withIdRepository     = IoC.Resolve <IWithIdRepository>();
            _namingFactory        = A.Fake <IDataNamingService>();
            _dimensionFactory     = IoC.Resolve <IDimensionFactory>();
            _objectPathFactory    = IoC.Resolve <IObjectPathFactory>();
            _displayUnitRetriever = IoC.Resolve <IDisplayUnitRetriever>();

            _simulation = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            new RegisterTaskForSpecs(_withIdRepository).RegisterAllIn(_simulation.Model.Root);
            var schemaPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "OSPSuite.SimModel.xsd");

            XMLSchemaCache.InitializeFromFile(schemaPath);
            sut = new SimModelManager(_simModelExporter, new SimModelSimulationFactory(), new DataFactory(_dimensionFactory, _namingFactory, _objectPathFactory, _displayUnitRetriever));
        }
Exemplo n.º 16
0
        protected override Task Context()
        {
            _quantityDisplayPathMapper = A.Fake <IQuantityPathToQuantityDisplayPathMapper>();
            _lazyLoadTask       = A.Fake <ILazyLoadTask>();
            _dialogCreator      = A.Fake <IDialogCreator>();
            _dataRepositoryTask = A.Fake <IDataRepositoryExportTask>();
            _stringSerializer   = A.Fake <IStringSerializer>();
            _modelReportCreator = A.Fake <IModelReportCreator>();
            _simulationMapper   = A.Fake <ISimulationToModelCoreSimulationMapper>();
            _simModelExporter   = A.Fake <ISimModelExporter>();
            _simulationResultsToDataTableConverter = A.Fake <ISimulationResultsToDataTableConverter>();
            _populationSimulationPKAnalysesToDataTableConverter = A.Fake <IPopulationSimulationPKAnalysesToDataTableConverter>();
            sut = new SimulationExportTask(_lazyLoadTask, _dialogCreator, _dataRepositoryTask, _quantityDisplayPathMapper,
                                           _stringSerializer, _modelReportCreator, _simulationMapper, _simModelExporter, _simulationResultsToDataTableConverter, _populationSimulationPKAnalysesToDataTableConverter);

            return(_completed);
        }
Exemplo n.º 17
0
 public EditTasksForSimulation(
     IInteractionTaskContext interactionTaskContext,
     ISimulationPersistor simulationPersistor,
     IDialogCreator dialogCreator,
     IDataRepositoryTask dataRepositoryTask,
     IModelReportCreator reportCreator,
     ISimModelExporter simModelExporter,
     IDimensionFactory dimensionFactory,
     IParameterIdentificationSimulationPathUpdater parameterIdentificationSimulationPathUpdater) : base(interactionTaskContext)
 {
     _simulationPersistor = simulationPersistor;
     _dialogCreator       = dialogCreator;
     _dataRepositoryTask  = dataRepositoryTask;
     _reportCreator       = reportCreator;
     _simModelExporter    = simModelExporter;
     _dimensionFactory    = dimensionFactory;
     _parameterIdentificationSimulationPathUpdater = parameterIdentificationSimulationPathUpdater;
 }
Exemplo n.º 18
0
 protected override void Context()
 {
     _configuration               = A.Fake <IPKSimConfiguration>();
     _applicationController       = A.Fake <IApplicationController>();
     _workspace                   = A.Fake <IWorkspace>();
     _entityPathResolver          = A.Fake <IEntityPathResolver>();
     _selectFilePresenter         = A.Fake <ISelectFilePresenter>();
     _lazyLoadTask                = A.Fake <ILazyLoadTask>();
     _simModelExporter            = A.Fake <ISimModelExporter>();
     _modelCoreSimulationMapper   = A.Fake <ISimulationToModelCoreSimulationMapper>();
     _simulationSettingsRetriever = A.Fake <ISimulationSettingsRetriever>();
     _dialogCreator               = A.Fake <IDialogCreator>();
     _cloner     = A.Fake <ICloner>();
     _population = A.Fake <Population>().WithName("MyPop");
     A.CallTo(() => _population.AllCovariateNames).Returns(new[] { CoreConstants.Covariates.GENDER, CoreConstants.Covariates.RACE });
     A.CallTo(() => _applicationController.Start <ISelectFilePresenter>()).Returns(_selectFilePresenter);
     sut = new PopulationExportTask(_applicationController, _entityPathResolver, _lazyLoadTask, _simModelExporter,
                                    _modelCoreSimulationMapper, _workspace, _configuration, _simulationSettingsRetriever, _dialogCreator, _cloner);
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _simModelExporter            = IoC.Resolve <ISimModelExporter>();
            _withIdRepository            = IoC.Resolve <IWithIdRepository>();
            _objectPathFactory           = IoC.Resolve <IObjectPathFactory>();
            _entityInSimulationRetriever = IoC.Resolve <IEntitiesInSimulationRetriever>();

            _simulation = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            new RegisterTaskForSpecs(_withIdRepository).RegisterAllIn(_simulation.Model.Root);

            _populationData    = createPopTableParameters();
            _agingData         = createPopAgingParameters();
            _initialValuesData = createPopInitialValues();

            _runOptions = new RunOptions();
            sut         = new PopulationRunner(_simModelExporter, new SimModelSimulationFactory(), _objectPathFactory, _entityInSimulationRetriever);

            _results = sut.RunPopulationAsync(_simulation, _runOptions, _populationData, _agingData).Result;
        }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _simModelExporter  = IoC.Resolve <ISimModelExporter>();
            _withIdRepository  = IoC.Resolve <IWithIdRepository>();
            _objectPathFactory = IoC.Resolve <IObjectPathFactory>();

            _simulation = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            new RegisterTaskForSpecs(_withIdRepository).RegisterAllIn(_simulation.Model.Root);
            var schemaPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "OSPSuite.SimModel.xsd");

            XMLSchemaCache.InitializeFromFile(schemaPath);

            _populationData    = createPopTableParameters();
            _agingData         = createPopAgingParameters();
            _initialValuesData = createPopInitialValues();

            sut = new PopulationRunner(_simModelExporter, new SimModelSimulationFactory(), _objectPathFactory);

            _results = sut.RunPopulationAsync(_simulation, _populationData, _agingData).Result;
        }
Exemplo n.º 21
0
 public SimulationExportTask(
     ILazyLoadTask lazyLoadTask,
     IDialogCreator dialogCreator,
     IDataRepositoryExportTask dataRepositoryTask,
     IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper,
     IStringSerializer stringSerializer,
     IModelReportCreator modelReportCreator,
     ISimulationToModelCoreSimulationMapper coreSimulationMapper,
     ISimModelExporter simModelExporter,
     ISimulationResultsToDataTableConverter simulationResultsToDataTableConverter,
     IPopulationSimulationPKAnalysesToDataTableConverter populationSimulationPKAnalysesToDataTableConverter)
 {
     _lazyLoadTask                          = lazyLoadTask;
     _dialogCreator                         = dialogCreator;
     _dataRepositoryTask                    = dataRepositoryTask;
     _quantityDisplayPathMapper             = quantityDisplayPathMapper;
     _stringSerializer                      = stringSerializer;
     _modelReportCreator                    = modelReportCreator;
     _coreSimulationMapper                  = coreSimulationMapper;
     _simModelExporter                      = simModelExporter;
     _simulationResultsToDataTableConverter = simulationResultsToDataTableConverter;
     _populationSimulationPKAnalysesToDataTableConverter = populationSimulationPKAnalysesToDataTableConverter;
 }
Exemplo n.º 22
0
 public SimulationAnalyzer(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory) : base(simModelExporter, simModelSimulationFactory)
 {
 }
Exemplo n.º 23
0
 public SimModelBatch(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IDataFactory dataFactory) : base(
         simModelExporter, simModelSimulationFactory)
 {
     _dataFactory = dataFactory;
     KeepXMLNodeInSimModelSimulation = false;
 }
Exemplo n.º 24
0
 protected SimModelManagerBase(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory)
 {
     _simModelExporter          = simModelExporter;
     _simModelSimulationFactory = simModelSimulationFactory;
 }
Exemplo n.º 25
0
 public SimModelManagerForSpecs(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory) : base(simModelExporter, simModelSimulationFactory)
 {
 }
Exemplo n.º 26
0
 internal MatlabHelper(ISimModelExporter simModelExporter, ISimulationTransferLoader simulationTransferLoader)
 {
     _simModelExporter         = simModelExporter;
     _simulationTransferLoader = simulationTransferLoader;
 }
Exemplo n.º 27
0
 public SimModelBatch(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IDataFactory dataFactory) : base(simModelExporter, simModelSimulationFactory)
 {
     _dataFactory         = dataFactory;
     _parameterValueCache = new Cache <string, double>();
 }
Exemplo n.º 28
0
 public PopulationRunner(ISimModelExporter simModelExporter, ISimModelSimulationFactory simModelSimulationFactory, IObjectPathFactory objectPathFactory) : base(simModelExporter, simModelSimulationFactory)
 {
     _objectPathFactory = objectPathFactory;
     NumberOfCoresToUse = 1;
 }