Beispiel #1
0
        public override void GlobalContext()
        {
            base.GlobalContext();

            _objectPathFactory   = IoC.Resolve <IObjectPathFactory>();
            _modelCoreSimulation = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            var simModelExporter          = IoC.Resolve <ISimModelExporter>();
            var simModelSimulationFactory = A.Fake <ISimModelSimulationFactory>();

            A.CallTo(() => simModelSimulationFactory.Create()).Returns(new Simulation());
            _simModelManagerForSpecs = new SimModelManagerForSpecs(simModelExporter, simModelSimulationFactory);

            _simModelSimulation     = _simModelManagerForSpecs.CreateSimulation(_modelCoreSimulation);
            _dataFactory            = A.Fake <IDataFactory>();
            _variableParameterPaths = new[]
            {
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.BW).PathAsString,
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.TableParameter1).PathAsString,
            };

            _variableSpeciesPath = new []
            {
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.ArterialBlood, ConstantsForSpecs.Plasma, "A").PathAsString,
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.VenousBlood, ConstantsForSpecs.Plasma, "B").PathAsString,
            };

            sut = new SimModelBatch(simModelExporter, simModelSimulationFactory, _dataFactory);
        }
Beispiel #2
0
        public override void GlobalContext()
        {
            base.GlobalContext();

            _objectPathFactory = IoC.Resolve <IObjectPathFactory>();
            _simulation        = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            var simModelExporter            = IoC.Resolve <ISimModelExporter>();
            var simModelSimulationFactory   = IoC.Resolve <ISimModelSimulationFactory>();
            var entityInSimulationRetriever = IoC.Resolve <IEntitiesInSimulationRetriever>();

            _simModelManagerForSpecs = new SimModelManagerForSpecs(simModelExporter, simModelSimulationFactory);
            _simModelSimulation      = _simModelManagerForSpecs.CreateSimulation(_simulation);
            _populationData          = createPopTableParameters();
            _agingData         = createPopAgingParameters();
            _initialValuesData = createPopInitialValues();
            _parameterCache    = entityInSimulationRetriever.ParametersFrom(_simulation);
            sut = new PopulationDataSplitter(_numberOfCores, _populationData, _agingData, _initialValuesData);

            _variableParameters = _simModelManagerForSpecs.SetVariableParameters(_simModelSimulation, sut.ParameterPathsToBeVaried());
            _variableSpecies    = _simModelManagerForSpecs.SetVariableSpecies(_simModelSimulation, sut.InitialValuesPathsToBeVaried());
        }