protected override void Because()
        {
            var simulationBatchRunValues = new SimulationBatchRunValues
            {
                InitialValue   = 10.0,
                ParameterValue = 3.0
            };

            _results = sut.Run(simulationBatchRunValues);
        }
        public void should_throw_an_error_if_the_number_of_parameters_values_is_not_the_one_expected()
        {
            var simulationBatchRunValues = new SimulationBatchRunValues
            {
                InitialValues   = new[] { 10.0 },
                ParameterValues = new[] { 3.0 }
            };

            The.Action(() => sut.Run(simulationBatchRunValues)).ShouldThrowAn <Exception>();
        }
示例#3
0
        /// <summary>
        ///    Updates the parameter values and species initial values of the simulation and run the simulation synchronously.
        ///    This is really the only method that will be called from R
        /// </summary>
        /// <returns>Results of the simulation run</returns>
        public SimulationResults Run(SimulationBatchRunValues simulationBatchRunValues)
        {
            _simModelBatch.UpdateParameterValues(simulationBatchRunValues.Values);
            _simModelBatch.UpdateInitialValues(simulationBatchRunValues.MoleculeValues);
            var simulationResults = _simModelBatch.RunSimulation();

            if (!_simulationBatchOptions.CalculateSensitivity)
            {
                return(_simulationResultsCreator.CreateResultsFrom(simulationResults.Results));
            }

            return(_simulationResultsCreator.CreateResultsWithSensitivitiesFrom(simulationResults.Results, _simModelBatch, _simulationBatchOptions.Parameters));
        }
 public void AddSimulationBatchRunValues(SimulationBatchRunValues simulationBatchRunValues)
 {
     _simulationBatchRunValues.Add(simulationBatchRunValues);
 }
示例#5
0
 public Task <SimulationResults> RunAsync(SimulationBatchRunValues simulationBatchRunValues)
 {
     return(Task.Run(() => Run(simulationBatchRunValues)));
 }